Mantle: drop schema generation from build script
@@ -14,45 +14,6 @@ version=$(git describe --tags --always --dirty)
version="${version#v}"
version="${version/-/+}"
ldflags="-X ${REPO_PATH}/version.Version=${version}"
-schema_generate() {
- export GOBIN="../tools/bin"
- mkdir -p ${GOBIN}
- if [ ! -x "${GOBIN}/schematyper" ]; then
- (
- echo "Building schematyper"
- cd schematyper &&
- go build -mod vendor -o "${GOBIN}/schematyper" .
- )
- fi
-
- schema_version="v1"
- schema_json="../src/schema/${schema_version}.json"
- echo "Generating COSA Schema ${schema_version}"
-
- out="cosa/cosa_${schema_version}.go"
- "${GOBIN}/schematyper" \
- "../src/schema/${schema_version}.json" \
- -o "${out}.tmp" \
- --package="cosa" \
- --root-type=Build \
- --ptr-for-omit
- # Avoid having a filename in generated code since it
- # can vary depending on local checkout paths.
- sed -e s,'^// generated by "\(/.*\)/schematyper\(.*\)$,// generated by "schematyper\2,' < "${out}.tmp" > "${out}".tmp2
- rm -f "${out}.tmp"
- mv "${out}"{.tmp2,}
-
- cat > "cosa/schema_doc.go.tmp" <<EOM
-// Generated by ${0}
-// DO NOT EDIT
-
-package cosa
-
-var generatedSchemaJSON = \`$(< ${schema_json})
-\`
-EOM
- mv cosa/schema_doc.go{.tmp,}
-}
host_build() {
local cmd=$1; shift
@@ -88,14 +49,10 @@ cross_build() {
}
for arg in "$@"; do
- if [ "${arg}" = "schema" ]; then
- schema_generate
- else
cmd=$(basename "${arg}")
if [ "${cmd}" = "kolet" ]; then
host_static_build kolet
else
host_build "${cmd}"
fi
- fi
done
