diff --git a/backend/common/moduleconfig/config.go b/backend/common/moduleconfig/config.go index 888b9ecf30..1b7b758696 100644 --- a/backend/common/moduleconfig/config.go +++ b/backend/common/moduleconfig/config.go @@ -14,6 +14,7 @@ type ModuleConfig struct { Language string `toml:"language"` Module string `toml:"module"` Deploy []string `toml:"deploy"` + Schema string `toml:"schema"` } // LoadConfig from a directory. diff --git a/cmd/ftl/cmd_deploy.go b/cmd/ftl/cmd_deploy.go index cfdc3a9c29..6b36555ba3 100644 --- a/cmd/ftl/cmd_deploy.go +++ b/cmd/ftl/cmd_deploy.go @@ -54,7 +54,7 @@ func (d *deployCmd) Run(ctx context.Context, client ftlv1connect.ControllerServi return errors.WithStack(err) } - schema, err := findFiles(d.Base, []string{config.Module}) + schema, err := findFiles(d.Base, []string{config.Schema}) if err != nil { return errors.WithStack(err) } diff --git a/kotlin-runtime/ftl-generator/src/main/kotlin/xyz/block/ftl/generator/ModuleGenerator.kt b/kotlin-runtime/ftl-generator/src/main/kotlin/xyz/block/ftl/generator/ModuleGenerator.kt index 8072e603b4..c86e8ff1e8 100644 --- a/kotlin-runtime/ftl-generator/src/main/kotlin/xyz/block/ftl/generator/ModuleGenerator.kt +++ b/kotlin-runtime/ftl-generator/src/main/kotlin/xyz/block/ftl/generator/ModuleGenerator.kt @@ -173,9 +173,10 @@ class ModuleGenerator() { Path.of(buildDir, "ftl.toml").writeText( """ - module = "${module}" + module = "$module" language = "kotlin" deploy = ["main", "classes", "dependency", "classpath.txt"] + schema = "schema.pb" """.trimIndent() ) diff --git a/kotlin-runtime/ftl-runtime/src/main/kotlin/xyz/block/ftl/ksp/SchemaExtractor.kt b/kotlin-runtime/ftl-runtime/src/main/kotlin/xyz/block/ftl/ksp/SchemaExtractor.kt index fe4c174912..ea1cebf576 100644 --- a/kotlin-runtime/ftl-runtime/src/main/kotlin/xyz/block/ftl/ksp/SchemaExtractor.kt +++ b/kotlin-runtime/ftl-runtime/src/main/kotlin/xyz/block/ftl/ksp/SchemaExtractor.kt @@ -164,7 +164,7 @@ class SchemaExtractor(val logger: KSPLogger, val options: Map) : modules.map { Module(name = it.key, decls = it.value.decls.sortedBy { it.data_ == null }, comments = it.value.comments) }.forEach { - val file = File(outputDirectory.absolutePath, it.name) + val file = File(outputDirectory.absolutePath, "schema.pb") file.createNewFile() val os = FileOutputStream(file) os.write(it.encode())