Skip to content

Commit

Permalink
[JENKINS-17024] The SLOCCOUNT analysis Results not available in IVY b…
Browse files Browse the repository at this point in the history
…uilds

- SloccountDescriptor.isApplicable() doesn't consider IVY plugin. The method updated to just return true the same as other similar "publisher" plugins (e.g. Warnings).
- Dependency to Maven plugin can be removed from pom.xml, isApplicable() was the only place where it was referenced.
- Dependency to FindBugs plugin can be removed, it is nowhere referenced. There are "Remainings from the findbugs plugin have been removed" commits in Git log, this dependency was probably forgotten.
- The update was NOT fully tested since I have no IVY project. The only thing i tried is that SLOCCount publisher now appears in configuration of IVY job.
  • Loading branch information
mixalturek committed Jan 4, 2014
1 parent b4e1392 commit 7157fd7
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 15 deletions.
10 changes: 1 addition & 9 deletions pom.xml
Expand Up @@ -54,15 +54,7 @@
</properties>

<dependencies>
<dependency>
<groupId>org.jenkins-ci.main</groupId>
<artifactId>maven-plugin</artifactId>
</dependency>
<dependency>
<groupId>findbugs</groupId>
<artifactId>annotations</artifactId>
<version>1.0.0</version>
</dependency>
<!-- None -->
</dependencies>

<repositories>
Expand Down
10 changes: 4 additions & 6 deletions src/main/java/hudson/plugins/sloccount/SloccountDescriptor.java
Expand Up @@ -2,10 +2,7 @@


import hudson.Extension;
import hudson.maven.AbstractMavenProject;
import hudson.model.AbstractProject;
import hudson.model.FreeStyleProject;
import hudson.model.Hudson;
import hudson.tasks.BuildStepDescriptor;
import hudson.tasks.Publisher;

Expand All @@ -20,10 +17,11 @@ public SloccountDescriptor(){
super(SloccountPublisher.class);
}

@SuppressWarnings("rawtypes")
@Override
public boolean isApplicable(Class<? extends AbstractProject> jobType) {
return AbstractMavenProject.class.isAssignableFrom(jobType) ||
FreeStyleProject.class.isAssignableFrom(jobType) ||
jobType.getSimpleName().equals("JobGenerator");
// The plugin is applicable for all job types
return true;
}

@Override
Expand Down

0 comments on commit 7157fd7

Please sign in to comment.