From da4ff6fc79e123ec0108d971f3372554c1d06720 Mon Sep 17 00:00:00 2001 From: Alec Thomas Date: Sat, 17 Aug 2024 23:30:31 +1000 Subject: [PATCH] fix: add go.mod file to jvm scaffolding dirs (#2414) Without these the Go toolchain tries to scan the directories and fails due to the | characters, which are not supported by Go's build system. Fixes the following failure: ``` info: go: finding module for package github.com/TBD54566975/ftl/go-runtime/ftl go: downloading github.com/TBD54566975/ftl v0.345.0 go: ftl/builtin imports github.com/TBD54566975/ftl/go-runtime/ftl: create zip: jvm-runtime/java/scaffolding/{{ .Name | camel | lower }}/ftl.toml: malformed file path "jvm-runtime/java/scaffolding/{{ .Name | camel | lower }}/ftl.toml": invalid char '|' jvm-runtime/java/scaffolding/{{ .Name | camel | lower }}/pom.xml.tmpl: malformed file path "jvm-runtime/java/scaffolding/{{ .Name | camel | lower }}/pom.xml.tmpl": invalid char '|' jvm-runtime/java/scaffolding/{{ .Name | camel | lower }}/src/main/java/{{ .PackageDir }}/EchoVerb.java: malformed file path "jvm-runtime/java/scaffolding/{{ .Name | camel | lower }}/src/main/java/{{ .PackageDir }}/EchoVerb.java": invalid char '|' jvm-runtime/kotlin/scaffolding/{{ .Name | camel | lower }}/ftl.toml: malformed file path "jvm-runtime/kotlin/scaffolding/{{ .Name | camel | lower }}/ftl.toml": invalid char '|' jvm-runtime/kotlin/scaffolding/{{ .Name | camel | lower }}/pom.xml.tmpl: malformed file path "jvm-runtime/kotlin/scaffolding/{{ .Name | camel | lower }}/pom.xml.tmpl": invalid char '|' jvm-runtime/kotlin/scaffolding/{{ .Name | camel | lower }}/src/main/kotlin/{{ .PackageDir }}/EchoVerb.kt: malformed file path "jvm-runtime/kotlin/scaffolding/{{ .Name | camel | lower }}/src/main/kotlin/{{ .PackageDir }}/EchoVerb.kt": invalid char '|' ``` There is an underlying bug that is triggering this, whereby replace directives aren't correctly propagated to the shared Go FTL module stubs. Filed #2415 for this. --- jvm-runtime/java/scaffolding/go.mod | 3 +++ jvm-runtime/kotlin/scaffolding/go.mod | 3 +++ 2 files changed, 6 insertions(+) create mode 100644 jvm-runtime/java/scaffolding/go.mod create mode 100644 jvm-runtime/kotlin/scaffolding/go.mod diff --git a/jvm-runtime/java/scaffolding/go.mod b/jvm-runtime/java/scaffolding/go.mod new file mode 100644 index 0000000000..378e960a73 --- /dev/null +++ b/jvm-runtime/java/scaffolding/go.mod @@ -0,0 +1,3 @@ +module ignore + +go 1.22.6 diff --git a/jvm-runtime/kotlin/scaffolding/go.mod b/jvm-runtime/kotlin/scaffolding/go.mod new file mode 100644 index 0000000000..378e960a73 --- /dev/null +++ b/jvm-runtime/kotlin/scaffolding/go.mod @@ -0,0 +1,3 @@ +module ignore + +go 1.22.6