Skip to content

Commit

Permalink
Change description and add plugin validation [JENKINS-29486]
Browse files Browse the repository at this point in the history
  • Loading branch information
v1v committed Jul 29, 2015
1 parent 0e46b3f commit e3c9843
Showing 1 changed file with 14 additions and 13 deletions.
Expand Up @@ -4,6 +4,7 @@
import hudson.model.Item;
import hudson.model.Project;
import hudson.tasks.Builder;
import jenkins.model.Jenkins;
import org.jenkins.ci.plugins.jenkinslint.model.AbstractCheck;

import java.util.List;
Expand All @@ -17,26 +18,26 @@ public class GradleWrapperChecker extends AbstractCheck {
public GradleWrapperChecker() {
super();
this.setDescription("By distributing the wrapper with your project, anyone can work with it without needing to " +
"install Gradle beforehand.<br/> Even better, users of the build are guaranteed to use the " +
"version of Gradle that the build was designed to work with.<br/>" +
"<a href=https://docs.gradle.org/current/userguide/gradle_wrapper.html>The Gradle Wrapper</a>");
"install Gradle beforehand. Even better, users of the build <br/> are guaranteed to use the " +
"version of Gradle that the build was designed to work with. Further details: " +
"<a href=https://docs.gradle.org/current/userguide/gradle_wrapper.html> Gradle Wrapper docs</a>.");
this.setSeverity("Medium");
}

public boolean executeCheck(Item item) {
boolean found = false;
//if (Jenkins.getInstance().pluginManager.getPlugin("gradle") != null) {
if (item.getClass().getName().endsWith("hudson.maven.MavenModuleSet")) {
found = false;
} else {
if (item instanceof Project) {
found = isGradlew(((Project) item).getBuilders());
}
if (item instanceof MatrixProject) {
found = isGradlew(((MatrixProject) item).getBuilders());
if (Jenkins.getInstance().pluginManager.getPlugin("gradle") != null) {
if (item.getClass().getName().endsWith("hudson.maven.MavenModuleSet")) {
found = false;
} else {
if (item instanceof Project) {
found = isGradlew(((Project) item).getBuilders());
}
if (item instanceof MatrixProject) {
found = isGradlew(((MatrixProject) item).getBuilders());
}
}
}
//}
return found;
}

Expand Down

0 comments on commit e3c9843

Please sign in to comment.