feat(generator): make TOS_CLI_GEN generate jobs headlessly#7
Conversation
Isolate the code generator from the designer plugin to its own plugin and feature.
Isolate the code generator from the designer plugin to its own plugin and feature.
Isolate the code generator from the designer plugin to its own plugin and feature. FIXME: dependency loop on Process implementation
Create the generator application and product.
Fixing project initialization and application dependencies
Fixing project initialization and application dependencies
CodeGeneratorApplication launched but produced no code on a fresh, non-GUI workspace: it never ran the project-open lifecycle the Studio does on login, and a few services assumed a Workbench / imported workspace / component server. It now runs that lifecycle headlessly so a plain `TOS_CLI_GEN -data <workspace> <PROJECT>/process/<job>.properties` emits the full Maven project (code.Master + routines + job .java) for a normal Maven reactor to build — no GUI, no Talend CommandLine server. - CodeGeneratorApplication: set headless + ci.mode; import workspace projects; init the RepositoryContext.fields map; init JET templates; sync routines/beans; write the poms without forking Maven; then generate. - AggregatorPomsHelper: add syncAllPomsNoBuild() — write poms without the internal forked `mvn install` (the downstream reactor compiles). - CodeGenerator: generate source only (GENERATE_WITHOUT_COMPILING). - Lookups / TCKUIService / ComponentsFactory: tolerate a missing TaCoKit cache instead of NPE in headless mode. - org.talend.designer.core.generator MANIFEST: require org.talend.designer.maven.
|
@vhemery could you please have a look. or just take this as ideas for your branch work |
|
Thank you for your suggestions. Quick feedback: My feat/cli_generator branch is still work in progress, for which I will rework the history. So this does not make much sense merging this PR. About the TacoKit cache and service-related aspects, I prefer staying closer to the original generation. So I'd rather (and have already locally) use the initialization performed by login. For some code, such as For the System properties, I think it's enough if the CI set it itself and we keep the generation the same as the UI product one. The most interesting part here IMHO is the workspace initialization, which was not at all in my scope. I'd rather import the holding project in the workspace, in case we have an external URI not in the workspace, because we may checkout projects out of the workspace location (this achieves the same goal). I'm keeping this opened for the moment to peek the parts I need. |
|
I am happy to see any progess on your headles source generator. and will test you work. |
b5dd9bb to
b210975
Compare
|
i tries to build: Wrong module path in
|
b210975 to
4ebc550
Compare
I did fix it last week. But didn't see the push failed... |
|
i am sure you did! |
4ebc550 to
4d27b2e
Compare
CodeGeneratorApplication launched but produced no code on a fresh, non-GUI workspace: it never ran the project-open lifecycle the Studio does on login, and a few services assumed a Workbench / imported workspace / component server.
It now runs that lifecycle headlessly so a plain
TOS_CLI_GEN -data <workspace> <PROJECT>/process/<job>.propertiesemits the full Maven project (code.Master + routines + job .java) for a normal Maven reactor to build — no GUI, no Talend CommandLine server.mvn install(the downstream reactor compiles).What is the current behavior? (You can also link to an open issue here)
cant use current draft in a cli/maven build
What is the new behavior?
works on my mashine
Please check if the PR fulfills these requirements
What kind of change does this PR introduce?
Does this PR introduce a breaking change?
If this PR contains a breaking change, please describe the impact and migration path for existing applications: ...
Other information: