-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
75 lines (64 loc) · 2.01 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
import java.text.SimpleDateFormat
def globalVersion = new Version(currentVersion)
allprojects {
apply plugin: 'idea'
configurations.all {
resolutionStrategy {
failOnVersionConflict()
force "org.springframework:spring-core:${springVersion}",
"org.springframework:spring-context:${springVersion}",
"org.springframework:spring-expression:${springVersion}",
"org.springframework:spring-beans:${springVersion}",
"org.springframework:spring-tx:${springVersion}",
"org.hamcrest:hamcrest-core:1.3",
'org.slf4j:slf4j-api:1.7.2',
'junit:junit:4.11',
'xml-apis:xml-apis:2.0.2'
}
}
group = 'com.u6f6o.apps.moviedb'
version = globalVersion
status = version.status
}
subprojects {
apply plugin: 'java'
apply plugin: 'groovy'
apply plugin: 'findbugs'
sourceCompatibility = 1.6
targetCompatibility = 1.6
repositories {
maven {
url "${artifactory_repositoryUrl}"
}
}
}
task wrapper(type: Wrapper) {
gradleVersion = '1.7'
distributionUrl = "${artifactory_repositoryUrl}/gradle-${gradleVersion}-bin.zip"
}
class Version {
String originalVersion
String thisVersion
String status
Date buildTime
Version(String versionValue) {
buildTime = new Date()
originalVersion = versionValue
if (originalVersion.endsWith('-SNAPSHOT')) {
status = 'integration'
thisVersion = originalVersion.substring(0, originalVersion.length() - 'SNAPSHOT'.length()) + getTimestamp()
} else {
status = 'release'
thisVersion = versionValue
}
}
String getTimestamp() {
// Convert local file timestamp to UTC
def format = new SimpleDateFormat('yyyyMMddHHmmss')
format.setCalendar(Calendar.getInstance(TimeZone.getTimeZone('UTC')));
return format.format(buildTime)
}
String toString() {
thisVersion
}
}