Community
Participate
Working Groups
Currently it is not possible to share classes between the tycho-embedder-api bundle and the org.eclipse.tycho.p2.resolver.facade bundle. As a result, there are redundant structures for logically the same thing, e.g. P2ResolutionResult which is later translated to a DefaultTargetPlatform (implementing TargetPlatform). If model classes like ArtifactDescriptor from tycho-embedder-api could be referenced from tycho.p2.resolver.facade, it would be possible to move the TargetPlatform to tycho.p2.resolver.facade and hence get rid of the copy step. Since tycho-embedder-api has dependencies on Maven, it won't be possible to reference it from the tycho.p2.resolver.facade (which must only reference things available in both class loader worlds - Maven and OSGi). The other way round is not desirable, because tycho-embedder-api is (meant to be) an external API and tycho.p2.resolver.facade isn't. The solution could be a new Tycho-built facade bundle visible from both modules.
The first step of this is done: the common ancestor module now exists as org.eclipse.tycho.embedder.facade. Making real use of that facade is still pending, but this is waiting for the discussions on bug 364134.
The name "embedder.facade" doesn't really match, because that module is not a facade: there is nothing behind it. The module just contains a bunch of classes shared between the OSGi and Maven class loader. Therefore I currently prefer org.eclipse.tycho.embedder.shared. The other "org.eclipse.tycho.*.facade" modules should then also be renamed to ".shared" for consistency. Packages which really serve as facade, e.g. org.eclipse.tycho.p2.tools.director.facade could obviously keep their name ending in ".facade".
"embedder.facade" has been renamed to "embedder.shared" with commit feda050. The package org.eclipse.tycho exists in both org.eclipse.tycho.embedder.shared and tycho-embedder-api - this still needs to be fixed.
(In reply to comment #3) > The package org.eclipse.tycho exists in both org.eclipse.tycho.embedder.shared > and tycho-embedder-api - this still needs to be fixed. Fixed with commit c722606
Sharing classes between the tycho-embedder-api and the other *.shared bundles is possible. This allows for example to get rid of redundant constant definitions in P2Resolver (see 3b2f544). Further refactorings may follow, but not as part of this bug.