-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathbuild.ps1
34 lines (22 loc) · 845 Bytes
/
build.ps1
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
$src = @( gi "license.txt" );
$testutil = @( gi "license.txt" );
$tests = @( gi "license.txt" );
switch -w (gci .\src *.js -rec) {
"*.tests.js" { $tests = $tests + $_ }
default { $src = $src + $_ }
}
switch -w (gci .\testutil *.js -rec) {
"*.tests.js" { $tests = $tests + $_ }
default { $testutil = $testutil + $_ }
}
,"Detected source files:" + $src + "" | write-host
,"Detected test utility code:" + $testutil + "" | write-host
,"Detected test files:" + $tests + "" | write-host
rm .\build -recurse
$null = mkdir .\build
function writeFilesTo($files, $target) {
$files | % { , ("// " + $_.name), @(get-content $_.fullname) } | set-content $target
}
writeFilesTo $src .\build\JsfIoc.js
writeFilesTo $testutil .\build\JsfIoc.testutil.js
writeFilesTo $tests .\build\JsfIoc.tests.js