-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
61 lines (51 loc) · 1.45 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
apply plugin: "java"
apply plugin: "war"
def tomcatHome = "D:\\Apache-Tomcat-64"
def homePath = System.properties['user.home']
repositories {
mavenCentral()
jcenter()
}
dependencies{
compile 'javax.servlet:javax.servlet-api:4.+'
compile 'org.json:json:20141113'
compile 'org.jsoup:jsoup:1.8.2'
}
sourceSets {
main {
java {
srcDir 'src/main/java'
}
resources {
srcDir 'src/main/resources'
srcDir 'src/main/java'
srcDir 'src/main/webapp'
}
}
}
task enableGradleDaemon<< {
def gradleDaemon = new File("${homePath}/.gradle/gradle.properties")
gradleDaemon.text = "org.gradle.daemon=true"
}
task deploylocal(dependsOn: build) << {
println "Copy from ${libsDir.getPath()} into ${tomcatHome}\\webapps"
copy{
from libsDir
into "${tomcatHome}\\webapps"
include '*.war'
}
}
task copyToRemote(type: Exec) {
if (System.getProperty('os.name').toLowerCase().contains('windows')) {
commandLine 'cmd', '/c', 'upload.bat'
standardOutput = new ByteArrayOutputStream()
ext.output = {
return standardOutput.toString()
}
} else {
commandLine 'curl','-k', '--upload-file','build\\libs\\KadseBot.war','https://admin:[email protected]/manager/text/deploy?path=/bot&update=true'
}
}
task deployRemote(dependsOn: build) << {
copyToRemote
}