Skip to content
Permalink
Browse files

Merge pull request #20 from imod/JENKINS-18629

JENKINS-18629 - use Gradle in conditional-buildstep
  • Loading branch information
gboissinot committed Apr 6, 2014
2 parents c636569 + c238482 commit 1dac78bcda1a5e0145d2906eafb80c1ad636bf68
27 pom.xml
@@ -4,7 +4,7 @@
<parent>
<groupId>org.jenkins-ci.plugins</groupId>
<artifactId>plugin</artifactId>
<version>1.427</version>
<version>1.480</version>
</parent>

<artifactId>gradle</artifactId>
@@ -55,4 +55,29 @@
</dependency>
</dependencies>

<build>
<pluginManagement>
<plugins>
<plugin>
<groupId>com.cloudbees</groupId>
<artifactId>maven-license-plugin</artifactId>
<version>1.7</version>
</plugin>
<plugin>
<groupId>org.jvnet.localizer</groupId>
<artifactId>maven-localizer-plugin</artifactId>
<version>1.14</version>
</plugin>
</plugins>
</pluginManagement>
<plugins>
<plugin>
<groupId>org.jenkins-ci.tools</groupId>
<artifactId>maven-hpi-plugin</artifactId>
<version>1.100</version>
<extensions>true</extensions>
</plugin>
</plugins>
</build>

</project>
@@ -6,10 +6,8 @@
import hudson.tasks.Builder;
import hudson.tools.ToolInstallation;
import hudson.util.ArgumentListBuilder;
import net.sf.json.JSONObject;
import org.jenkinsci.lib.dryrun.DryRun;
import org.kohsuke.stapler.DataBoundConstructor;
import org.kohsuke.stapler.StaplerRequest;

import java.io.IOException;
import java.util.HashMap;
@@ -331,21 +329,5 @@ public void setInstallations(GradleInstallation... installations) {
this.installations = installations;
save();
}

@Override
public Gradle newInstance(StaplerRequest request, JSONObject formData) throws FormException {

// "flatten" formData for useWrapper radioBlocks
JSONObject useWrapper = formData.getJSONObject("useWrapper");
boolean wrapper = useWrapper.getBoolean("value");
useWrapper.remove("value");
for (String key : (Set<String>) useWrapper.keySet()) {
formData.put(key, useWrapper.get(key));
}
formData.put("useWrapper", wrapper);

return (Gradle) request.bindJSON(clazz, formData);
}
}

}
@@ -1,7 +1,7 @@
<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:radioBlock name="useWrapper" checked="${!instance.useWrapper}" value="false" title="${%Invoke Gradle}">
<f:radioBlock inline="true" name="useWrapper" checked="${!instance.useWrapper}" value="false" title="${%Invoke Gradle}">
<f:entry title="${%Gradle Version}" field="gradleName">
<select class="setting-input" name="gradleName">
<option>(Default)</option>
@@ -11,7 +11,7 @@
</select>
</f:entry>
</f:radioBlock>
<f:radioBlock name="useWrapper" checked="${instance.useWrapper}" value="true" title="${%Use Gradle Wrapper}">
<f:radioBlock inline="true" name="useWrapper" checked="${instance.useWrapper}" value="true" title="${%Use Gradle Wrapper}">
<f:entry title="${%Make gradlew executable}" field="makeExecutable">
<f:checkbox />
</f:entry>

0 comments on commit 1dac78b

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