forked from bmuschko/gradle-tomcat-plugin
/
build.gradle
54 lines (43 loc) · 1.41 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
apply plugin: 'groovy'
apply plugin: 'idea'
sourceCompatibility = 1.5
targetCompatibility = 1.5
version = '0.4'
ant.property(environment: 'env')
if(!ant.properties['env.GRADLE_HOME']) {
throw new Exception('Please set $GRADLE_HOME')
}
def gradleHomeDir = System.getenv().get('GRADLE_HOME')
repositories {
mavenCentral()
}
dependencies {
def tomcatVersion = '6.0.29'
groovy 'org.codehaus.groovy:groovy:1.7.5'
compile gradleApi()
compile "org.apache.tomcat:catalina:${tomcatVersion}",
"org.apache.tomcat:coyote:${tomcatVersion}",
"org.apache.tomcat:jasper:${tomcatVersion}"
testCompile "junit:junit:4.+"
}
jar {
manifest {
attributes 'Implementation-Title': 'Gradle Tomcat plugin',
'Implementation-Version': version,
'Built-By': System.getProperty("user.name"),
'Built-Date': new Date(),
'Built-JDK': System.getProperty("java.version")
}
}
ideaProject {
javaVersion = '1.6'
withXml { provider ->
def node = provider.asNode()
// Use GIT
def vcsConfig = node.component.find { it.'@name' == 'VcsDirectoryMappings' }
vcsConfig.mapping[0].'@vcs' = 'Git'
// Set Gradle home
def gradleSettings = node.appendNode('component', [name: 'GradleSettings'])
gradleSettings.appendNode('option', [name: 'SDK_HOME', value: gradleHomeDir])
}
}