-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathbuild.gradle
98 lines (76 loc) · 2.23 KB
/
build.gradle
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
apply plugin: "groovy"
ext.srcDir = "src"
ext.testDir = "src/test/unit"
ext.distDir = "build/dist"
ext.browsertestDir = "test/browsertest"
ext.webtestDir = "test/webtest"
ext.executableName = "foresee"
ext.buildDir = "build"
ext.providedReqs = ["java"]
ext.deployPaths = ["dev": "/opt/foresee-dev", "qa": "/opt/foresee-qa", "prod": "/opt/foresee"]
import org.apache.tools.ant.taskdefs.condition.Os
def getCommand(command) {
return Os.isFamily(Os.FAMILY_WINDOWS) ? command + ".cmd" : command
}
repositories {
mavenCentral()
}
dependencies {
def gebVersion = "0.9.0"
def seleniumVersion = "2.32.0"
testCompile "org.codehaus.groovy:groovy-all:2.0.5"
// If using JUnit, need to depend on geb-junit (3 or 4)
testCompile "junit:junit:4.11"
testCompile "org.gebish:geb-junit4:$gebVersion"
// Drivers
testCompile "org.seleniumhq.selenium:selenium-firefox-driver:$seleniumVersion"
}
/**** Unit Tests ****/
test {
dependsOn "unitTest", "webTest"
enabled = false
}
task unitTest(type:Exec) {
commandLine getCommand("jasmine-node"), "--verbose", testDir
}
task unitTestTeamCity(type:Exec) {
commandLine getCommand("jasmine-node"), "--teamcity", testDir
}
task webTest(type: Test) {
dependsOn "cleanTest"
include '**/WebTestSuite.class'
systemProperty "geb.build.reportsDir", reporting.file("geb")
systemProperty "geb.env", "firefox"
}
task deleteDist(type: Delete) {
delete distDir
}
task zip(type: Zip) {
dependsOn "deleteDist"
destinationDir = new File(distDir)
archiveName = "foresee-linux.zip"
from('src/') { into('foresee/src') }
from('assets/') { into('foresee/assets') }
from('node_modules/') { into('foresee/node_modules') }
from('views/') { into('foresee/views') }
from('public/') { into('foresee/public') }
from('app.js') { into('foresee/') }
from('build_res/node-exe/linux-x64/node') {
fileMode = 0755
into('foresee/')
}
from('build_res/script/linux/foresee') {
fileMode = 0755
into('foresee/')
}
}
/**** Dev ****/
task npmDependencies(type:Exec) {
commandLine 'npm', 'install'
}
task dev(type:Exec) {
commandLine getCommand("nodemon"), "--watch", srcDir, "-e", "js", "app.js"
}
task wrapper(type: Wrapper) {
gradleVersion = '1.6'
}