Experiment adding codestarts to an exisiting projectΒ #13511
Open
Description
Description
Following a discussion with @aloubyansky, we defined a few rules which could make it work:
- only declared compatible example codestarts (the simplest without config) could be added to an existing project
- include only the
src
directory and filter out files which need to be merged (config, index.html), all other sources and resources are fine.. - adding dependencies would be delegated to the parent api
Implementation ideas
- Modify the
void CodestartProjectGeneration.generateProject(final CodestartProjectDefinition projectDefinition, final Path targetDirectory)
to return a result with info about the generated project (including theshared-data
which containsdependencies
andshared-dependencies
. - When adding an extension to an existing project, we need to:
- detect the "core" codestarts that it uses (buildtool, language, config, tooling)
- detect the root package name (or use the groupId)
- detect which added extensions contains example codestarts compatible for addition
- generate full project
- keep only the
src
dir and remove thesrc/main/resources/META-INF/resources/index.html
andsrc/main/resources/application.*
- apply them to the existing project (and log what's been added)
- use the existing tooling to add the dependencies and test dependencies given by the result (without re-calling all this obviously)
Metadata
Assignees
Labels
Type
Projects
Status
Todo
Activity