mirror of
https://github.com/jenkinsci/jenkins.git
synced 2026-11-18 06:22:29 +00:00
[HUDSON-1454] Improved the CLI option parsing to recognize "-Px,y,z" as profiles. This will be in 1.283.
git-svn-id: https://hudson.dev.java.net/svn/hudson/trunk/hudson/main@15165 71c3de6d-444a-0410-be80-ed276b4c234a
This commit is contained in:
1 parent
8288bd5bba
commit
fa2f77ec9c
1 file changed
+12
-3
@@ -490,14 +490,23 @@ public final class MavenModuleSet extends AbstractMavenProject<MavenModuleSet,Ma
|
||||
* return the configured profiles. Otherwise null.
|
||||
*/
|
||||
public String getProfiles() {
|
||||
StringBuilder buf = new StringBuilder();
|
||||
boolean switchFound=false;
|
||||
for (String t : Util.tokenize(getGoals())) {
|
||||
if(switchFound)
|
||||
return t;
|
||||
if(switchFound) {
|
||||
buf.append(',').append(t);
|
||||
switchFound = false;
|
||||
}
|
||||
if(t.equals("-P"))
|
||||
switchFound=true;
|
||||
else
|
||||
if(t.startsWith("-P")) {
|
||||
// -Px,y,z
|
||||
buf.append(',').append(t.substring(2));
|
||||
}
|
||||
}
|
||||
return null;
|
||||
if(buf.length()==0) return null;
|
||||
return buf.substring(1);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in new issue
Block a user