-
Notifications
You must be signed in to change notification settings - Fork 19
/
Sugar.train
94 lines (73 loc) · 4.97 KB
/
Sugar.train
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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
include("$(Train)/ci2.train");
var sugarVersion = getVersionNumberFromGlobalIni("Oxygene");
export("CIVersionNumber", sugarVersion);
if (typeof ciCrossBox === "undefined")
{
ciCrossBox = env["CICrossBoxServerName"];
if (typeof ciCrossBox === "undefined")
ciCrossBox = "Onyx";
}
var optionSetups = ciOptions.contains("SETUPS") || ciOptions.contains("SETUP") ;
var optionSkipSetups = ciOptions.contains("SKIPSETUPS");
var optionSkipHelp = ciOptions.contains("SKIPHELP");
var optionShell = ciOptions.contains("SHELL") || ciOptions.contains("ISO") || ciOptions.contains("ISOS");
var lFiles =
["Sugar/Properties/AssemblyInfo.pas",
"Sugar/Properties/AssemblyInfo_WinRT.pas",
"Sugar/Properties/AssemblyInfo_WP8.pas",
"Sugar.Data/Properties/AssemblyInfo_WP8.pas",
"Sugar.Data/Properties/AssemblyInfo_WinRT.pas",
"Sugar.Data/Properties/AssemblyInfo.pas"];
msbuild.updateAssemblyVersion(lFiles, sugarVersion);
//Build Sugar
msbuild["rebuild"]("Sugar/Sugar.Cooper.elements", {configuration: "Release", destinationFolder: "./Bin" });
cleanObj();
msbuild["rebuild"]("Sugar/Sugar.Cooper.Android.elements", {configuration: "Release", destinationFolder: "./Bin/Android" });
cleanObj();
msbuild["rebuild"]("Sugar/Sugar.Echoes.elements", {configuration: "Release", destinationFolder: "./Bin" });
cleanObj();
msbuild["rebuild"]("Sugar/Sugar.Echoes.WinRT.BuildServer.elements", {configuration: "Release", destinationFolder: "./Bin/WinRT" });
cleanObj();
msbuild["rebuild"]("Sugar/Sugar.Echoes.WP8.BuildServer.elements", {configuration: "Release", destinationFolder: "./Bin/WP8" });
cleanObj();
msbuild["rebuild"]("Sugar/Sugar.Nougat.OSX.elements", {configuration: "Release", destinationFolder: "./Bin", extraArgs: '"/p:CrossBox=$(ciCrossBox);CrossBoxDeviceID=Mac"'});
msbuild["rebuild"]("Sugar/Sugar.Nougat.iOS.elements", {configuration: "Release", destinationFolder: "./Bin", extraArgs: '"/p:CrossBox=$(ciCrossBox);CrossBoxDeviceID=iOS Simulator (iPhone)"'});
msbuild["rebuild"]("Sugar/Sugar.Nougat.iOS.elements", {configuration: "Release", destinationFolder: "./Bin", extraArgs: '"/p:CrossBox=$(ciCrossBox);CrossBoxDeviceID=Generic iOS Device"'});
msbuild["rebuild"]("Sugar/Sugar.Nougat.watchOS.elements", {configuration: "Release", destinationFolder: "./Bin", extraArgs: '"/p:CrossBox=$(ciCrossBox);CrossBoxDeviceID=watchOS Simulator (Apple Watch 38mm)"'});
msbuild["rebuild"]("Sugar/Sugar.Nougat.watchOS.elements", {configuration: "Release", destinationFolder: "./Bin", extraArgs: '"/p:CrossBox=$(ciCrossBox);CrossBoxDeviceID=Generic watchOS Device"'});
msbuild["rebuild"]("Sugar/Sugar.Nougat.tvOS.elements", {configuration: "Release", destinationFolder: "./Bin", extraArgs: '"/p:CrossBox=$(ciCrossBox);CrossBoxDeviceID=tvOS Simulator (Apple Watch 1080p)"'});
msbuild["rebuild"]("Sugar/Sugar.Nougat.tvOS.elements", {configuration: "Release", destinationFolder: "./Bin", extraArgs: '"/p:CrossBox=$(ciCrossBox);CrossBoxDeviceID=Generic tvOS Device"'});
//Build Sugar.Data
if (false)
{
msbuild["rebuild"]("Sugar.Data/Sugar.Data.Cooper.elements", {configuration: "Release"});
cleanObj();
file.copy("Sugar.Data/Bin/Java/sugar.data.jar", "./Bin", true);
msbuild["rebuild"]("Sugar.Data/Sugar.Data.Cooper.Android.elements", {configuration: "Release"});
cleanObj();
file.copy("Sugar.Data/Bin/Android/sugar.data.jar", "./Bin/Android", true);
msbuild["rebuild"]("Sugar.Data/Sugar.Data.Echoes.elements", {configuration: "Release", destinationFolder: "./Bin" });
cleanObj();
msbuild["rebuild"]("Sugar.Data/Sugar.Data.Echoes.WinRT.BuildServer.elements", {configuration: "Release", destinationFolder: "./Bin/WinRT" });
cleanObj();
msbuild["rebuild"]("Sugar.Data/Sugar.Data.Echoes.WP8.BuildServer.elements", {configuration: "Release", destinationFolder: "./Bin/WP8" });
cleanObj();
msbuild["rebuild"]("Sugar.Data/Sugar.Data.Nougat.OSX.elements", {configuration: "Release", destinationFolder: "./Bin", extraArgs: '"/p:CrossBox=$(ciCrossBox);CrossBoxDeviceID=Mac"'});
cleanObj();
msbuild["rebuild"]("Sugar.Data/Sugar.Data.Nougat.iOS.elements", {configuration: "Release", destinationFolder: "./Bin", extraArgs: '"/p:CrossBox=$(ciCrossBox);CrossBoxDeviceID=iOS Simulator (iPhone)"'});
cleanObj();
msbuild["rebuild"]("Sugar.Data/Sugar.Data.Nougat.iOS.elements", {configuration: "Release", destinationFolder: "./Bin", extraArgs: '"/p:CrossBox=$(ciCrossBox);CrossBoxDeviceID=Generic iOS Device"'});
cleanObj();
}
function cleanObj()
{
folder.remove("./Obj");
folder.remove("Sugar.Data/Obj");
folder.remove("Sugar/Obj");
}
shell.exec("$(CIToolsBaseFolder)/Tools/HeaderParser/HeaderParser.exe", '-l:NET -o:"$(CIReleaseFolder)\\DocHeaders\\SUGAR.xml" ".\\Bin\\Sugar.dll"');
zip.compress("$(CIReleaseFolder)/Sugar - $(sugarVersion).zip", "./Bin", "*Sugar*.*", true);
var s3 = getSharedS3Bucket();
folder.create("./Shared", true)
zip.compress("./Shared/Sugar.zip", "./Bin", "*Sugar*.*", true);
s3.uploadFile("./Shared/Sugar.zip", ciSharedPrefix);