summaryrefslogtreecommitdiffstatsabout
diff options
context:
space:
mode:
authorMeng Xin Zhu2011-11-09 03:02:44 (EST)
committer Tobias Oberlies2011-11-24 04:42:34 (EST)
commit378d1b7d8be6928dc4fc34ff4c5d4485d0a74913 (patch)
treeef79202844b66e81860d78172c06e6273280fd7e
parent856ca02e2c2cfe0081f22b8d04ca2c65feacac1c (diff)
downloadorg.eclipse.tycho-378d1b7d8be6928dc4fc34ff4c5d4485d0a74913.zip
org.eclipse.tycho-378d1b7d8be6928dc4fc34ff4c5d4485d0a74913.tar.gz
org.eclipse.tycho-378d1b7d8be6928dc4fc34ff4c5d4485d0a74913.tar.bz2
362550 Support different profile names per environment
Director plugin supports different profile names for different environments.
-rw-r--r--tycho-p2/tycho-p2-director-plugin/src/main/java/org/eclipse/tycho/plugins/p2/director/DirectorMojo.java17
-rw-r--r--tycho-p2/tycho-p2-director-plugin/src/main/java/org/eclipse/tycho/plugins/p2/director/ProfileName.java51
2 files changed, 67 insertions, 1 deletions
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 63afaee..c4d348c 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
@@ -35,6 +35,9 @@ public final class DirectorMojo extends AbstractProductMojo {
/** @parameter default-value="DefaultProfile" */
private String profile;
+ /* @parameter */
+ private List<ProfileName> profileNames;
+
/** @parameter default-value="true" */
private boolean installFeatures;
@@ -59,13 +62,25 @@ public final class DirectorMojo extends AbstractProductMojo {
destination = new File(destination, rootFolder);
}
+ String profileName = profile;
+ if (profileNames != null) {
+ for (ProfileName profileWithEnvironment : profileNames) {
+ // first match always wins
+ if (env.match(profileWithEnvironment.getOs(), profileWithEnvironment.getWs(),
+ profileWithEnvironment.getArch())) {
+ profileName = profileWithEnvironment.getName();
+ break;
+ }
+ }
+ }
+
String metadataRepositoryURLs = toCommaSeparatedList(sources.getMetadataRepositories());
String artifactRepositoryURLs = toCommaSeparatedList(sources.getArtifactRepositories());
String[] args = new String[] { "-metadatarepository", metadataRepositoryURLs, //
"-artifactrepository", artifactRepositoryURLs, //
"-installIU", product.getId(), //
"-destination", destination.getAbsolutePath(), //
- "-profile", profile, //
+ "-profile", profileName, //
"-profileProperties", "org.eclipse.update.install.features=" + String.valueOf(installFeatures), //
"-roaming", //
"-p2.os", env.getOs(), "-p2.ws", env.getWs(), "-p2.arch", env.getArch() };
diff --git a/tycho-p2/tycho-p2-director-plugin/src/main/java/org/eclipse/tycho/plugins/p2/director/ProfileName.java b/tycho-p2/tycho-p2-director-plugin/src/main/java/org/eclipse/tycho/plugins/p2/director/ProfileName.java
new file mode 100644
index 0000000..0c28763
--- /dev/null
+++ b/tycho-p2/tycho-p2-director-plugin/src/main/java/org/eclipse/tycho/plugins/p2/director/ProfileName.java
@@ -0,0 +1,51 @@
+/*******************************************************************************
+ * Copyright (c) 2011 Wind River and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Wind River - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.tycho.plugins.p2.director;
+
+public class ProfileName {
+ /** default-value="DefaultProfile" */
+ private String name;
+
+ public String getName() {
+ return name;
+ }
+
+ public String getArch() {
+ return arch;
+ }
+
+ public String getOs() {
+ return os;
+ }
+
+ public String getWs() {
+ return ws;
+ }
+
+ private String arch;
+ private String os;
+ private String ws;
+
+ public ProfileName() {
+ }
+
+ public ProfileName(String name) {
+ this(name, null, null, null);
+ }
+
+ public ProfileName(String name, String arch, String os, String ws) {
+ this.name = name;
+ this.arch = arch;
+ this.os = os;
+ this.ws = ws;
+ }
+
+}