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

Commit 45c5193

Browse files
committed
Updated descriptor names-review comment.
1 parent 3640322 commit 45c5193

File tree

3 files changed

+5
-9
lines changed

3 files changed

+5
-9
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ private void setEnv(EnvVars env) {
5656

5757
@Symbol("Matlab")
5858
@Extension
59-
public static final class MatlabBuildWrapperDescriptor extends BuildWrapperDescriptor {
59+
public static final class AddMatlabToPathDescriptor extends BuildWrapperDescriptor {
6060

6161
MatlabReleaseInfo rel;
6262
String matlabRootFolder;

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

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ private EnvVars getEnv() {
6464

6565
@Symbol("RunMatlabCommand")
6666
@Extension
67-
public static class MatlabScriptDescriptor extends BuildStepDescriptor<Builder> {
67+
public static class RunMatlabCommandDescriptor extends BuildStepDescriptor<Builder> {
6868

6969
// Overridden Method used to show the text under build dropdown
7070
@Override
@@ -114,8 +114,6 @@ private synchronized int execMatlabCommand(FilePath workspace, Launcher launcher
114114
TaskListener listener, EnvVars envVars) throws IOException, InterruptedException {
115115
ProcStarter matlabLauncher;
116116
try {
117-
// Get mMatlabroot set in wrapper.
118-
String matlabRoot = envVars.get("matlabroot");
119117
matlabLauncher = launcher.launch().pwd(workspace).envs(envVars);
120118
FilePath targetWorkspace = new FilePath(launcher.getChannel(), workspace.getRemote());
121119
if(launcher.isUnix()) {

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

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
import org.kohsuke.stapler.DataBoundSetter;
2222
import org.kohsuke.stapler.QueryParameter;
2323
import org.kohsuke.stapler.StaplerRequest;
24-
import com.mathworks.ci.AddMatlabToPathBuildWrapper.MatlabBuildWrapperDescriptor;
24+
import com.mathworks.ci.AddMatlabToPathBuildWrapper.AddMatlabToPathDescriptor;
2525
import hudson.EnvVars;
2626
import hudson.Extension;
2727
import hudson.FilePath;
@@ -124,7 +124,7 @@ private EnvVars getEnv() {
124124

125125
@Symbol("RunMatlabTests")
126126
@Extension
127-
public static class MatlabTestDescriptor extends BuildStepDescriptor<Builder> {
127+
public static class RunMatlabTestsDescriptor extends BuildStepDescriptor<Builder> {
128128

129129
MatlabReleaseInfo rel;
130130

@@ -247,7 +247,7 @@ public FormValidation getFirstErrorOrWarning(
247247
return FormValidation.ok();
248248
try {
249249
final String matlabRoot = Jenkins.getInstance()
250-
.getDescriptorByType(MatlabBuildWrapperDescriptor.class).getMatlabRootFolder();
250+
.getDescriptorByType(AddMatlabToPathDescriptor.class).getMatlabRootFolder();
251251
for (Function<String, FormValidation> val : validations) {
252252
FormValidation validationResult = val.apply(matlabRoot);
253253
if (validationResult.kind.compareTo(Kind.ERROR) == 0
@@ -284,8 +284,6 @@ private synchronized int execMatlabCommand(FilePath workspace, Launcher launcher
284284
TaskListener listener, EnvVars envVars) throws IOException, InterruptedException {
285285
ProcStarter matlabLauncher;
286286
try {
287-
// Get matlabroot set in wrapper class.
288-
String matlabRoot = envVars.get("matlabroot");
289287
matlabLauncher = launcher.launch().pwd(workspace).envs(envVars);
290288
FilePath targetWorkspace = new FilePath(launcher.getChannel(), workspace.getRemote());
291289
if (launcher.isUnix()) {

0 commit comments

Comments
 (0)