-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathProject.ps1
63 lines (50 loc) · 1.36 KB
/
Project.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
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
$project = "specdris.ipkg"
$testpkg = "test.ipkg"
function SpecDris-Clean {
echo "clean project"
idris --clean $project
cd test;
idris --clean $testpkg;
cd ..
}
function SpecDris-Test {
echo "test project"
cd test
idris --testpkg $testpkg
If ( $? ) { echo "SUCCESSFUL" }
Else { echo "FAILURE"; exit 1; }
cd ..
}
function SpecDris-BuildNoTest() {
echo "build project"
idris --build $project
}
function SpecDris-Build() {
SpecDris-BuildNoTest
SpecDris-Test
}
function SpecDris-Install() {
echo "install project"
SpecDris-Clean
SpecDris-Test
If ( $? ) { idris --install $project }
Else { echo "couldn't install project > something went wrong"; exit 1 }
}
function SpecDris-Help() {
echo "usage: 'Project.ps1 [command]'"
echo " --clean: cleans the project"
echo " --build: builds the code and runs all tests"
echo " --buildNoTest: builds the code only"
echo " --test: runs all tests"
echo " --install: installs the project"
echo " --help: prints the help"
}
switch ($args[0]) {
"--clean" { SpecDris-Clean }
"--build" { SpecDris-Build }
"--buildNoTest" { SpecDris-BuildNoTest }
"--test" { SpecDris-Test }
"--install" { SpecDris-Install }
"--help" { SpecDris-Help }
default { echo "unknown command"; SpecDris-Help }
}