| Summary: | javacSource and javacTarget from build.properties should be read by Tycho | ||
|---|---|---|---|
| Product: | z_Archived | Reporter: | Tobias Oberlies <t-oberlies> |
| Component: | Tycho | Assignee: | Jan Sievers <jan.sievers> |
| Status: | RESOLVED FIXED | QA Contact: | |
| Severity: | enhancement | ||
| Priority: | P3 | CC: | anna.dushistova, gunnar, igor, jan.sievers, t-oberlies |
| Version: | unspecified | ||
| Target Milestone: | --- | ||
| Hardware: | All | ||
| OS: | All | ||
| Whiteboard: | |||
|
Description
Tobias Oberlies
(In reply to comment #0) > Currently, the build properties javacSource and javacTarget are not evaluated > by Tycho. This would be useful because it eases the migration of PDE build > projects to Tycho. > > The build properties should take precedence over the POM and the Manifest, > yielding the following order of precedence (cf. [1]): > 1. build.properties > 2. explicit POM configuration > 3. inherited POM configuration > 4. bundle runtime environment from bundle manifest > 5. default (depending on Tycho version) > > > The workaround for the missing javacSource/Target support is POM configuration > (i.e. the configuring source and target of the tycho-compiler-plugin). > > [1] https://issues.sonatype.org/browse/TYCHO-476 pom should take precedence over everything else! (In reply to comment #1) > pom should take precedence over everything else! fine with me. So we would have 1. explicit POM configuration 2. inherited POM configuration 3. build.properties 4. bundle runtime environment from bundle manifest 5. default (depending on Tycho version) (In reply to comment #1) > pom should take precedence over everything else! Why do you think so? The POM may have configuration inherited, whereas the build.properties are specific to one module. A change of configuration in the parent POM could therefore override an arbitrary number of other configuration files. IMHO this contradicts to the principle of least astonishment. Secondly, this also contradicts to the manifest-first principle of Tycho. Obviously, "manifest-first" doesn't say anything about build.properties, but Tycho is also "feature.xml-first", so the principle is (up to now) mostly interpreted as "Eclipse metadata files over POM configuration". I agree that perfect order of precedence should be 1. explicit POM configuration 2. build.properties 3. inherited POM configuration 4. bundle runtime environment from bundle manifest 5. default (depending on Tycho version) The idea here is that no matter how hard we try, there will be discrepancies between what PDE and Tycho like, and we may need to force tycho-specific configuration. Unfortunately, there is no straightforward way to know if POM configuration was inherited or not, so implementing this perfect order can be tricky. The way I solve this problem for <executionEnvironment> configuration is by special syntax for inherited configuration. I think we can do the same for <source> and <target>, i.e. <source>1.7</source> in pom.xml means "use 1.7, ignore build.properties" <source>?1.7</source> in pom.xml means "use 1.7 if build.properties does not tell otherwise" Due to the manifest-first principle, I think that build.properties should have first precedence.
> I think we can do the same for <source> and <target>, i.e.
> <source>1.7</source> in pom.xml means "use 1.7, ignore build.properties"
> <source>?1.7</source> in pom.xml means "use 1.7 if build.properties does not
> tell otherwise"
This could be an option, except that the default (no prefix) should be "use value unless build.properties tell differently". To override, we could use a "+" prefix, e.g. <source>+1.7</source>
I think by default pom.xml configuration should take precedence. This is expected Maven behaviour. We are being extra nice to "other" build tool here, after all. (In reply to comment #7) > I think by default pom.xml configuration should take precedence. This is > expected Maven behaviour. We are being extra nice to "other" build tool here, > after all. Tycho is clearly addressed at former PDE-build users, so in case of a Maven vs. Eclipse expected behaviour, Eclipse should win. Plus there is no good way do distinguish inherited from non-inherited POM configuration, so the definately non-inherited build.properties configuration should win. (In reply to comment #8) > (In reply to comment #7) > > I think by default pom.xml configuration should take precedence. This is > > expected Maven behaviour. We are being extra nice to "other" build tool here, > > after all. > Tycho is clearly addressed at former PDE-build users, so in case of a Maven vs. > Eclipse expected behaviour, Eclipse should win. > > Plus there is no good way do distinguish inherited from non-inherited POM > configuration, so the definately non-inherited build.properties configuration > should win. Honestly, you don't need to repeat yourself again and again. I understand your opinion and I still disagree. In any case, if you or Jan feel strongly enough to change this now, please make sure to update <executionEnvironment> to behave the same (btw, current implementation behaves consistently for <executionEnvironment> and source/target configuration already and "?1.7" can be added later when somebody actually asks for it). I am resolving this bug now because javacSource and javacTarget in build.properties are read now by tycho, which was the main point to implement here and I want this to show up in the 0.14.0 release notes. If you want to change pom/build.properties precedence, please open a new separate bug. |