forked from Marklogic-retired/marklogic-data-hub
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
64 lines (55 loc) · 1.9 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
allprojects {
task resolveAllDependencies {
doLast {
configurations.all {
if (it.isCanBeResolved()) {
it.resolve()
}
}
}
}
}
subprojects {
apply plugin: 'java'
sourceCompatibility = "1.8"
targetCompatibility = "1.8"
repositories {
mavenCentral()
mavenLocal()
}
dependencies {
testCompile group: 'org.junit.jupiter', name: 'junit-jupiter-api', version: '5.3.1'
testCompile 'org.apache.httpcomponents:httpclient:4.3.5'
}
test{
testLogging{
events 'started','passed', 'skipped', 'failed'
exceptionFormat 'full'
}
}
}
wrapper {
gradleVersion = '4.10'
}
//Task to update versions in files they are hardcoded. If version is hardcoded in any other files in the future,it has to be added to the list
//Usage : ./gradlew updateVersion -PsourceVersion=<source_version> -PtargetVersion=<target_version>
task updateVersion {
doLast {
def files = ["gradle.properties",
"marklogic-data-hub/gradle.properties",
"ml-data-hub-plugin/gradle.properties",
"quick-start/gradle.properties",
"marklogic-data-hub/src/main/resources/scaffolding/build_gradle",
"marklogic-data-hub/src/main/java/com/marklogic/hub/impl/HubConfigImpl.java"
]
String sourceVersion = project.hasProperty('sourceVersion') ? project.property('sourceVersion') : ""
String targetVersion = project.hasProperty('targetVersion') ? project.property('targetVersion') : ""
files.each {
def myFile = new File(it)
def fileText = myFile.getText('UTF-8')
myFile.withWriter('UTF-8') { writer ->
writer.write(fileText.replaceAll(sourceVersion, targetVersion))
}
}
}
}