Community
Participate
Working Groups
There are some source features in Eclipse Platform that need to include non-source bundles. As shown in [1] org.eclipse.platform.source and org.eclipse.jdt.source features include org.eclipse.platform.doc.isv and org.eclipse.jdt.doc.isv respectively. We need support in Tycho to allow these bundles to be included. [1] http://git.eclipse.org/c/platform/eclipse.platform.releng.git/tree/features/org.eclipse.sdk/build.properties
While it would be nice to duplicate SDK build exactly, I am actually unsure of the reason that doc bundles have to be in source features. That doesn't seem quite right, conceptually. It seems the important thing is that they are in the "SDK feature". Perhaps this was a short cut taken some time in the past? (Since, for example, there is not a JDT SDK feature?) But, those more familiar with history and packaging needs might better understand why its this way.
As a workaround, you can create your source-feature "mamnually" containing source bundles (generated by Tycho) and others, instead of relying on tycho-source-feature-plugin. Tycho-source-feature-plugin is useful for default behaviour, but in such cases where the behaviorr is not the default one, it may be better to rely on a feature.xml rather than on this plugin.
I'm hoping including another plugin is not more of a stretch than excluding one (although as I write that, obviously not the same :-). The more of this that can be generated, the better. If I specify a source feature that references a lot of plugins that don't (yet) exist I thought maven and/or tycho would fail with unresolved dependencies. PW
(In reply to comment #3) > I'm hoping including another plugin is not more of a stretch than excluding > one (although as I write that, obviously not the same :-). The more of this > that can be generated, the better. I agree this request makes sense. > If I specify a source feature that references a lot of plugins that don't > (yet) exist I thought maven and/or tycho would fail with unresolved > dependencies. *I think*, tycho-source-plugim comes with a SourceP2MetadataProvider component which makes that Tycho know that source bundle WILL exist when resolving dependencies. So it works.
I've proposed two related changes to tycho and tycho-extras that introduce new experimental (!) <plugins> source feature plugin parameter. Here is an example pom.xml configuration <plugin> <groupId>org.eclipse.tycho</groupId> <artifactId>target-platform-configuration</artifactId> <version>${tycho-version}</version> <configuration> <dependency-resolution> <extraRequirements> <!-- this guarantees proper reactor build order --> <requirement> <type>eclipse-plugin</type> <id>extra.sourcefeature.bundle</id> <versionRange>0.0.0</versionRange> </requirement> </extraRequirements> </dependency-resolution> </configuration> </plugin> <plugin> <groupId>org.eclipse.tycho.extras</groupId> <artifactId>tycho-source-feature-plugin</artifactId> <version>${tycho-extras-version}</version> <executions> <execution> <id>source-feature</id> <phase>package</phase> <goals> <goal>source-feature</goal> </goals> <configuration> <plugins> <plugin id="extra.sourcefeature.bundle" versionRange="0.0.0" /> </plugins> </configuration> </execution> </executions> </plugin> Note that the same plugin has to be specified both in tycho-source-feature-plugin and target-platform-configuration configuration blocks. This is necessary to guarantee proper multi-module build order. Also note that at this point I consider this new parameter experimental and it can be removed from future tycho versions without prio notice if it proves to be problematic and causing confusion to tycho users and extra support overhead for tycho developers. tycho change https://git.eclipse.org/r/7874 tycho-extras change https://git.eclipse.org/r/7875
Merge the changes. The next successful tycho/tycho-extras 0.16 build should support source feature <plugins> configuration
(In reply to comment #6) > Merge the changes. The next successful tycho/tycho-extras 0.16 build should > support source feature <plugins> configuration It looks like the last snapshot pushed up was 20120918. Will there be another one soon? PW
There was a hiccup in out build system. New version of tycho-extras should be deployed now.
This is marked as "fixed" ... but as I see it, the subject of this bug does not match the fix that's been pushed (or I don't understand how)? I have a feature F1 that includes plug-ins "P1" and "P2" ... and a third plugin that does not hold sources (a documentation plugin, for example), let's call it P3. Using tycho-source-feature on F1, in addition with tycho-source-plugin on P1 and P2 so that their sources are generated, I would expect F1.source to contain P1.source and P2.source; then either ignore or include P3, included by F1 but for which no source plugin _can_ be generated (it only contains documentation, no source at all). In stead, it simply fails in exception, telling me that its "Missing sources for plugins [P3_3.3.1.201212171551]" (you can look at the console of my latest test for more on the stack trace : https://hudson.eclipse.org/hudson/view/Modeling/job/m2t-acceleo-master/287/consoleFull ). So, how can I tell my source feature to include (or exclude for that matter) the non-source bundle "P3" ? Am I forced to create my own source feature including only the source plugins that could be generated?
(In reply to comment #9) > This is marked as "fixed" ... but as I see it, the subject of this bug does > not match the fix that's been pushed (or I don't understand how)? we use this functionality in http://git.eclipse.org/c/platform/eclipse.platform.releng.git/tree/features/org.eclipse.platform-feature/pom.xml?h=R4_2_maintenance#n60 Our platform feature does not contain our isv.doc, but we want our platform.source feature to contain it. The other option (if your doc is in your regular feature) is to exclude it from the source feature like we do with our user.doc - http://git.eclipse.org/c/platform/eclipse.platform.releng.git/tree/features/org.eclipse.platform-feature/pom.xml?h=R4_2_maintenance#n64 PW
Paul, Thanks for the pointers, seems like I indeed did not understand "how" this was fixed :). I cannot launch any build atm (error 400 from hudson), but I'll try the exclusion filters from my source feature generation.
(In reply to comment #11) > I cannot launch any build atm (error 400 from hudson), Do you really need hudson to get "mvn verify" to work? If yes, that's not a very good thing, you should spend some time one making builds working locally. My 2c ;)
Mickael, My builds do work locally yes, though I was too lazy to fire a command line :p. And not being able to fire hudson builds would have been a real issue today since I have two M4 to build (that was only a cookies issue fortunately).
And the exclusion filters work for my use case too. For any other that could stumble on this bug while searching "how to exclude non-source bundles from source feature generation", here is what should be added to the pom.xml of the incriminated feature : <build> <plugins> <plugin> <groupId>org.eclipse.tycho.extras</groupId> <artifactId>tycho-source-feature-plugin</artifactId> <executions> <execution> <phase>package</phase> <id>source-feature</id> <goals> <goal>source-feature</goal> </goals> <configuration> <excludes> <!-- ID of the non-source bundle(s) to exclude from the generated source feature --> <plugin id="org.eclipse.acceleo.doc"/> </excludes> </configuration> </execution> </executions> </plugin> </plugins> </build>