Skip to content
This repository was archived by the owner on Mar 27, 2025. It is now read-only.

Commit 0d36c90

Browse files
authored
Merge pull request #368 from mathworks/2.15.1-SNAPSHOT-Qualification
2.15.1 snapshot qualification
2 parents 997a8c9 + 11259b8 commit 0d36c90

File tree

82 files changed

+2085
-1433
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

82 files changed

+2085
-1433
lines changed

azure-pipelines.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,12 @@ trigger:
1919
- master
2020

2121
steps:
22+
- task: JavaToolInstaller@0
23+
inputs:
24+
versionSpec: '11'
25+
jdkArchitectureOption: 'x64'
26+
jdkSourceOption: 'PreInstalled'
27+
2228
- task: Maven@4
2329
inputs:
2430
mavenPomFile: 'pom.xml'

pom.xml

Lines changed: 42 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -4,61 +4,74 @@
44
<parent>
55
<groupId>org.jenkins-ci.plugins</groupId>
66
<artifactId>plugin</artifactId>
7-
<version>3.57</version>
7+
<version>4.75</version>
88
<relativePath />
99
</parent>
10+
1011
<artifactId>matlab</artifactId>
1112
<version>2.15.1-SNAPSHOT</version>
1213
<packaging>hpi</packaging>
14+
15+
<name>MATLAB Plugin</name>
16+
<url>https://github.com/jenkinsci/matlab-plugin</url>
17+
<description>Jenkins plugin for MATLAB</description>
18+
1319
<developers>
1420
<developer>
1521
<id>mathworks_ci_team</id>
1622
<name>MathWorks</name>
17-
<email>nbhoski@mathworks.com</email>
23+
<email>continuous-integration@mathworks.com</email>
1824
</developer>
1925
</developers>
20-
<properties>
21-
<jenkins.version>2.164.3</jenkins.version>
22-
<java.level>8</java.level>
23-
</properties>
24-
<name>MATLAB Plugin</name>
25-
<description>Jenkins plugin for MATLAB</description>
26-
<url>https://github.com/jenkinsci/matlab-plugin</url>
26+
2727
<licenses>
2828
<license>
2929
<name>MIT License</name>
3030
<url>https://opensource.org/licenses/MIT</url>
3131
</license>
3232
</licenses>
33+
3334
<repositories>
3435
<repository>
3536
<id>repo.jenkins-ci.org</id>
3637
<url>https://repo.jenkins-ci.org/public/</url>
3738
</repository>
3839
</repositories>
40+
3941
<pluginRepositories>
4042
<pluginRepository>
4143
<id>repo.jenkins-ci.org</id>
4244
<url>https://repo.jenkins-ci.org/public/</url>
4345
</pluginRepository>
4446
</pluginRepositories>
47+
4548
<scm>
4649
<connection>scm:git:ssh://github.com/jenkinsci/matlab-plugin.git</connection>
4750
<developerConnection>scm:git:ssh://[email protected]/jenkinsci/matlab-plugin.git</developerConnection>
48-
<url>http://github.com/jenkinsci/matlab-plugin</url>
51+
<url>https://github.com/jenkinsci/matlab-plugin</url>
4952
<tag>HEAD</tag>
5053
</scm>
54+
55+
<properties>
56+
<!-- https://www.jenkins.io/doc/developer/plugin-development/choosing-jenkins-baseline/ -->
57+
<jenkins.baseline>2.387</jenkins.baseline>
58+
<jenkins.version>${jenkins.baseline}.3</jenkins.version>
59+
<!-- TODO fix violations -->
60+
<spotbugs.threshold>High</spotbugs.threshold>
61+
</properties>
62+
5163
<dependencyManagement>
5264
<dependencies>
5365
<dependency>
5466
<groupId>io.jenkins.tools.bom</groupId>
55-
<artifactId>bom-2.164.x</artifactId>
56-
<version>4</version>
57-
<scope>import</scope>
67+
<artifactId>bom-${jenkins.baseline}.x</artifactId>
68+
<version>2543.vfb_1a_5fb_9496d</version>
5869
<type>pom</type>
70+
<scope>import</scope>
5971
</dependency>
6072
</dependencies>
6173
</dependencyManagement>
74+
6275
<dependencies>
6376
<!-- JSON Parser -->
6477
<dependency>
@@ -100,16 +113,25 @@
100113
<artifactId>workflow-job</artifactId>
101114
<scope>test</scope>
102115
</dependency>
103-
<!-- Mockito -->
104-
<dependency>
105-
<groupId>org.mockito</groupId>
106-
<artifactId>mockito-core</artifactId>
107-
<version>3.1.0</version>
108-
<scope>test</scope>
109-
</dependency>
116+
<dependency>
117+
<groupId>org.mockito</groupId>
118+
<artifactId>mockito-core</artifactId>
119+
<version>3.1.0</version>
120+
<scope>test</scope>
121+
</dependency>
122+
<dependency>
123+
<groupId>org.eclipse.jetty</groupId>
124+
<artifactId>jetty-util</artifactId>
125+
<version>11.0.24</version>
126+
<scope>test</scope>
127+
</dependency>
110128
</dependencies>
111129
<build>
112130
<plugins>
131+
<plugin>
132+
<groupId>org.jenkins-ci.tools</groupId>
133+
<artifactId>maven-hpi-plugin</artifactId>
134+
</plugin>
113135
<!-- Plugin to download the matlab run scripts and keep it under class
114136
resource folder -->
115137
<plugin>

