From 454266166452b33d74458b4eea2d3157457f59d4 Mon Sep 17 00:00:00 2001 From: Alec Thomas Date: Mon, 15 Jan 2024 15:34:14 +1100 Subject: [PATCH] fix: add missing go.work.tmpl files --- .github/workflows/release.yml | 6 +++--- .gitignore | 3 ++- Bitfile | 12 ++++++------ Dockerfile.controller | 2 +- Dockerfile.runner | 2 +- Justfile | 6 +++--- backend/common/moduleconfig/config.go | 2 +- go-runtime/compile/build-template/go.work.tmpl | 7 +++++++ .../compile/external-module-template/go.work.tmpl | 6 ++++++ 9 files changed, 30 insertions(+), 16 deletions(-) create mode 100644 go-runtime/compile/build-template/go.work.tmpl create mode 100644 go-runtime/compile/external-module-template/go.work.tmpl diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 20d4f9ddb5..d822c93c62 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -112,9 +112,9 @@ jobs: cache: "maven" - name: Publish JARs # Snapshots are published first, then the tagged release run: | - mvn -U --batch-mode clean deploy -P release - mvn --batch-mode versions:set -DnewVersion=$(git describe --tags --abbrev=0 | cut -c2-) -DprocessAllModules -DgenerateBackupPoms=false - mvn -U --batch-mode clean deploy -P release + mvn -U -B clean deploy -P release + mvn -B versions:set -DnewVersion=$(git describe --tags --abbrev=0 | cut -c2-) -DprocessAllModules -DgenerateBackupPoms=false + mvn -U -B clean deploy -P release git clean -f *.flattened_pom.xml env: SIGN_KEY_PASS: ${{ secrets.GPG_PASSPHRASE }} diff --git a/.gitignore b/.gitignore index 1c767da164..aa82714680 100644 --- a/.gitignore +++ b/.gitignore @@ -14,4 +14,5 @@ generated_ftl_module.go *.zip dist/ examples/**/_ftl/ -go.work* +examples/**/go.work +examples/**/go.work.sum diff --git a/Bitfile b/Bitfile index b02bd40347..8ed763ba71 100644 --- a/Bitfile +++ b/Bitfile @@ -118,15 +118,15 @@ kotlin-runtime/scaffolding.zip: kotlin-runtime/scaffolding/**/* %{KT_RUNTIME_OUT}: %{KT_RUNTIME_IN} %{PROTO_IN} build: - mvn -N install - mvn -pl :ftl-runtime install - +clean: mvn -pl :ftl-runtime clean + mvn -B -N install + mvn -B -pl :ftl-runtime install + +clean: mvn -B -pl :ftl-runtime clean %{KT_GENERATOR_OUT}: %{KT_GENERATOR_IN} build: - mvn -N install - mvn -pl :ftl-generator install - +clean: mvn -pl :ftl-generator clean + mvn -B -N install + mvn -B -pl :ftl-generator install + +clean: mvn -B -pl :ftl-generator clean %(dirname %{KT_RUNTIME_RUNNER_TEMPLATE_OUT})%: build: install -m 0700 -d %{OUT} diff --git a/Dockerfile.controller b/Dockerfile.controller index 26a59faeff..15e80ed559 100644 --- a/Dockerfile.controller +++ b/Dockerfile.controller @@ -10,7 +10,7 @@ WORKDIR /src # Seed some of the most common tools - this will be cached RUN go version -RUN mvn --version +RUN mvn -B --version # Download Go dependencies separately so Docker will cache them COPY go.mod go.sum ./ diff --git a/Dockerfile.runner b/Dockerfile.runner index d9ae3b4a50..39d0f99441 100644 --- a/Dockerfile.runner +++ b/Dockerfile.runner @@ -12,7 +12,7 @@ RUN hermit install openjre-18.0.2.1_1 RUN hermit uninstall openjre RUN hermit install jbr RUN go version -RUN mvn --version +RUN mvn -B --version WORKDIR /src diff --git a/Justfile b/Justfile index ffe9415763..23cf3ac64f 100644 --- a/Justfile +++ b/Justfile @@ -3,15 +3,15 @@ install-jars: install-root-jar install-generator-jar install-runtime-jar # Install root JAR to local Maven repository install-root-jar: - mvn install + mvn -B install # Install ftl-generator JAR to local Maven repository install-generator-jar: - mvn -pl :ftl-generator install + mvn -B -pl :ftl-generator install # Install ftl-runtime JAR to local Maven repository install-runtime-jar: - mvn -pl :ftl-runtime install + mvn -B -pl :ftl-runtime install # Deploy the Go time module deploy-time: diff --git a/backend/common/moduleconfig/config.go b/backend/common/moduleconfig/config.go index 13a087c3f3..8f16d6da99 100644 --- a/backend/common/moduleconfig/config.go +++ b/backend/common/moduleconfig/config.go @@ -53,7 +53,7 @@ func setConfigDefaults(moduleDir string, config *ModuleConfig) error { switch config.Language { case "kotlin": if config.Build == "" { - config.Build = "mvn --batch-mode compile" + config.Build = "mvn -B compile" } if config.DeployDir == "" { config.DeployDir = "target" diff --git a/go-runtime/compile/build-template/go.work.tmpl b/go-runtime/compile/build-template/go.work.tmpl new file mode 100644 index 0000000000..2489cee3a8 --- /dev/null +++ b/go-runtime/compile/build-template/go.work.tmpl @@ -0,0 +1,7 @@ +go 1.21.6 + +use ( + . + _ftl/go/modules + _ftl/go/main +) diff --git a/go-runtime/compile/external-module-template/go.work.tmpl b/go-runtime/compile/external-module-template/go.work.tmpl new file mode 100644 index 0000000000..ab720ef2dd --- /dev/null +++ b/go-runtime/compile/external-module-template/go.work.tmpl @@ -0,0 +1,6 @@ +go 1.21.6 + +use ( + . + _ftl/go/modules +)