Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move codegen from Maven into the ftl tooling. #970

Closed
Tracked by #960
alecthomas opened this issue Feb 22, 2024 · 0 comments · Fixed by #988
Closed
Tracked by #960

Move codegen from Maven into the ftl tooling. #970

alecthomas opened this issue Feb 22, 2024 · 0 comments · Fixed by #988
Assignees

Comments

@alecthomas
Copy link
Collaborator

alecthomas commented Feb 22, 2024

Use the same pattern as go-runtime/compile.Build, which uses scaffolder to generate stubs in Go. We want the same thing in Kotlin. Use internal.ScaffoldZip() rather than scaffolder directly, as it adds common functions.

The way we get the templates into the ftl binary differs between development mode and production. In development we load zip files directly from disk. In a production release build we use bit to build the zip and go:embed to embed it. See devel.go and release.go for examples.

I would just shove in the entire schema as the template context, removing any modules that the target module isn't importing.

@github-actions github-actions bot added the triage Issue needs triaging label Feb 22, 2024
@alecthomas alecthomas changed the title Codegen in ftl tooling Move codegen from Maven into the ftl tooling. Feb 22, 2024
@github-actions github-actions bot removed the triage Issue needs triaging label Feb 22, 2024
worstell added a commit that referenced this issue Feb 27, 2024
fixes #970

This implementation diverges from the kotlin-runtime module generator
logic in that it omits `IngressHttp` or `Json` annotations in external
modules. I don't think we need those for the generated external modules.

Will follow with a change to remove the module generator entirely and
stop releasing its JAR.

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants