Repository navigation
Expand file tree
/
Copy pathtb.js
More file actions
118 lines (98 loc) · 4.39 KB
/
Copy pathtb.js
File metadata and controls
118 lines (98 loc) · 4.39 KB
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
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
// @ts-check
/// <reference path="../super/tb/install/builtins.js"/>
/// <reference path="tb_common.js"/>
function configure() {
project.setVariable("NAME", "npackd-cpp");
project.setVariable("TITLE", "Npackd C++");
project.setVariable("DESCRIPTION", "All the C++ Npackd programs.");
project.setVariable("TYPE", "generic");
}
/**
* Re-build a sub-project.
*
* @param {String} name project name
*/
function rebuildSubProject(name) {
child_process.execFileSync("tb.exe", ["--configure", "-c", project.getConfig()],
{cwd: project.getDirectory() + "\\" + name});
child_process.execFileSync("tb.exe", ["-c", project.getConfig(), "-t", "all"],
{cwd: project.getDirectory() + "\\" + name});
}
/**
* Builds a sub-project.
*
* @param {String} name project name
* @param {String} target target
*/
function buildSubProjectTarget(name, target) {
child_process.execFileSync("tb.exe", ["-c", project.getConfig(), "-t", target],
{cwd: project.getDirectory() + "\\" + name});
}
function build() {
console.log("Building Npackd C++................");
var version = system.readTextFile(project.getDirectory() + "\\appveyor.yml");
version = version.split('\n')[0];
version = version.split(':')[1];
version = version.split('{')[0];
version = version + "0";
version = version.trim();
console.log(version);
var mingw = "C:\\msys64\\mingw64";
var config = project.getConfig();
var myDir = project.getDirectory();
var d = myDir + "\\build\\" + config + "\\dist";
fs.mkdirSync(d, { recursive: true });
var name = "clu";
var dist = myDir + "\\" + name + "\\build\\" + config + "\\dist";
console.log("We are building " + name + "................");
rebuildSubProject(name);
system.zip(dist, d + "\\CLU-debug-" + version + ".zip");
child_process.execFileSync(mingw + "\\bin\\strip.exe", [dist + "\\clu.exe"]);
system.zip(dist, d + "\\CLU-" + version + ".zip");
var name = "npackd";
console.log("We are building " + name + "................");
rebuildSubProject(name);
var name = "npackdcl";
dist = myDir + "\\" + name + "\\build\\" + config + "\\dist";
console.log("We are building " + name + "................");
rebuildSubProject(name);
system.zip(dist,
d + "\\NpackdCL-debug-" + version + ".zip");
child_process.execFileSync(mingw + "\\bin\\strip.exe", [dist + "\\npackdcl.exe"]);
system.zip(dist, d + "\\NpackdCL-" + version + ".zip");
var name = "npackdcl_ftests";
console.log("We are building " + name + "................");
rebuildSubProject(name);
var name = "npackdcl_tests";
dist = myDir + "\\" + name + "\\build\\" + config + "\\dist";
console.log("We are building " + name + "................");
rebuildSubProject(name);
//child_process.execFileSync(dist + "\\npackdcl_tests.exe");
var name = "npackdg";
dist = myDir + "\\" + name + "\\build\\" + config + "\\dist";
console.log("We are building " + name + "................");
rebuildSubProject(name);
system.zip(dist, d + "\\Npackd-debug-" + version + ".zip");
child_process.execFileSync(mingw + "\\bin\\strip.exe", [dist + "\\npackdg.exe"]);
system.zip(dist, d + "\\Npackd-" + version + ".zip");
buildSubProjectTarget(name, "msi");
fs.mkdirSync(myDir + "\\" + name + "\\build\\" + config + "\\installer", { recursive: true });
fs.copyFileSync(myDir + "\\" + name + "\\build\\" + config + "\\installer\\npackdg.msi",
d + "\\Npackd.msi");
// TODO: exchndl.dll, mgwhelp.dll, dbghelp.dll, symsrv.dll, symsrv.yes, xxx.map
// TODO: release on Github
// TODO: Coverity
/*
rem Coverity build is too slow
set path=%mingw%\bin;%ai%\bin\x86;%sevenzip%;C:\msys64\mingw64\bin
set CMAKE_PREFIX_PATH=%mingw%\%mingw_libs%
mingw32-make.exe clean
"..\..\cov-analysis\bin\cov-configure.exe" --comptype gcc --compiler C:\PROGRA~2\MINGW-~1\bin\G__~1.EXE -- -std=gnu++11
"..\..\cov-analysis\bin\cov-build.exe" --dir ..\..\cov-int mingw32-make.exe install
rem type C:\projects\Npackd\cov-int\build-log.txt
7z a cov-int.zip cov-int
if %errorlevel% neq 0 exit /b %errorlevel%
"C:\Program Files (x86)\Gow\bin\curl" --form token=%covtoken% --form email=tim.lebedkov@gmail.com -k --form file=@cov-int.zip --form version="Version" --form description="Description" https://scan.coverity.com/builds?project=Npackd
if %errorlevel% neq 0 exit /b %errorlevel%
*/
}