This repository was archived by the owner on Mar 27, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +8
-11
lines changed
src/main/java/com/mathworks/ci Expand file tree Collapse file tree 2 files changed +8
-11
lines changed Original file line number Diff line number Diff line change 22
33import java .io .IOException ;
44import org .jenkinsci .plugins .workflow .steps .StepContext ;
5- import org .jenkinsci .plugins .workflow .steps .StepExecution ;
5+ import org .jenkinsci .plugins .workflow .steps .SynchronousNonBlockingStepExecution ;
66import hudson .EnvVars ;
77import hudson .FilePath ;
88import hudson .Launcher ;
99import hudson .Launcher .ProcStarter ;
1010import hudson .model .Result ;
1111import hudson .model .TaskListener ;
1212
13- public class MatlabCommandStepExecution extends StepExecution implements MatlabBuild {
13+ public class MatlabCommandStepExecution extends SynchronousNonBlockingStepExecution < Void > implements MatlabBuild {
1414
1515 private static final long serialVersionUID = 1957239693658914450L ;
1616
@@ -32,7 +32,7 @@ private void setEnv(EnvVars env) {
3232 }
3333
3434 @ Override
35- public boolean start () throws Exception {
35+ public Void run () throws Exception {
3636 final Launcher launcher = getContext ().get (Launcher .class );
3737 final FilePath workspace = getContext ().get (FilePath .class );
3838 final TaskListener listener = getContext ().get (TaskListener .class );
@@ -47,10 +47,8 @@ public boolean start() throws Exception {
4747
4848 getContext ().setResult ((res == 0 ) ? Result .SUCCESS : Result .FAILURE );
4949
50- getContext ().onSuccess (true );
51-
5250 //return false represents the asynchronous run.
53- return false ;
51+ return null ;
5452 }
5553
5654 @ Override
Original file line number Diff line number Diff line change 88import java .io .IOException ;
99import org .jenkinsci .plugins .workflow .steps .StepContext ;
1010import org .jenkinsci .plugins .workflow .steps .StepExecution ;
11+ import org .jenkinsci .plugins .workflow .steps .SynchronousNonBlockingStepExecution ;
1112import hudson .EnvVars ;
1213import hudson .FilePath ;
1314import hudson .Launcher ;
1415import hudson .Launcher .ProcStarter ;
1516import hudson .model .Result ;
1617import hudson .model .TaskListener ;
1718
18- public class MatlabRunTestsStepExecution extends StepExecution implements MatlabBuild {
19+ public class MatlabRunTestsStepExecution extends SynchronousNonBlockingStepExecution < Void > implements MatlabBuild {
1920
2021 private static final long serialVersionUID = 6704588180717665100L ;
2122
@@ -32,7 +33,7 @@ private String getCommand() {
3233 }
3334
3435 @ Override
35- public boolean start () throws Exception {
36+ public Void run () throws Exception {
3637 final Launcher launcher = getContext ().get (Launcher .class );
3738 final FilePath workspace = getContext ().get (FilePath .class );
3839 final TaskListener listener = getContext ().get (TaskListener .class );
@@ -46,10 +47,8 @@ public boolean start() throws Exception {
4647
4748 getContext ().setResult ((res == 0 ) ? Result .SUCCESS : Result .FAILURE );
4849
49- getContext ().onSuccess (true );
50-
5150 //return false represents the asynchronous run.
52- return false ;
51+ return null ;
5352 }
5453
5554 @ Override
You can’t perform that action at this time.
0 commit comments