-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.ts
108 lines (95 loc) · 1.98 KB
/
index.ts
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
import { Build } from './build';
require('source-map-support').install();
const vcbin:string|undefined = process.env.vcbin;
export type PlatformName = 'x86'|'x64'|'js';
type PlatformNormalName = 'x86'|'x64'|'Emscripten';
type PlatformLongName = 'Win32'|'x64'|'Emscripten';
export interface Platform
{
name:PlatformNormalName;
lib:string;
shortName:PlatformName;
longName:PlatformLongName;
}
export interface Configuration
{
name:string;
postfix:string;
}
function makePlatform(args:{
name:PlatformNormalName, longName:PlatformLongName, shortName:PlatformName
}):Platform
{
const platform:Platform = <Platform>args;
if (!platform.lib) platform.lib = vcbin + '/' + platform.shortName + '/lib';
return platform;
}
export const Platform = {
x86:makePlatform({
name: 'x86',
longName: 'Win32',
shortName: 'x86',
}),
x64:makePlatform({
name: 'x64',
longName: 'x64',
shortName: 'x64',
}),
js:makePlatform({
name: 'Emscripten',
longName: 'Emscripten',
shortName: 'js',
}),
};
export interface Target
{
configurations?:Configuration[];
platforms?:PlatformName[];
platformBasedHeader?:boolean;
cleanIgnores?:string[];
name?:string;
libdir?:string;
static?:boolean;
noOwnGit?:boolean;
noOwnGitRemote?:boolean;
prebuild?:()=>Promise<void>|void;
postbuild?:()=>Promise<void>|void;
files:any[];
each:(config:Build)=>Promise<void>|void;
}
export interface Options
{
nobuild?:boolean;
x86Only?:boolean;
x64Only?:boolean;
jsOnly?:boolean;
ignoreNotFound?:boolean;
commitMessage?:string;
}
export function addext(list:any[], ext:string)
{
ext = '.' + ext;
for(var i=0;i<list.length;i++)
{
const comp = list[i];
if (comp instanceof Array)
{
addext(comp, ext);
}
else
{
list[i] = comp + ext;
}
}
}
export type BuildList = (string|[string]|[string[], string]|[string, string, (string|string[])?])[];
export const configuration:{[key:string]:Configuration} = {
debug:{
name: 'Debug',
postfix: 'd',
},
release:{
name: 'Release',
postfix: '',
},
};