-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.gradle
84 lines (67 loc) · 2.44 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
plugins {
// Call task "shadowJar" to create fat JAR
id 'com.github.johnrengelman.shadow' version '5.0.0'
id 'java'
}
group = 'de.greencity.bladenightapp'
version = '0.6-SNAPSHOT'
description = """Bladenight server"""
compileJava {
sourceCompatibility = '1.8'
targetCompatibility = '1.8'
}
tasks.withType(JavaCompile) {
options.encoding = 'UTF-8'
}
repositories {
maven { url "https://maven.geotoolkit.org/" }
maven { url "https://repo.maven.apache.org/maven2" }
google()
}
dependencies {
implementation group: 'org.eclipse.jetty', name: 'jetty-websocket', version:'8.1.18.v20150929'
implementation group: 'org.eclipse.jetty', name: 'jetty-server', version:'8.1.18.v20150929'
implementation group: 'commons-io', name: 'commons-io', version:'2.11.0'
implementation group: 'com.google.code.gson', name: 'gson', version:'2.2.2'
implementation group: 'commons-logging', name: 'commons-logging', version:'1.1.1'
implementation group: 'joda-time', name: 'joda-time', version:'2.1'
implementation group: 'org.java-websocket', name: 'Java-WebSocket', version:'1.3.0'
testImplementation group: 'junit', name: 'junit', version: '4.13.2'
implementation project(':bladenightapp-common')
implementation project(':wampoc')
}
jar {
manifest {
attributes 'Main-Class': 'de.greencity.bladenightapp.server.App'
}
}
task doRelease {
doLast {
def buildGradle = new File("build.gradle")
def matcher = (buildGradle.text =~ /version = '([\d]+)\.([\d]+)-SNAPSHOT'/)
def major = Integer.parseInt(matcher[0][1])
def minor = Integer.parseInt(matcher[0][2])
def oldVersion = "${major}.${minor}"
def newVersion = "${major}.${minor+1}"
ant.replace(file: buildGradle, token: "version = '${oldVersion}-SNAPSHOT'", value: "version = '${oldVersion}'")
exec {
commandLine "git", "commit", "-a", "-m", "v${oldVersion}"
}
exec {
commandLine "git", "tag", "v${oldVersion}"
}
exec {
commandLine "./gradlew", "shadowJar"
}
ant.replace(file: buildGradle, token: "version = '${oldVersion}'", value: "version = '${newVersion}-SNAPSHOT'")
exec {
commandLine "git", "commit", "-a", "-m", "Started v${newVersion}"
}
exec {
commandLine "git", "push"
}
exec {
commandLine "git", "push", "--tags"
}
}
}