Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[JENKINS-35234] Resolved issue - Support the new workflow/pipeline model
pom.xml
- Corrected dependencies to master-pom, Jenkins version and workflow plugins

SloccountResult
- owner is not serializable so setter must be added and user when SloccountBuildAction is loaded

SloccountBuildAction.java
- Run<> must be passed to SloccountResult when build is loaded
  • Loading branch information
piomis committed Jun 27, 2017
1 parent 784fc49 commit 6d88366
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 21 deletions.
32 changes: 12 additions & 20 deletions pom.xml
Expand Up @@ -4,7 +4,7 @@
<parent>
<groupId>org.jenkins-ci.plugins</groupId>
<artifactId>plugin</artifactId>
<version>2.7</version>
<version>2.30</version>
</parent>

<groupId>hudson.plugins.sloccount</groupId>
Expand Down Expand Up @@ -51,22 +51,21 @@

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<jenkins.version>1.625.3</jenkins.version>
</properties>

<dependencies>
<dependency>
<groupId>org.jenkins-ci.main</groupId>
<artifactId>jenkins-core</artifactId>
<version>2.63</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.jenkins-ci.plugins</groupId>
<artifactId>dashboard-view</artifactId>
<version>2.0</version>
<optional>true</optional>
</dependency>
<!-- dependencies on Jenkins Pipeline plugins -->
<dependency>
<groupId>org.jenkins-ci.plugins.workflow</groupId>
<artifactId>workflow-step-api</artifactId>
<version>2.6</version>
</dependency>
<dependency>
<groupId>org.jenkins-ci.plugins.workflow</groupId>
<artifactId>workflow-job</artifactId>
Expand All @@ -75,22 +74,15 @@
<dependency>
<groupId>org.jenkins-ci.plugins.workflow</groupId>
<artifactId>workflow-cps</artifactId>
<version>2.34</version>
<version>1.14</version>
</dependency>

<!-- dependencies on Jenkins Pipeline plugins for tests-->
<dependency>
<groupId>org.jenkins-ci.plugins.workflow</groupId>
<artifactId>workflow-support</artifactId>
<version>2.14</version>
</dependency>
<dependency>
<groupId>org.jenkins-ci.plugins.workflow</groupId>
<artifactId>workflow-durable-task-step</artifactId>
<version>2.11</version>
</dependency>
<dependency>
<groupId>org.jenkins-ci.plugins.workflow</groupId>
<artifactId>workflow-step-api</artifactId>
<version>2.11</version>
<version>1.14</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.jenkins-ci.plugins.workflow</groupId>
Expand Down
Expand Up @@ -132,6 +132,8 @@ public void onLoad(Run<?,?> r)
this.projectActions = new ArrayList<>();
}
this.projectActions.add(new SloccountProjectAction(this.build.getParent(), this.numBuildsInGraph));

this.result.setOwner(r);
}

@Override
Expand Down
6 changes: 5 additions & 1 deletion src/main/java/hudson/plugins/sloccount/SloccountResult.java
Expand Up @@ -25,7 +25,7 @@ public class SloccountResult implements Serializable {

private transient SloccountReport report;

private transient final Run<?,?> owner;
private transient Run<?,?> owner;

/** The statistics. */
private SloccountReportStatistics statistics;
Expand All @@ -52,6 +52,10 @@ public SloccountReport getReport() {
public Run<?,?> getOwner() {
return owner;
}

public void setOwner(Run<?,?> o) {
this.owner = o;
}

/**
* Get the statistics.
Expand Down

0 comments on commit 6d88366

Please sign in to comment.