forked from carlos-technogi/rdeb-client-java
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.gradle
More file actions
57 lines (44 loc) · 1.39 KB
/
build.gradle
File metadata and controls
57 lines (44 loc) · 1.39 KB
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
group 'com.technogi'
version '0.3.1'
buildscript {
repositories {
maven {
url "https://plugins.gradle.org/m2/"
}
}
dependencies {
classpath "gradle.plugin.com.zoltu.gradle.plugin:git-versioning:3.0.3"
}
}
apply plugin: 'java'
//apply plugin: "com.zoltu.git-versioning"
sourceCompatibility = 1.8
repositories {
mavenCentral()
}
dependencies {
compile 'org.apache.logging.log4j:log4j-api:2.8.2'
compile 'org.apache.logging.log4j:log4j-core:2.8.2'
compile 'com.fasterxml.jackson.core:jackson-core:2.9.0'
compile 'com.fasterxml.jackson.core:jackson-databind:2.9.0'
testCompile 'junit:junit:4.12'
}
task('increment') {
doLast {
def v = buildFile.getText().find(version as CharSequence) //get this build file's text and extract the version value
def minor = v.substring(v.lastIndexOf('.') + 1)
int m = 1 + minor.toInteger()
def major = v.substring(0, v.length() - minor.size())
String s = buildFile.getText().replaceFirst("version = '$version'", "version = '" + major + m + "'")
buildFile.setText(s)
}
}
task release(type: Exec) {
//commandLine = "git add --all"
commandLine = ['sh', '-c', "git add --all && git commit -am ${version} && git tag -a '${version}' -m 'Version $version'"]
//ext.output = {
// println(standardOutput.toString())
// return standardOutput.toString()
//}
}
release.dependsOn('clean','increment', 'build')