-
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathtrain.js
43 lines (37 loc) · 1.32 KB
/
train.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
// prepare
folder.create("Artifacts");
folder.create("Bin");
folder.create("Lib");
// compile
delphi.build("src\\Project1.dpr",
{ "delphi": "xe11",
"destinationFolder": "Bin",
"dcuDestinationFolder": "Lib",
"unitSearchPath": "src",
"otherParameters": "-GD" });
delphi.build("tests\\Project1Tests.dpr",
{ "delphi": "xe11",
"destinationFolder": "Bin",
"dcuDestinationFolder": "Lib",
"unitSearchPath": "src;C:\\Users\\alefr\\Documents\\GitHub\\_forks\\DUnitX",
"conditionalDefines": ["CI"], // comentando essa linha, a compilação fica em modo "normal"
"otherParameters": "-GD" });
// run unit tests
shell.cd("Bin")
shell.system("Project1Tests.exe", wd);
shell.cd("..");
// run code coverage
folder.create("Bin\\Coverage");
var cccomand = "\"Coverage\\CodeCoverage.exe\" -e \"Bin\\Project1Tests.exe\" -m \"Bin\\Project1Tests.map\" -sd \"src\" -u uCalculadora.pas -html -emma -xml -od \"Bin\\Coverage\"";
file.write("cc.bat", cccomand);
shell.system("cc.bat", wd);
// copy artifacts
file.copy("Bin\\*.exe", "Artifacts");
file.copy("Bin\\dunitx-results.xml", "Artifacts");
file.copy("Bin\\Coverage", "Artifacts\\Coverage");
// zip artifacts
zip.compress("Build.zip", "Artifacts", "*.*", true);
file.move("Build.zip", "Artifacts")
// clean up
file.remove("cc.bat");
file.remove("Bin\\dunitx-results.xml");