|
1 | | - package com.mathworks.ci; |
2 | | - |
3 | | -/* |
| 1 | + package com.mathworks.ci; |
| 2 | + /* |
4 | 3 | * Copyright 2019-2020 The MathWorks, Inc. |
5 | 4 | */ |
6 | 5 |
|
@@ -38,22 +37,22 @@ public class MatlabBuilderConstants { |
38 | 37 | //Temporary MATLAB folder name in workspace |
39 | 38 | static final String TEMP_MATLAB_FOLDER_NAME = ".matlab"; |
40 | 39 |
|
| 40 | + static final String NEW_LINE = System.getProperty("line.separator"); |
| 41 | + |
| 42 | + static final String TEST_RUNNER_SCRIPT = String.join(NEW_LINE, |
| 43 | + "tmpDir=tempname;", |
| 44 | + "mkdir(tmpDir);", |
| 45 | + "addpath(tmpDir);", |
| 46 | + "zipURL='${ZIP_FILE}';", |
| 47 | + "unzip(zipURL,tmpDir);", |
| 48 | + "testScript = genscript(${PARAMS});", |
| 49 | + "disp('Running MATLAB script with content:');", |
| 50 | + "disp(testScript.Contents);", |
| 51 | + "testScript.writeToFile(fullfile(tmpDir,'runnerScript.m'));", |
| 52 | + "fprintf('___________________________________\\n\\n');"); |
| 53 | +} |
41 | 54 |
|
42 | | - |
43 | | - static final String TEST_RUNNER_SCRIPT="destination=tempname;\n" |
44 | | - +"mkdir(destination);\n" |
45 | | - + "addpath(destination);\n" |
46 | | - +"zipURL='${ZIP_FILE}';\n" |
47 | | - +"unzip(zipURL,destination);\n" |
48 | | - +"disp('Unziping genscript resource in');\n" |
49 | | - +"disp(destination);\n" |
50 | | - + "testScript = genscript(${PARAMS});\n" |
51 | | - + "disp('Running MATLAB script with content:');\n" |
52 | | - + "disp(strtrim(testScript.Contents));\n" |
53 | | - + "runnerFile = testScript.writeToFile(fullfile(destination,'runnerScript.m'));\n" |
54 | | - +"warning('off');" |
55 | | - + "fprintf('___________________________________\\n\\n');\n"; |
56 | 55 |
|
57 | 56 |
|
58 | | -} |
| 57 | + |
59 | 58 |
|
0 commit comments