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

Commit 836dc3e

Browse files
committed
Removed Windows support
1 parent 1a2acbc commit 836dc3e

File tree

6 files changed

+11
-34
lines changed

6 files changed

+11
-34
lines changed

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

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -188,13 +188,8 @@ public void setUp(Context context, Run<?, ?> build, FilePath workspace, Launcher
188188
// Set Environment variable
189189
setEnv(initialEnvironment);
190190

191-
String nodeSpecificMatlab = "";
192-
if(getNodeSpecificMatlab(Computer.currentComputer(), listener) != null) {
193-
nodeSpecificMatlab = getNodeSpecificMatlab(Computer.currentComputer(), listener) + getNodeSpecificExecutable(launcher);
194-
} else {
195-
throw new IOException ("ERROR***");
196-
}
197191

192+
String nodeSpecificMatlab = getNodeSpecificMatlab(Computer.currentComputer(), listener) + getNodeSpecificExecutable(launcher);
198193
FilePath matlabExecutablePath = new FilePath(launcher.getChannel(), nodeSpecificMatlab);
199194

200195
if (!matlabExecutablePath.exists()) {

src/main/java/com/mathworks/ci/tools/MatlabInstallable.java

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,7 @@ public class MatlabInstallable extends Installable {
1515
private String osName;
1616
public MatlabInstallable (String osName) throws InstallationFailedException {
1717
this.osName = osName;
18-
switch (osName) {
19-
case "win64":
20-
this.url = Message.getValue ("tools.matlab.mpm.installer.win");
21-
this.batchURL = Message.getValue ("tools.matlab.batch.executable.win");
22-
break;
18+
switch (this.osName) {
2319
case "glnxa64":
2420
this.url = Message.getValue ("tools.matlab.mpm.installer.linux");
2521
this.batchURL = Message.getValue ("tools.matlab.batch.executable.linux");
@@ -42,16 +38,10 @@ public String getBatchURL () {
4238
}
4339

4440
public FilePath getBatchInstallable (FilePath expectedPath) {
45-
if (this.osName == "win64") {
46-
return new FilePath (expectedPath, "matlab-batch.exe");
47-
}
4841
return new FilePath (expectedPath, "matlab-batch");
4942
}
5043

5144
public FilePath getMpmInstallable (FilePath expectedPath) {
52-
if (this.osName == "win64") {
53-
return new FilePath (expectedPath, "mpm.exe");
54-
}
5545
return new FilePath (expectedPath, "mpm");
5646
}
5747
}

src/main/java/com/mathworks/ci/tools/MatlabInstaller.java

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -259,9 +259,6 @@ public Installable getInstallable (Node node) throws IOException, InterruptedExc
259259
// Gather properties for the node to install on
260260
String[] properties = node.getChannel ()
261261
.call (new GetSystemProperties ("os.name", "os.arch", "os.version"));
262-
if(properties[0].contains ("win")) {
263-
throw new InstallationFailedException ("Unsupported OS");
264-
}
265262
return getInstallCandidate (properties[0], properties[1]);
266263
}
267264

@@ -282,8 +279,6 @@ public String getPlatform (String os, String architecture) throws InstallationFa
282279
} else {
283280
return "maci64";
284281
}
285-
} else if (value.contains ("windows")) {
286-
return "win64";
287282
} else {
288283
throw new InstallationFailedException ("Unsupported OS");
289284
}

src/main/resources/config.properties

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,6 @@ Axis.no.installed.matlab.error = Because no MATLAB versions exist under Jenkins
3131
Use.matlab.version.axis.warning = This project specifies MATLAB versions using the 'Use MATLAB version' option as well as the added 'MATLAB' axis. The value specified by 'Use MATLAB version' takes precedence over the values specified by the 'MATLAB' axis.
3232
matlab.tools.auto.install.display.name = Install Using MPM
3333

34-
tools.matlab.mpm.installer.win = https://www.mathworks.com/mpm/win64/mpm
35-
tools.matlab.batch.executable.win = https://ssd.mathworks.com/supportfiles/ci/matlab-batch/v1/win64/matlab-batch.exe
3634
tools.matlab.mpm.installer.linux = https://www.mathworks.com/mpm/glnxa64/mpm
3735
tools.matlab.batch.executable.linux = https://ssd.mathworks.com/supportfiles/ci/matlab-batch/v1/glnxa64/matlab-batch
3836
tools.matlab.mpm.installer.maci64 = https://www.mathworks.com/mpm/maci64/mpm

src/test/java/unit/com/mathworks/ci/tools/MatlabInstallableUnitTest.java

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,26 +8,24 @@
88
*
99
*/
1010

11-
11+
import org.junit.Rule;
1212
import org.junit.Test;
1313

1414
import hudson.FilePath;
1515
import com.mathworks.ci.TestMessage;
16+
import org.junit.rules.ExpectedException;
1617

1718
public class MatlabInstallableUnitTest {
1819

20+
@Rule
21+
public ExpectedException exceptionRule = ExpectedException.none ();
22+
1923
@Test
2024
public void testValidWin64OS () throws InstallationFailedException {
25+
exceptionRule.expect(InstallationFailedException.class);
26+
exceptionRule.expectMessage("Unsupported OS");
2127
MatlabInstallable installable = new MatlabInstallable ("win64");
22-
assertEquals (TestMessage.getValue ("tools.matlab.mpm.installer.win"), installable.url);
23-
assertEquals (TestMessage.getValue ("tools.matlab.batch.executable.win"),
24-
installable.getBatchURL ());
2528

26-
FilePath expectedPath = new FilePath (new File ("C:/install"));
27-
assertEquals (new FilePath (expectedPath, "matlab-batch.exe").getRemote (),
28-
installable.getBatchInstallable (expectedPath).getRemote ());
29-
assertEquals (new FilePath (expectedPath, "mpm.exe").getRemote (),
30-
installable.getMpmInstallable (expectedPath).getRemote ());
3129
}
3230

3331
@Test

src/test/java/unit/com/mathworks/ci/tools/MatlabInstallerUnitTest.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88
import static org.junit.Assert.*;
99
import static org.mockito.Mockito.*;
1010

11+
import org.junit.Rule;
12+
import org.junit.rules.ExpectedException;
1113
import org.mockito.Mock;
1214
import org.mockito.MockitoAnnotations;
1315

@@ -79,6 +81,5 @@ public void testGetPlatform () throws InstallationFailedException {
7981
assertEquals ("glnxa64", installer.getPlatform ("Linux", "i686"));
8082
assertEquals ("maci64", installer.getPlatform ("Mac OS X", "amd64"));
8183
assertEquals ("maca64", installer.getPlatform ("Mac OS X", "arm64"));
82-
assertEquals ("win64", installer.getPlatform ("Windows 10", "x86"));
8384
}
8485
}

0 commit comments

Comments
 (0)