-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathbuild.gradle
103 lines (79 loc) · 2.39 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
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.1'
}
}
plugins {
id 'groovy'
}
version = new Version(version as String)
apply from: "gradle/ide.gradle"
apply from: "gradle/bintray.gradle"
repositories {
jcenter()
// Adobe-specific artifacts
maven {
url "http://repo.adobe.com/nexus/content/groups/public"
}
}
sourceCompatibility = '1.7'
targetCompatibility = '1.7'
dependencies {
// AEM's new "uber-jar"
compile "com.adobe.aem:aem-api:6.0.0.1", {
exclude group: "org.slf4j", module: "slf4j-simple"
exclude group: "com.adobe.cq.testing", module: "cq-integration-testing"
}
compile "javax.jcr:jcr:2.0"
compile "com.google.guava:guava:15.0"
compile "org.apache.sling:org.apache.sling.jcr.resource:2.3.8"
compile "org.slf4j:slf4j-api:1.6.6"
compile "javax.servlet:servlet-api:2.5"
compile "commons-io:commons-io:2.4"
// @Nonnull @Nullable etc annotations
compile "com.google.code.findbugs:jsr305:2.0.1"
runtime "ch.qos.logback:logback-classic:1.0.4"
testCompile "org.codehaus.groovy:groovy:2.3.6"
testCompile "org.spockframework:spock-core:0.7-groovy-2.0", {
exclude group: 'org.codehaus.groovy', module: 'groovy-all'
}
}
// **************************************************************************
//
// VERSION CLASS
//
// **************************************************************************
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 - 'SNAPSHOT' + getTimestamp()
}
else {
status = 'release'
thisVersion = versionValue
}
}
@SuppressWarnings("UnnecessaryQualifiedReference")
String getTimestamp() {
// Convert local file timestamp to UTC
def format = new java.text.SimpleDateFormat('yyyyMMddHHmmss')
format.setCalendar(Calendar.getInstance(TimeZone.getTimeZone('UTC')));
return format.format(buildTime)
}
String toString() {
originalVersion
}
String getBintrayVersion() {
thisVersion
}
}