Skip to content

Experiment adding codestarts to an exisiting projectΒ #13511

Open
@ia3andy

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

  1. Modify the void CodestartProjectGeneration.generateProject(final CodestartProjectDefinition projectDefinition, final Path targetDirectory) to return a result with info about the generated project (including the shared-data which contains dependencies and shared-dependencies.
  2. 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 the src/main/resources/META-INF/resources/index.html and src/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)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions