Skip to content

Commit

Permalink
[JENKINS-49237] - Update the plugin so that it is testable in PCT
Browse files Browse the repository at this point in the history
  • Loading branch information
oleg-nenashev committed Jan 30, 2018
1 parent de836b1 commit a4f7dd6
Show file tree
Hide file tree
Showing 27 changed files with 41 additions and 15 deletions.
20 changes: 13 additions & 7 deletions pom.xml
Expand Up @@ -2,17 +2,22 @@
<modelVersion>4.0.0</modelVersion>

<parent>
<groupId>org.jvnet.hudson.plugins</groupId>
<groupId>org.jenkins-ci.plugins</groupId>
<artifactId>plugin</artifactId>
<version>1.358</version>
<relativePath>../pom.xml</relativePath>
<version>3.3</version>
</parent>

<artifactId>cppncss</artifactId>
<packaging>hpi</packaging>
<version>1.2-SNAPSHOT</version>
<name>Jenkins CppNCSS plugin</name>
<url>http://wiki.jenkins-ci.org/display/JENKINS/CPPNCSS+Plugin</url>
<url>http://wiki.jenkins.io/display/JENKINS/CPPNCSS+Plugin</url>

<properties>
<jenkins.version>1.651.3</jenkins.version>
<java.level>7</java.level>
</properties>

<build>
<plugins>
<plugin>
Expand All @@ -32,8 +37,9 @@
</build>
<dependencies>
<dependency>
<groupId>org.jvnet.hudson.main</groupId>
<groupId>org.jenkins-ci.main</groupId>
<artifactId>maven-plugin</artifactId>
<version>3.0</version>
</dependency>
</dependencies>
<developers>
Expand All @@ -47,14 +53,14 @@
<repositories>
<repository>
<id>repo.jenkins-ci.org</id>
<url>http://repo.jenkins-ci.org/public/</url>
<url>https://repo.jenkins-ci.org/public/</url>
</repository>
</repositories>

