-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
91 lines (77 loc) · 3.02 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
apply plugin: 'idea'
apply plugin: 'java'
apply plugin: 'war'
apply plugin: 'maven'
apply plugin: 'jetty'
repositories {
mavenRepo urls: ["http://maven.oschina.net/content/groups/public/"]
//mavenCentral();
}
dependencies {
spring_version = "3.0.5.RELEASE"
spring = ["org.springframework:spring-core:$spring_version",
"org.springframework:spring-expression:$spring_version",
"org.springframework:spring-beans:$spring_version",
"org.springframework:spring-aop:$spring_version",
"org.springframework:spring-context:$spring_version",
"org.springframework:spring-tx:$spring_version",
"org.springframework:spring-orm:$spring_version",
"org.springframework:spring-web:$spring_version",
"org.springframework:spring-asm:$spring_version",
"org.springframework:spring-jdbc:$spring_version",
"org.springframework:spring-webmvc:$spring_version",
"org.springframework:spring-test:$spring_version",
"aopalliance:aopalliance:1.0"]
joda = ["joda-time:joda-time:1.6.2"]
log4j = ["log4j:log4j:1.2.16"]
gson = ["com.google.code.gson:gson:1.7.1"]
apache = ["org.apache.velocity:velocity:1.7",
"org.apache.velocity:velocity-tools:2.0",
"commons-logging:commons-logging:1.1.1",
"commons-io:commons-io:2.0.1",
"commons-codec:commons-codec:1.5"]
ibatis = ["org.apache.ibatis:ibatis-sqlmap:2.3.4.726"]
junit = ["junit:junit:4.8.2", "org.mockito:mockito-all:1.8.5", "org.hamcrest:hamcrest-all:1.1"]
mysql = ["mysql:mysql-connector-java:5.1.27"]
velocity = ["org.apache.velocity:velocity:1.7",
"org.apache.velocity:velocity-tools:2.0"]
servlet = ["javax.servlet:servlet-api:2.5"]
compile spring, joda, log4j, junit, gson, ibatis, mysql, velocity, servlet
testCompile log4j, joda, junit, gson
}
war {
baseName = 'jstcool'
doFirst {
delete "build/resources/main/jstcool.properties"
delete "build/resources/main/log4j.properties"
delete "build/resources/main/velocity.properties"
copy { // backup the original
from 'deploy_config/jstcool.properties'
into "build/resources/main"
from 'deploy_config/log4j.properties'
into "build/resources/main"
from 'deploy_config/velocity.properties'
into "build/resources/main"
}
}
// doLast {
// if (file("build/web.xml").exists()) {
// copy {
// from "build/web.xml"
// into "src/main/webapp/WEB-INF/"
// }
// delete "build/web.xml"
// }
// }
}
tasks.withType(Compile) {
options.encoding = "UTF-8"
}
task createJavaProject << {
sourceSets*.java.srcDirs*.each { it.mkdirs() }
sourceSets*.resources.srcDirs*.each { it.mkdirs() }
}
task createWebProject(dependsOn: 'createJavaProject') << {
def webAppDir = file("$webAppDirName")
webAppDir.mkdirs()
}