Skip to content
Permalink
Browse files

Merge branch 'JENKINS-13852' of git://github.com/cjo9900/parameterize…

…d-trigger-plugin into 2.17-RC
  • Loading branch information...
cjo9900 committed Jan 29, 2013
2 parents 51ea124 + ff23938 commit 9a427db4900df58bb8f2aee3d81fbf3dbdda9d81
@@ -16,23 +16,45 @@

public class SubversionRevisionBuildParameters extends AbstractBuildParameters {

@DataBoundConstructor
private boolean includeUpstreamParameters = false;

public SubversionRevisionBuildParameters() {
this(false);
}

@DataBoundConstructor
public SubversionRevisionBuildParameters(boolean includeUpstreamParameters ) {
this.includeUpstreamParameters = includeUpstreamParameters;
}

public boolean getIncludeUpstreamParameters() {
return includeUpstreamParameters;
}
@Override
public Action getAction(AbstractBuild<?,?> build, TaskListener listener) {

SubversionTagAction tagAction =
build.getAction(SubversionTagAction.class);
if (tagAction == null) {
SubversionTagAction tagAction = build.getAction(SubversionTagAction.class);
RevisionParameterAction revisionAction = build.getAction(RevisionParameterAction.class);

List<SvnInfo> infos = new ArrayList<SvnInfo>();

if (tagAction == null ) {
listener.getLogger().println(
"[parameterizedtrigger] no SubversionTagAction found -- is this project an SVN project ?");
return null;
} else {
infos.addAll(tagAction.getTags().keySet());
}

List<SvnInfo> infos = new ArrayList<SvnInfo>(tagAction.getTags().keySet());
return new RevisionParameterAction(infos);
if(includeUpstreamParameters == true) {
if (revisionAction == null ) {
listener.getLogger().println(
"[parameterizedtrigger] no RevisionParameterAction found -- project did not have SVN parameters passed to it?");
} else {
infos.addAll(revisionAction.getRevisions());
}
}
//if infos is empty don't return an action.
return (infos.size() == 0 ) ? null : new RevisionParameterAction(infos);
}

@Extension
@@ -1,2 +1,5 @@
<j:jelly xmlns:j="jelly:core" xmlns:st="jelly:stapler" xmlns:d="jelly:define" xmlns:l="/lib/layout" xmlns:t="/lib/hudson" xmlns:f="/lib/form">
<f:entry field="includeUpstreamParameters" title="${%Include/passthrough Upstream SVN Revisons}">
<f:checkbox default="false" />
</f:entry>
</j:jelly>
@@ -0,0 +1,4 @@
<div>
This option passes through the subversion parameters that were passed
into this build from upstream builds, so that they can be used on downstream projects.
</div>
@@ -0,0 +1,3 @@
<div>
This parameter passes the Subversion revisions that were used in this build to the downstream builds.
</div>

0 comments on commit 9a427db

Please sign in to comment.
You can’t perform that action at this time.