-
Notifications
You must be signed in to change notification settings - Fork 124
/
build.gradle
80 lines (72 loc) · 3.21 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
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"
}
subprojects {
// While subprojects may need to use java-library plugin, applying this at the top level allows for
// sourceCompatibility/targetCompatibility to be set at this level as well
apply plugin: 'java'
apply plugin: 'jacoco'
sourceCompatibility = "8"
targetCompatibility = "8"
repositories {
mavenCentral()
mavenLocal()
maven {url "https://developer.marklogic.com/maven2/"}
// This has to be configured here as Gradle 7 defaults to requiring https for accessing a repository.
// allowInsecureProtocol is used to override this, but it cannot be used by the gradle-node-plugin
// in the ./marklogic-data-hub and ./marklogic-data-hub-central projects. So we have to specify this
// repository here so we can make use of allowInsecureProtocol.
maven {
url nodeDistributionBaseUrl;
allowInsecureProtocol = true
}
}
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/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",
"marklogic-data-hub-central/ui/e2e/hc-qa-project/build.gradle",
"marklogic-data-hub-central/src/main/resources/application.properties",
"examples/README.md",
"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/reference-entity-model/build.gradle",
"examples/smart-mastering-complete/build.gradle",
"examples/snapshot-testing/build.gradle",
"examples/step-interceptors/build.gradle",
"examples/SLED/build.gradle",
"performance-tests/projects/commoncrawl/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))
}
}
}
}