src/main/java/com/mathworks/ci/BuildArtifactAction.java

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
/**
44
* Copyright 2024 The MathWorks, Inc.
5-
*
65
*/
76

87
import hudson.FilePath;
@@ -36,16 +35,16 @@ public BuildArtifactAction(Run<?, ?> build, String actionID) {
3635
this.actionID = actionID;
3736

3837
// Setting the counts of task when Action is created.
39-
try{
38+
try {
4039
setCounts();
4140
} catch (ParseException e) {
4241
throw new RuntimeException(e);
43-
} catch (InterruptedException e){
42+
} catch (InterruptedException e) {
4443
throw new RuntimeException(e);
4544
}
4645
}
4746

48-
public String getActionID(){
47+
public String getActionID() {
4948
return (this.actionID == null) ? "" : this.actionID;
5049
}
5150

@@ -64,13 +63,13 @@ public String getDisplayName() {
6463
@CheckForNull
6564
@Override
6665
public String getUrlName() {
67-
return (this.actionID == null) ? "buildresults" : "buildresults" + this.actionID ;
66+
return (this.actionID == null) ? "buildresults" : "buildresults" + this.actionID;
6867
}
6968

7069
public List<BuildArtifactData> getBuildArtifact() throws ParseException, InterruptedException, IOException {
7170
List<BuildArtifactData> artifactData = new ArrayList<BuildArtifactData>();
7271
FilePath fl;
73-
if(this.actionID == null){
72+
if (this.actionID == null) {
7473
fl = new FilePath(new File(build.getRootDir().getAbsolutePath() + "/" +
7574
MatlabBuilderConstants.BUILD_ARTIFACT + ".json"));
7675
} else {
@@ -147,7 +146,7 @@ public void setOwner(Run owner) {
147146
private void setCounts() throws InterruptedException, ParseException {
148147
List<BuildArtifactData> artifactData = new ArrayList<BuildArtifactData>();
149148
FilePath fl;
150-
if(this.actionID == null){
149+
if (this.actionID == null) {
151150
fl = new FilePath(new File(build.getRootDir().getAbsolutePath() + "/" +
152151
MatlabBuilderConstants.BUILD_ARTIFACT + ".json"));
153152
} else {
@@ -206,11 +205,11 @@ private void setCounts() throws InterruptedException, ParseException {
206205
private void iterateAllTaskAttributes(Entry pair, BuildArtifactData data) {
207206
// Iterates across all task attributes and updates
208207
String key = pair.getKey().toString();
209-
switch(key){
208+
switch (key) {
210209
case "duration":
211210
data.setTaskDuration(pair.getValue().toString());
212211
break;
213-
case "name" :
212+
case "name":
214213
data.setTaskName(pair.getValue().toString());
215214
break;
216215
case "description":
@@ -225,7 +224,7 @@ private void iterateAllTaskAttributes(Entry pair, BuildArtifactData data) {
225224
case "skipReason":
226225
String skipReasonKey = pair.getValue().toString();
227226
String skipReason;
228-
switch(skipReasonKey){
227+
switch (skipReasonKey) {
229228
case "UpToDate":
230229
skipReason = "up-to-date";
231230
break;
@@ -242,7 +241,7 @@ private void iterateAllTaskAttributes(Entry pair, BuildArtifactData data) {
242241
}
243242
data.setSkipReason(skipReason);
244243
break;
245-
default :
244+
default:
246245
break;
247246
}
248247
}

src/main/java/com/mathworks/ci/BuildArtifactData.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
/**
44
* Copyright 2024 The MathWorks, Inc.
5-
*
65
*/
76

87
public class BuildArtifactData {

src/main/java/com/mathworks/ci/BuildConsoleAnnotator.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
/**
44
* Copyright 2024 The MathWorks, Inc.
5-
*
65
*/
76

87
import com.google.common.base.Charsets;
@@ -39,7 +38,7 @@ private static byte[][] createBuildNotes() {
3938
ByteArrayOutputStream targetNote = new ByteArrayOutputStream();
4039
new BuildTargetNote().encodeTo(targetNote);
4140
ByteArrayOutputStream outcomeNote = new ByteArrayOutputStream();
42-
return new byte[][]{targetNote.toByteArray(), outcomeNote.toByteArray()};
41+
return new byte[][] { targetNote.toByteArray(), outcomeNote.toByteArray() };
4342
} catch (IOException e) {
4443
throw new RuntimeException(e);
4544
}
@@ -71,7 +70,7 @@ private static class ConsoleLogFilterImpl extends ConsoleLogFilter implements Se
7170
private static final long serialVersionUID = 1;
7271
private byte[][] buildNotes = createBuildNotes();
7372

74-
//Taking care of old MATLAB build actions.
73+
// Taking care of old MATLAB build actions.
7574
private Object readResolve() {
7675
if (buildNotes == null) {
7776
buildNotes = createBuildNotes();

src/main/java/com/mathworks/ci/BuildTargetNote.java

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
/**
44
* Copyright 2024 The MathWorks, Inc.
5-
*
65
*/
76

87
import com.google.common.annotations.VisibleForTesting;
@@ -14,7 +13,6 @@
1413
import hudson.console.ConsoleNote;
1514
import java.util.regex.Pattern;
1615

17-
1816
public class BuildTargetNote extends ConsoleNote {
1917
@VisibleForTesting
2018
@SuppressFBWarnings(value = "MS_SHOULD_BE_FINAL", justification = "Visible for testing")
@@ -26,10 +24,10 @@ public BuildTargetNote() {
2624
@Override
2725
public ConsoleAnnotator annotate(Object context, MarkupText text, int charPos) {
2826
MarkupText.SubText t = text.findToken(Pattern.compile("MATLAB-Build-"));
29-
String taskName = text.subText(13, text.length()-2).getText();
30-
taskName = taskName.replace("]","").trim();
27+
String taskName = text.subText(13, text.length() - 2).getText();
28+
taskName = taskName.replace("]", "").trim();
3129
if (t != null)
32-
t.addMarkup(0, t.length()-1, "<a id= matlab" + taskName + " name=matlab" + taskName + ">", "</a>");
30+
t.addMarkup(0, t.length() - 1, "<a id= matlab" + taskName + " name=matlab" + taskName + ">", "</a>");
3331
return null;
3432
}
3533

src/main/java/com/mathworks/ci/FormValidationUtil.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
package com.mathworks.ci;
22

33
/**
4-
* Copyright 2019-2020 The MathWorks, Inc.
4+
* Copyright 2019-2024 The MathWorks, Inc.
55
*
66
* This is Utility class which provides commonly used methods for form validations across builders
7-
*
87
*/
98

109
import java.util.List;

src/main/java/com/mathworks/ci/ListenerLogDecorator.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
package com.mathworks.ci;
22

3-
/*
4-
* Copyright 2018 The MathWorks, Inc.
5-
*/
3+
/**
4+
* Copyright 2018-2024 The MathWorks, Inc.
5+
*/
66

77
import java.io.IOException;
88
import java.io.OutputStream;

src/main/java/com/mathworks/ci/MatlabBuildWrapperContent.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
package com.mathworks.ci;
22

33
/**
4-
* Copyright 2020 The MathWorks, Inc.
4+
* Copyright 2020-2024 The MathWorks, Inc.
55
*
66
* Class to parse Stapler request for Use MATLAB Version build wrapper.
7-
*
87
*/
98

109
import org.kohsuke.stapler.DataBoundConstructor;
@@ -15,7 +14,7 @@ public class MatlabBuildWrapperContent {
1514
private final String matlabRootFolder;
1615

1716
@DataBoundConstructor
18-
public MatlabBuildWrapperContent(String matlabInstallationName, String matlabRootFolder){
17+
public MatlabBuildWrapperContent(String matlabInstallationName, String matlabRootFolder) {
1918
this.matlabInstallationName = matlabInstallationName;
2019
this.matlabRootFolder = matlabRootFolder;
2120
}
Lines changed: 19 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
package com.mathworks.ci;
22

33
/*
4-
* Copyright 2019-2020 The MathWorks, Inc.
4+
* Copyright 2019-2024 The MathWorks, Inc.
55
*/
66

77
public class MatlabBuilderConstants {
@@ -11,43 +11,44 @@ public class MatlabBuilderConstants {
1111
public static final double BASE_MATLAB_VERSION_COBERTURA_SUPPORT = 9.3;
1212
public static final double BASE_MATLAB_VERSION_MODELCOVERAGE_SUPPORT = 9.5;
1313
public static final double BASE_MATLAB_VERSION_EXPORTSTMRESULTS_SUPPORT = 9.6;
14-
14+
1515
public static final String MATLAB_RUNNER_TARGET_FILE = "Builder.matlab.runner.target.file.name";
1616
public static final String MATLAB_TESTS_RUNNER_TARGET_FILE = "runMatlabTests.m";
1717
public static final String MATLAB_RUNNER_RESOURCE = "com/mathworks/ci/MatlabBuilder/runMatlabTests.m";
1818
public static final String AUTOMATIC_OPTION = "RunTestsAutomaticallyOption";
19-
20-
// Input parameter names (Passed to runMatlabTests.m as name-value pair arguments)
19+
20+
// Input parameter names (Passed to runMatlabTests.m as name-value pair
21+
// arguments)
2122
public static final String PDF_REPORT = "'PDFReport'";
2223
public static final String TAP_RESULTS = "'TAPResults'";
2324
public static final String JUNIT_RESULTS = "'JUnitResults'";
2425
public static final String STM_RESULTS = "'SimulinkTestResults'";
2526
public static final String COBERTURA_CODE_COVERAGE = "'CoberturaCodeCoverage'";
2627
public static final String COBERTURA_MODEL_COVERAGE = "'CoberturaModelCoverage'";
27-
28-
//Matlab Script generator package
28+
29+
// Matlab Script generator package
2930
public static final String MATLAB_SCRIPT_GENERATOR = "matlab-script-generator.zip";
30-
31-
//Test runner file prefix
31+
32+
// Test runner file prefix
3233
public static final String MATLAB_TEST_RUNNER_FILE_PREFIX = "runner_";
33-
34-
//Temporary MATLAB folder name in workspace
34+
35+
// Temporary MATLAB folder name in workspace
3536
public static final String TEMP_MATLAB_FOLDER_NAME = ".matlab";
3637

3738
// MATLAB default function/plugin paths
3839
public static final String DEFAULT_PLUGIN = "+ciplugins/+jenkins/getDefaultPlugins.m";
3940
public static final String BUILD_REPORT_PLUGIN = "+ciplugins/+jenkins/BuildReportPlugin.m";
4041
public static final String TASK_RUN_PROGRESS_PLUGIN = "+ciplugins/+jenkins/TaskRunProgressPlugin.m";
4142
public static final String BUILD_ARTIFACT = "buildArtifact";
42-
43+
4344
public static final String NEW_LINE = System.getProperty("line.separator");
4445

45-
//MATLAB Runner Script
46+
// MATLAB Runner Script
4647
public static final String TEST_RUNNER_SCRIPT = String.join(NEW_LINE,
47-
"addpath('${TEMP_FOLDER}');",
48-
"testScript = genscript(${PARAMS});",
49-
"disp('Running MATLAB script with content:');",
50-
"disp(testScript.Contents);",
51-
"fprintf('___________________________________\\n\\n');",
52-
"run(testScript);");
48+
"addpath('${TEMP_FOLDER}');",
49+
"testScript = genscript(${PARAMS});",
50+
"disp('Running MATLAB script with content:');",
51+
"disp(testScript.Contents);",
52+
"fprintf('___________________________________\\n\\n');",
53+
"run(testScript);");
5354
}

0 commit comments

Comments
 (0)