@@ -78,10 +78,16 @@ public void setProducts (String products) {
7878 public FilePath performInstallation (ToolInstallation tool , Node node , TaskListener log )
7979 throws IOException , InterruptedException {
8080 FilePath supportingExecutable = preferredLocation (tool , node );
81- FilePath expectedPath = new FilePath (supportingExecutable , this .getVersion ());
81+ String [] systemProperties = getSystemProperties (node );
82+ FilePath expectedPath ;
83+ if (systemProperties [0 ].toLowerCase ().contains ("os x" )) {
84+ expectedPath = new FilePath (supportingExecutable , this .getVersion ()+".app" );
85+ } else {
86+ expectedPath = new FilePath (supportingExecutable , this .getVersion ());
87+ }
8288 MatlabInstallable installable ;
8389 try {
84- installable = (MatlabInstallable ) getInstallable (node );
90+ installable = (MatlabInstallable ) getInstallable (systemProperties );
8591 } catch (Exception e ) {
8692 throw new InstallationFailedException (e .getMessage ());
8793 }
@@ -191,15 +197,9 @@ private void addMatlabProductsToArgs (ArgumentListBuilder args)
191197 }
192198 }
193199
194- @ SuppressFBWarnings (value = {"NP_NULL_ON_SOME_PATH_FROM_RETURN_VALUE" },
195- justification =
196- "NP_NULL_ON_SOME_PATH_FROM_RETURN_VALUE: Its false positive scenario for sport bug which is fixed in later versions "
197- + "https://github.com/spotbugs/spotbugs/issues/1843" )
198- public Installable getInstallable (Node node ) throws IOException , InterruptedException {
200+ public Installable getInstallable (String [] systemProperties ) throws IOException {
199201 // Gather properties for the node to install on
200- String [] properties = node .getChannel ()
201- .call (new GetSystemProperties ("os.name" , "os.arch" , "os.version" ));
202- return getInstallCandidate (properties [0 ], properties [1 ]);
202+ return getInstallCandidate (systemProperties [0 ], systemProperties [1 ]);
203203 }
204204
205205 public MatlabInstallable getInstallCandidate (String osName , String architecture )
@@ -224,6 +224,16 @@ public String getPlatform (String os, String architecture) throws InstallationFa
224224 }
225225 }
226226
227+ @ SuppressFBWarnings (value = {"NP_NULL_ON_SOME_PATH_FROM_RETURN_VALUE" },
228+ justification =
229+ "NP_NULL_ON_SOME_PATH_FROM_RETURN_VALUE: Its false positive scenario for sport bug which is fixed in later versions "
230+ + "https://github.com/spotbugs/spotbugs/issues/1843" )
231+ private String [] getSystemProperties (Node node ) throws IOException , InterruptedException {
232+ String [] properties = node .getChannel ()
233+ .call (new GetSystemProperties ("os.name" , "os.arch" , "os.version" ));
234+ return properties ;
235+ }
236+
227237 @ Extension
228238 public static final class DescriptorImpl extends ToolInstallerDescriptor <MatlabInstaller > {
229239
0 commit comments