-
Notifications
You must be signed in to change notification settings - Fork 2
/
build.gradle
116 lines (96 loc) · 2.95 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
105
106
107
108
109
110
111
112
113
114
115
116
buildscript {
repositories {
jcenter()
maven { url 'http://repo.spring.io/plugins-release' }
}
dependencies {
classpath 'org.springframework.build.gradle:propdeps-plugin:0.0.7'
classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.1'
}
}
apply plugin: 'groovy'
apply plugin: 'propdeps'
apply plugin: 'propdeps-idea'
apply plugin: 'maven'
version = "2.0.1-SNAPSHOT"
group = "be.insaneprogramming.springboot"
sourceCompatibility = 1.7
compileJava.options.encoding = 'UTF-8'
def globalVersion = new Version(version)
repositories {
jcenter()
maven {
url "https://repository.jboss.org/nexus/content/repositories/thirdparty-releases"
}
}
dependencies {
compile "org.springframework.boot:spring-boot-starter-jdbc:2.0.0.RELEASE"
compile 'net.sf.ha-jdbc:ha-jdbc:3.0.3'
optional "org.springframework.boot:spring-boot-configuration-processor:2.0.0.RELEASE"
testCompile "junit:junit:4.11"
testCompile "org.spockframework:spock-core:0.7-groovy-2.0"
testCompile "org.codehaus.groovy:groovy-all:2.4.3"
testCompile "org.springframework.boot:spring-boot-test:2.0.0.RELEASE"
testCompile 'org.hsqldb:hsqldb:2.3.2'
}
jar {
enabled = !sourceSets.main.allSource.empty
manifest.attributes["Created-By"] =
"${System.getProperty("java.version")} (${System.getProperty("java.specification.vendor")})"
manifest.attributes["Implementation-Title"] = project.name
manifest.attributes["Implementation-Version"] = project.version
}
task sourcesJar(type: Jar, dependsOn: classes) {
enabled = !sourceSets.main.allSource.empty
classifier = "sources"
from sourceSets.main.allJava.srcDirs
include "**/*.java"
}
artifacts {
archives sourcesJar
}
compileJava.dependsOn(processResources)
task wrapper(type: Wrapper) {
gradleVersion = '2.4'
}
apply plugin: 'com.jfrog.bintray'
apply plugin: "maven"
bintray {
user = ''
key = ''
configurations = ['archives']
pkg {
repo = 'maven'
name = 'hajdbc-spring-boot'
version {
name = globalVersion
vcsTag = globalVersion
}
}
}
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 java.text.SimpleDateFormat('yyyyMMddHHmmss')
format.setCalendar(Calendar.getInstance(TimeZone.getTimeZone('UTC')));
return format.format(buildTime)
}
String toString() {
thisVersion
}
}