<pluginRepositories>
<pluginRepository>
<id>repo.jenkins-ci.org</id>
<url>http://repo.jenkins-ci.org/public/</url>
<url>https://repo.jenkins-ci.org/public/</url>
</pluginRepository>
</pluginRepositories>
</project>
Expand Down
5 changes: 1 addition & 4 deletions src/main/java/hudson/plugins/helpers/BuildProxy.java
Expand Up @@ -40,7 +40,7 @@ public final class BuildProxy implements Serializable {
* @param ghostwriter The ghostwriter that will be doing the work for the publisher.
* @param build The build.
* @param listener The build listener.
* @return <code>true</code> if the build can continue.
* @return {@code true} if the build can continue.
* @throws IOException on IOException.
* @throws InterruptedException on InterruptedException.
*/
Expand Down Expand Up @@ -183,7 +183,6 @@ public FilePath getArtifactsDir() {

/**
* Root directory of the {@link hudson.model.AbstractBuild} on the master.
* <p/>
* Files related to the {@link hudson.model.AbstractBuild} should be stored below this directory.
*
* @return Root directory of the {@link hudson.model.AbstractBuild} on the master.
Expand All @@ -194,7 +193,6 @@ public FilePath getBuildRootDir() {

/**
* Returns the root directory of the checked-out module on the machine where the build executes.
* <p/>
* This is usually where <tt>pom.xml</tt>, <tt>build.xml</tt>
* and so on exists.
*
Expand All @@ -206,7 +204,6 @@ public FilePath getExecutionRootDir() {

/**
* Root directory of the {@link hudson.model.AbstractProject} on the master.
* <p/>
* Files related to the {@link hudson.model.AbstractProject} should be stored below this directory.
*
* @return Root directory of the {@link hudson.model.AbstractProject} on the master.
Expand Down
Expand Up @@ -2,17 +2,18 @@

import hudson.model.BuildListener;
import hudson.remoting.Callable;
import jenkins.security.MasterToSlaveCallable;

import java.io.IOException;

/**
* A helper class that is used when passing Ghostwriter between the slave and master and invoking the appropriate
* actions on the slave or the master.
* actions on the agent or the master node.
*
* @author Stephen Connolly
* @since 28-Jan-2008 22:12:29
*/
class BuildProxyCallableHelper implements Callable<BuildProxy, Exception>{
class BuildProxyCallableHelper extends MasterToSlaveCallable<BuildProxy, Exception> {
// ------------------------------ FIELDS ------------------------------

private final BuildProxy buildProxy;
Expand Down
3 changes: 2 additions & 1 deletion src/main/java/hudson/plugins/helpers/GraphHelper.java
@@ -1,6 +1,7 @@
package hudson.plugins.helpers;

import hudson.model.AbstractBuild;
import hudson.model.Run;
import hudson.plugins.cppncss.AbstractBuildReport;
import hudson.plugins.cppncss.parser.Statistic;
import hudson.util.ChartUtil;
Expand Down Expand Up @@ -233,7 +234,7 @@ private static CategoryDataset buildDataset(AbstractBuild<?, ?> build, DataColle
DataSetBuilder<String, NumberOnlyBuildLabel> builder = new DataSetBuilder<String, NumberOnlyBuildLabel>();

for (AbstractBuild<?, ?> lastBuild = build; lastBuild != null; lastBuild = lastBuild.getPreviousBuild()) {
ChartUtil.NumberOnlyBuildLabel label = new ChartUtil.NumberOnlyBuildLabel(lastBuild);
ChartUtil.NumberOnlyBuildLabel label = new ChartUtil.NumberOnlyBuildLabel((Run<?, ?>) lastBuild);
AbstractBuildReport action = lastBuild.getAction(AbstractBuildReport.class);
if (action != null) {
builder.add(collector.getCollectedNumber(action), collector.getTitle(), label);
Expand Down
Expand Up @@ -20,7 +20,6 @@ public abstract class HealthTarget<M extends HealthMetric<OBSERVABLE>, OBSERVABL
private final Float fail;
private final Float failNew;

@DataBoundConstructor
public HealthTarget(M metric, String healthy, String unhealthy, String unstable, String fail, String failNew) {
this.metric = metric;
this.fail = safeParse(fail);
Expand Down
@@ -1,3 +1,4 @@
<?jelly escape-by-default='true'?>
<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">
<img src="${relativeUrlPath}graph?width=800&amp;height=600"/>
Expand Down
@@ -1,3 +1,4 @@
<?jelly escape-by-default='true'?>
<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">
<img src="${relativeUrlPath}graph"/>
Expand Down
@@ -1,3 +1,4 @@
<?jelly escape-by-default='true'?>
<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">

Expand Down
@@ -1,3 +1,4 @@
<?jelly escape-by-default='true'?>
<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">
<img src="${relativeUrlPath}graph?width=800&amp;height=600"/>
Expand Down
@@ -1,3 +1,4 @@
<?jelly escape-by-default='true'?>
<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">
<img src="${relativeUrlPath}graph"/>
Expand Down
@@ -1,3 +1,4 @@
<?jelly escape-by-default='true'?>
<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">

Expand Down
@@ -1,3 +1,4 @@
<?jelly escape-by-default='true'?>
<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" xmlns:bh="/lib/health">
<f:entry title="CppNCSS xml report pattern"
Expand Down
@@ -1,3 +1,4 @@
<?jelly escape-by-default='true'?>
<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">
<l:layout xmlns:plugin="/hudson/plugins/cppncss/tags">
Expand Down
@@ -1,3 +1,4 @@
<?jelly escape-by-default='true'?>
<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">
<j:if test="${from.graphActive}">
Expand Down
@@ -1,3 +1,4 @@
<?jelly escape-by-default='true'?>
<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">
<l:layout xmlns:plugin="/hudson/plugins/cppncss/tags">
Expand Down
@@ -1,3 +1,4 @@
<?jelly escape-by-default='true'?>
<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">
</j:jelly>
@@ -1,3 +1,4 @@
<?jelly escape-by-default='true'?>
<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">
</j:jelly>
@@ -1,3 +1,4 @@
<?jelly escape-by-default='true'?>
<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">
</j:jelly>
@@ -1,3 +1,4 @@
<?jelly escape-by-default='true'?>
<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" xmlns:i="jelly:fmt">
<t:summary icon="${it.iconFileName}">
Expand Down
@@ -1,3 +1,4 @@
<?jelly escape-by-default='true'?>
<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">
<l:layout xmlns:plugin="/hudson/plugins/cppncss/tags">
Expand Down
@@ -1,3 +1,4 @@
<?jelly escape-by-default='true'?>
<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" xmlns:i="jelly:fmt" xmlns:local="local">
<j:if test="${from.graphActive}">
Expand Down
@@ -1,3 +1,4 @@
<?jelly escape-by-default='true'?>
<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">
<l:layout xmlns:plugin="/hudson/plugins/cppncss/tags">
Expand Down
@@ -1,3 +1,4 @@
<?jelly escape-by-default='true'?>
<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">
</j:jelly>
@@ -1,3 +1,4 @@
<?jelly escape-by-default='true'?>
<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">
</j:jelly>
@@ -1,3 +1,4 @@
<?jelly escape-by-default='true'?>
<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">
</j:jelly>
1 change: 1 addition & 0 deletions src/main/resources/index.jelly
@@ -1,3 +1,4 @@
<?jelly escape-by-default='true'?>
<div>
This plugin integrates <a href="http://cppncss.sourceforge.net/">Cpp NCSS reports</a> to Jenkins.
</div>
1 change: 1 addition & 0 deletions src/main/resources/lib/health/row.jelly
@@ -1,3 +1,4 @@
<?jelly escape-by-default='true'?>
<!--
One entry
Expand Down

0 comments on commit a4f7dd6

Please sign in to comment.