tesla / m2eclipse-tycho

25 stars 26 forks source link

bundle manifest generation does not consider generated sources #24

Open ifedorenko opened 10 years ago

ifedorenko commented 10 years ago

Consider a project that uses modello (or any other source code generation plugin). Here is rough sequence of builder actions that occur during full and incremental workspace builds. Note that code generation and compilation of the generated code are performed by two different workspace builders, MavenBuilder and JavaBuilder respectively.

  1. clean build
    • m2e/modello deletes generated sources, as expected, this is necessary to remove any stale generated sources
    • jdt builder removes generated .class files
  2. full workspace build (JavaBuilder)
    • there are no generated sources to compile at this point
  3. full workspace build (MavenBuilder)
    • m2e/modello is executed during 'generate-sources' phase, generated sources folder is added to MavenProject model but the sources compilation is deferred to JavaBuilder execution
    • m2e/tycho is executed but does not consider generated classes because they have not been compiled yet
  4. incremental build (JavaBuilder)
    • newly generated sources are compiled
  5. incremental build (MavenBuilder)
    • m2e/tycho does not run during incremental build, it'd be prohibitively expensive.

The short-term workaround is to change maven-bundle-plugin configuration to NOT rely on presence of compiled generated sources classes.

The only solution I can think of is to invoke java compiler from MavenBuilder, which will require non-trivial changes to JDT API.