-+ * Assemble and archive product installations for the running environment only. Setting this to -+ * true will omit all target environments that do not exactly match the running environment. -+ *
-+ * -+ * @parameter expression="${director.running.env.only}" -+ */ -+ private boolean runningEnvOnly; -+ -+ /** - * Kill the forked process after a certain number of seconds. If set to 0, wait forever for the - * process, never timing out. - */ -@@ -148,4 +158,11 @@ abstract class AbstractProductMojo extends AbstractMojo { - static String getOsWsArch(TargetEnvironment env, char separator) { - return env.getOs() + separator + env.getWs() + separator + env.getArch(); - } -+ -+ /** -+ * @return true if the product should be built for the given target environment, false otherwise -+ */ -+ boolean buildForEnv(TargetEnvironment env) { -+ return !runningEnvOnly || TargetEnvironment.getRunningEnvironment().equals(env); -+ } - } -diff --git a/tycho-p2/tycho-p2-director-plugin/src/main/java/org/eclipse/tycho/plugins/p2/director/DirectorMojo.java b/tycho-p2/tycho-p2-director-plugin/src/main/java/org/eclipse/tycho/plugins/p2/director/DirectorMojo.java -index 9f90ff1..fc8b342 100644 ---- a/tycho-p2/tycho-p2-director-plugin/src/main/java/org/eclipse/tycho/plugins/p2/director/DirectorMojo.java -+++ b/tycho-p2/tycho-p2-director-plugin/src/main/java/org/eclipse/tycho/plugins/p2/director/DirectorMojo.java -@@ -114,6 +114,9 @@ public final class DirectorMojo extends AbstractProductMojo { - RepositoryReferences sources = getSourceRepositories(); - for (Product product : products) { - for (TargetEnvironment env : getEnvironments()) { -+ if (!buildForEnv(env)) { -+ continue; -+ } - DirectorRuntime.Command command = director.newInstallCommand(); - - File destination = getProductMaterializeDirectory(product, env); -diff --git a/tycho-p2/tycho-p2-director-plugin/src/main/java/org/eclipse/tycho/plugins/p2/director/ProductArchiverMojo.java b/tycho-p2/tycho-p2-director-plugin/src/main/java/org/eclipse/tycho/plugins/p2/director/ProductArchiverMojo.java -index 0102465..ffa84b0 100644 ---- a/tycho-p2/tycho-p2-director-plugin/src/main/java/org/eclipse/tycho/plugins/p2/director/ProductArchiverMojo.java -+++ b/tycho-p2/tycho-p2-director-plugin/src/main/java/org/eclipse/tycho/plugins/p2/director/ProductArchiverMojo.java -@@ -122,6 +122,9 @@ public final class ProductArchiverMojo extends AbstractProductMojo { - - for (Product product : config.getProducts()) { - for (TargetEnvironment env : getEnvironments()) { -+ if (!buildForEnv(env)) { -+ continue; -+ } - String format = getArchiveFormat(env); - ProductArchiver productArchiver = productArchivers.get(format); - if (productArchiver == null) { --- -1.9.3 - diff --git a/tycho-scripts.sh b/tycho-scripts.sh index ff9120e..a1e60ce 100755 --- a/tycho-scripts.sh +++ b/tycho-scripts.sh @@ -37,7 +37,12 @@ pushd ${basedir} pushd ${output} classfiles=`for file in $(find . -name "*.class"); do echo -n ' -C '${output} ${file} ; done;` popd -jar -cfmv "target/${bName}-${version}.jar" 'META-INF/MANIFEST.MF' 'OSGI-INF' 'plugin.xml' 'about.html' 'plugin.properties' ${classfiles} +packagefiles="${classfiles}" +[ -e about.html ] && packagefiles="about.html $packagefiles" +[ -e plugin.properties ] && packagefiles="plugin.properties $packagefiles" +[ -e plugin.xml ] && packagefiles="plugin.xml $packagefiles" +[ -e OSGI-INF ] && packagefiles="OSGI-INF $packagefiles" +jar -cfmv "target/${bName}-${version}.jar" 'META-INF/MANIFEST.MF' ${classfiles} popd # Install @@ -71,11 +76,10 @@ destDir=$2 for loc in ${osgiLocations[@]} ; do for jar in `find ${loc} -name "*.jar" 2>/dev/null`; do bsn=`readBSN ${jar}` - versionline=`unzip -p ${jar} 'META-INF/MANIFEST.MF' | grep 'Bundle-Version:'` if [ -n "${bsn}" ]; then + versionline=`unzip -p ${jar} 'META-INF/MANIFEST.MF' | grep 'Bundle-Version:'` vers=`echo "${versionline}" | sed 's/Bundle-Version: \([a-zA-Z0-9_.-]*\).*/\1/'` - echo ${wantedBundles} | grep -q "${bsn}" - if [ $? -eq 0 ]; then + if echo ${wantedBundles} | grep "${bsn}" ; then cp ${jar} "${destDir}/${bsn}_${vers}.jar" wantedBundles=`removeFromList "${wantedBundles}" "${bsn}"` fi diff --git a/tycho-use-custom-resolver.patch b/tycho-use-custom-resolver.patch index de6ba96..4fad1c0 100644 --- a/tycho-use-custom-resolver.patch +++ b/tycho-use-custom-resolver.patch @@ -281,10 +281,10 @@ index 8d36462..b5c8c55 100644 public class LocalRepositoryReader implements RepositoryReader { -@@ -20,8 +22,46 @@ public class LocalRepositoryReader implements RepositoryReader { - this.localMavenRepositoryRoot = localMavenRepositoryRoot; +@@ -21,8 +23,46 @@ } + @Override + @SuppressWarnings({ "unchecked", "rawtypes" }) public File getLocalArtifactLocation(GAV gav, String classifier, String extension) { - return new File(localMavenRepositoryRoot, RepositoryLayoutHelper.getRelativePath(gav, classifier, extension)); @@ -307,7 +307,7 @@ index 8d36462..b5c8c55 100644 + // Retrieve the workspace reader from the plexus container + Method mLookup = pclazz.getMethod("lookup", String.class, String.class); + Object reader = mLookup.invoke(plexus, "org.eclipse.aether.repository.WorkspaceReader", "ide"); - ++ + // Create an Aether Artifact based on GAV, classifier, and extension + Class iartclazz = Class.forName("org.eclipse.aether.artifact.Artifact"); + Class artclazz = Class.forName("org.eclipse.aether.artifact.DefaultArtifact"); @@ -327,7 +327,7 @@ index 8d36462..b5c8c55 100644 + } + } + return file; -+ + + } } diff --git a/tycho-bundles/org.eclipse.tycho.p2.resolver.shared/src/main/java/org/eclipse/tycho/p2/target/facade/TargetPlatformConfigurationStub.java b/tycho-bundles/org.eclipse.tycho.p2.resolver.shared/src/main/java/org/eclipse/tycho/p2/target/facade/TargetPlatformConfigurationStub.java @@ -351,11 +351,10 @@ diff --git a/tycho-bundles/tycho-bundles-external/tycho-bundles-external.product index 7c99168..28ad59f 100644 --- a/tycho-bundles/tycho-bundles-external/tycho-bundles-external.product +++ b/tycho-bundles/tycho-bundles-external/tycho-bundles-external.product -@@ -76,6 +76,8 @@ +@@ -77,6 +77,7 @@