-
Notifications
You must be signed in to change notification settings - Fork 23
/
build.gradle
74 lines (63 loc) · 2.54 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
plugins {
// to check for updates run: ./gradlew dependencyUpdates -Drevision=release
id 'com.github.ben-manes.versions' version '0.50.0'
}
ext.currentVersion = '0.9.3-SNAPSHOT'
ext.lastRelease = '0.9.2'
subprojects {
apply plugin: 'java'
apply plugin: 'java-library'
// java-library will force inter-project dependencies to use class files instead of jars
// This system property disables that and goes back to using jars
System.setProperty("org.gradle.java.compile-classpath-packaging", "true");
ext.publishScript = rootProject.rootDir.absolutePath + '/publish.gradle'
group = 'org.microshed'
version = currentVersion
sourceCompatibility = 11
targetCompatibility = 11
compileJava.options.encoding = 'UTF-8'
repositories {
mavenCentral()
}
javadoc {
exclude '**/internal/**'
}
test {
defaultCharacterEncoding = "UTF-8"
useJUnitPlatform()
testLogging {
displayGranularity 1
showStandardStreams = true
showStackTraces = true
exceptionFormat = 'full'
events 'PASSED', 'FAILED', 'SKIPPED'
}
}
}
task updateVersion {
doLast {
if (!project.hasProperty('nextVersion'))
throw GradleException("Must define '-PnextVersion=X.Y.Z' when running this task")
def isRelease = !nextVersion.endsWith('SNAPSHOT')
println 'Updating project version: ' + currentVersion + ' --> ' + nextVersion
ant.replaceregexp(match: '(["\'>])' + currentVersion + '(["\'<])',
replace: '\\1' + nextVersion + '\\2', flags: 'g', byline: true) {
fileset(dir: '.', includes: '**/*.gradle')
fileset(dir: '.', includes: '**/pom.xml')
}
if (isRelease) {
println 'Updating doc version: ' + lastRelease + ' --> ' + nextVersion
ant.replaceregexp(match: '(["\'>])' + lastRelease + '(["\'<])',
replace: '\\1' + nextVersion + '\\2', flags: 'g', byline: true) {
fileset(dir: '.', includes: '**/*.md')
fileset(dir: '.', includes: 'build.gradle')
}
} else {
// For non-release updates need to revert ext.lastRelease to a release version
ant.replaceregexp(match: "ext\\.lastRelease = '" + nextVersion + "'",
replace: "ext\\.lastRelease = '" + lastRelease + "'", flags: 'g', byline: true) {
fileset(dir: '.', includes: 'build.gradle')
}
}
}
}