Skip to content

Commit

Permalink
fix: pin to current ftl version
Browse files Browse the repository at this point in the history
  • Loading branch information
wesbillman committed Feb 16, 2024
1 parent 52e3c27 commit 4031026
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 13 deletions.
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
module main

go {{ .GoVersion }}
go {{ .GoVersion }}

{{ if ne .FTLVersion "dev" }}
require github.com/TBD54566975/ftl {{ .FTLVersion }}
{{ end }}
28 changes: 16 additions & 12 deletions go-runtime/compile/build.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,18 +26,20 @@ import (
type externalModuleContext struct {
ModuleDir string
*schema.Schema
GoVersion string
Main string
GoVersion string
FTLVersion string
Main string
}

type goVerb struct {
Name string
}

type mainModuleContext struct {
GoVersion string
Name string
Verbs []goVerb
GoVersion string
FTLVersion string
Name string
Verbs []goVerb
}

func (b externalModuleContext) NonMainModules() []*schema.Module {
Expand Down Expand Up @@ -75,10 +77,11 @@ func Build(ctx context.Context, moduleDir string, sch *schema.Schema) error {

logger.Debugf("Generating external modules")
if err := internal.ScaffoldZip(externalModuleTemplateFiles(), moduleDir, externalModuleContext{
ModuleDir: moduleDir,
GoVersion: goModVersion,
Schema: sch,
Main: config.Module,
ModuleDir: moduleDir,
GoVersion: goModVersion,
FTLVersion: ftl.Version,
Schema: sch,
Main: config.Module,
}, scaffolder.Exclude("^go.mod$"), scaffolder.Functions(funcs)); err != nil {
return err
}
Expand Down Expand Up @@ -114,9 +117,10 @@ func Build(ctx context.Context, moduleDir string, sch *schema.Schema) error {
}
}
if err := internal.ScaffoldZip(buildTemplateFiles(), moduleDir, mainModuleContext{
GoVersion: goModVersion,
Name: main.Name,
Verbs: goVerbs,
GoVersion: goModVersion,
FTLVersion: ftl.Version,
Name: main.Name,
Verbs: goVerbs,
}, scaffolder.Exclude("^go.mod$"), scaffolder.Functions(funcs)); err != nil {
return err
}
Expand Down

0 comments on commit 4031026

Please sign in to comment.