-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.gradle
106 lines (77 loc) · 2.33 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
99
100
101
102
103
104
import java.text.SimpleDateFormat
plugins {
id 'com.palantir.git-version' version '0.8.0'
}
apply plugin: 'java'
apply plugin: 'war'
tasks.compileJava.dependsOn("precompile")
war {
def details = versionDetails()
details.lastTag
details.commitDistance
details.gitHash
details.branchName // is null if the repository in detached HEAD mode
details.isCleanTag
println 'LastTag: ' + details.lastTag
println 'CommitDistance ' + details.commitDistance
println 'GitHash ' + details.gitHash
println 'BranchName ' + details.branchName
println 'isCleanTag ' + details.isCleanTag
baseName = 'mediaDESK'
if (details.commitDistance == 0) {
//Version Build
println 'Configuring a RELEASE'
version = details.lastTag
} else {
//Nightly Build
println 'Configuring a Nightly Build'
version = '2018n' + getCurrentTimestamp()
}
manifest {
attributes("Implementation-Title": "mediaDESK",
"Implementation-Version": version)
}
doFirst {
println 'Building .war for Version ' + version
}
webInf { from 'src/additionalWebInf' } // adds a file-set to the WEB-INF dir.
exclude('WEB-INF/mediaDESK.conf')
exclude('WEB-INF/classes/log4j.properties')
exclude('WEB-INF/template/current/*')
exclude('WEB-INF/classes/com/*') //exclude class files from dev-generated
exclude('WEB-INF/classes/org/*') //exclude class files from dev-generated
exclude('WEB-INF/lib/*') //exclude class files from dev-generated
from('deployment') {
include 'log4j.properties'
into 'WEB-INF/classes'
}
}
task clear << {
}
task precompile {
doFirst {
println 'Before Compile'
}
}
task(devenv) {
doLast {
println "Create/Update the development environment"
//copy {
// from "web.xml"
// into "../resources/WEB-INF/"
//}
}
}
repositories {
mavenCentral()
}
dependencies {
compile fileTree(dir: 'src/main/webapp/WEB-INF/lib')
providedCompile files('deployment/libapi/servlet-api.jar','deployment/libapi/el-api.jar', 'deployment/libapi/jsp-api.jar')
}
def getCurrentTimestamp ()
{
Date today = new Date ()
SimpleDateFormat df = new SimpleDateFormat ("yyyyMMdd")
return df.format (today)
}