diff --git a/Bitfile b/Bitfile new file mode 100644 index 0000000000..addf3fbb7c --- /dev/null +++ b/Bitfile @@ -0,0 +1,78 @@ +VERSION = %(git describe --tags --always --dirty)% +DEST = build +RELEASE = %{DEST}/release + +GO_SOURCES = **/*.go + + +SCHEMA_IN = backend/schema/schema.go backend/schema/protobuf.go \ + cmd/ftl/cmd_schema.go +SCHEMA_OUT = protos/xyz/block/ftl/v1/schema/schema.proto + +PROTO_IN = **/*.proto **/buf.* protos/xyz/block/ftl/v1/schema/schema.proto +PROTO_OUT = protos/xyz/block/ftl/v1/ftlv1connect/ftl.connect.go \ + protos/xyz/block/ftl/v1/schema/schema.pb.go \ + protos/xyz/block/ftl/v1/console/console.pb.go \ + protos/xyz/block/ftl/v1/schema/runtime.pb.go \ + protos/xyz/block/ftl/v1/ftl.pb.go \ + console/client/src/protos/xyz/block/ftl/v1/ftl_connect.ts \ + console/client/src/protos/xyz/block/ftl/v1/schema/schema_pb.ts \ + console/client/src/protos/xyz/block/ftl/v1/schema/runtime_pb.ts \ + console/client/src/protos/xyz/block/ftl/v1/ftl_pb.ts \ + console/client/src/protos/xyz/block/ftl/v1/console/console_pb.ts + +COMMON_LOG_IN = backend/common/log/api.go +COMMON_LOG_OUT = backend/common/log/log_level_string.go + +KT_RUNTIME_IN = kotlin-runtime/ftl-runtime/**/*.{kt,kts} kotlin-runtime/gradle/libs.versions.toml +KT_RUNTIME_OUT = kotlin-runtime/ftl-runtime/build/libs/ftl-runtime.jar + +CLIENT_OUT = console/client/dist/index.html +CLIENT_IN = console/client/**/* + +#virtual release: +# inputs: %{RELEASE}/ftl %{RELEASE}/ftl-controller %{RELEASE}/ftl-runner + +%{RELEASE}: + build: install -m 0700 -d %{OUT} + +# Build all binaries +implicit %{RELEASE}/%{1}: cmd/* + inputs: %{RELEASE} %{GO_SOURCES} + build: go build -o %{OUT} -tags release -ldflags "-X main.version=%{VERSION}" ./cmd/%{1} + +#%{RELEASE}/ftl-controller: %{RELEASE} %{GO_SOURCES} #%{CLIENT_OUT} +# build: go build -o %{OUT} -tags release -ldflags "-X main.version=%{VERSION}" ./cmd/ftl-controller + +%{SCHEMA_OUT}: %{SCHEMA_IN} + build: ftl-schema > %{OUT} + +%{PROTO_OUT}: %{PROTO_IN} + build: + buf format -w + buf lint + (cd protos && buf generate) + (cd backend/common/3rdparty/protos && buf generate) + -clean + +export GRADLE_OPTS = -Dorg.gradle.console=plain + +%{KT_RUNTIME_OUT}: %{KT_RUNTIME_IN} %{PROTO_IN} + cd kotlin-runtime/ftl-runtime + build: gradle jar + +clean: gradle clean + +build/template/ftl/jars: + build: install -m 0700 -d %{OUT} + +build/template/ftl/jars/ftl-runtime.jar: %{KT_RUNTIME_OUT} build/template/ftl/jars + build: install -m 0600 %{KT_RUNTIME_OUT} %{OUT} + +%{COMMON_LOG_OUT}: %{COMMON_LOG_IN} + build: go generate %{IN} + +#%{CLIENT_OUT}: %{CLIENT_IN} +# cd console/client +# build: +# npm install +# npm run build diff --git a/bin/.bit-0.0.1.pkg b/bin/.bit-0.0.1.pkg new file mode 120000 index 0000000000..383f4511d4 --- /dev/null +++ b/bin/.bit-0.0.1.pkg @@ -0,0 +1 @@ +hermit \ No newline at end of file diff --git a/bin/bit b/bin/bit new file mode 120000 index 0000000000..95e8cd8173 --- /dev/null +++ b/bin/bit @@ -0,0 +1 @@ +.bit-0.0.1.pkg \ No newline at end of file diff --git a/cmd/ftl-schema/main.go b/cmd/ftl-schema/main.go new file mode 100644 index 0000000000..5547aaf1ae --- /dev/null +++ b/cmd/ftl-schema/main.go @@ -0,0 +1,11 @@ +package main + +import ( + "fmt" + + "github.com/TBD54566975/ftl/backend/schema" +) + +func main() { + fmt.Println(schema.ProtobufSchema()) +} diff --git a/scripts/ftl-schema b/scripts/ftl-schema new file mode 120000 index 0000000000..1db38bf169 --- /dev/null +++ b/scripts/ftl-schema @@ -0,0 +1 @@ +ftl \ No newline at end of file