forked from Marklogic-retired/marklogic-data-hub
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
74 lines (69 loc) · 2.48 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 {
// Declaring this at root level so it's available for every subproject without declaring a version
id "net.saliman.properties" version "1.5.1"
}
allprojects {
task resolveAllDependencies {
doLast {
configurations.all {
if (it.isCanBeResolved()) {
it.resolve()
}
}
}
}
}
subprojects {
apply plugin: 'java'
apply plugin: 'jacoco'
sourceCompatibility = "8"
targetCompatibility = "8"
repositories {
mavenCentral()
mavenLocal()
}
tasks.withType(Test){
ignoreFailures = true
testLogging{
events 'started','passed', 'skipped', 'failed'
exceptionFormat 'full'
}
}
jacocoTestReport {
reports {
xml.enabled true
}
}
}
//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",
"web/gradle.properties",
"marklogic-data-hub-central/gradle.properties",
"marklogic-data-hub/src/main/resources/scaffolding/build_gradle",
"marklogic-data-hub/src/main/java/com/marklogic/hub/impl/VersionInfo.java",
"marklogic-data-hub/src/main/resources/hub-internal-config/security/roles/data-hub-admin.json",
"examples/dh-5-example/build.gradle",
"examples/dhf5-custom-hook/build.gradle",
"examples/insurance/build.gradle",
"examples/mapping-example/build.gradle",
"examples/patient-hub/build.gradle",
"examples/smart-mastering-complete/build.gradle",
"examples/snapshot-testing/build.gradle"
]
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))
}
}
}
}