-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
62 lines (54 loc) · 1.65 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
import org.apache.tools.ant.filters.ReplaceTokens
apply plugin: 'java'
apply plugin: 'war'
//sourceCompatibility = 1.6
version = "1." + getDate()
env = System.getenv()
dependencies {
compile fileTree(dir: 'web/WEB-INF/lib', includes: ['*.jar'])
runtime fileTree(dir: 'web/WEB-INF/lib', includes: ['*.jar'])
}
jar {
def manifestClasspath = configurations.runtime.collect { 'lib/'+it.getName() }.join(' ')
manifest {
attributes(
'Implementation-Title': 'Aprohirdetes.com',
'Implementation-Version': version,
'Main-Class': 'com.aprohirdetes.server.AproComponent',
'Class-Path': manifestClasspath
)
}
from {
configurations.compile.collect { it.isDirectory() ? it : zipTree(it) }
}
}
war {
webInf {
from ("web/WEB-INF") {
include 'apro.properties'
filter(ReplaceTokens, tokens: ['version': project.version])
}
}
from 'web'
from('src/main/java/com/aprohirdetes/server/templates') {
include '*.html' into('WEB-INF/classes/com/aprohirdetes/server/templates')
include '*.ftl' into('WEB-INF/classes/com/aprohirdetes/server/templates')
}
archiveName 'aprocom-server.war'
manifest {
attributes(
'Implementation-Title': 'Aprohirdetes.com',
'Implementation-Version': version,
)
}
}
def getDate() {
def date = new Date()
def formattedDate = date.format('yyMMddHHmm')
return formattedDate
}
ant.propertyfile(file:"src/main/resources/package.properties", comment:'Build Properties') {
ant.entry(key:'version',value:version)
ant.entry(key:'buildTag',value:env.BUILD_TAG)
ant.entry(key:'buildTime', value:env.BUILD_ID)
}