-
Notifications
You must be signed in to change notification settings - Fork 136
/
build.gradle
117 lines (97 loc) · 3.8 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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
import org.opensearch.gradle.VersionProperties
/*
* Copyright OpenSearch Contributors
* SPDX-License-Identifier: Apache-2.0
*/
buildscript {
apply from: 'build-tools/repositories.gradle'
ext {
opensearch_group = "org.opensearch"
isSnapshot = "true" == System.getProperty("build.snapshot", "true")
opensearch_version = System.getProperty("opensearch.version", "3.0.0-SNAPSHOT")
buildVersionQualifier = System.getProperty("build.version_qualifier", "")
asm_version = "9.7"
// 2.0.0-rc1-SNAPSHOT -> 2.0.0.0-rc1-SNAPSHOT
version_tokens = opensearch_version.tokenize('-')
opensearch_build = version_tokens[0] + '.0'
if (buildVersionQualifier) {
opensearch_build += "-${buildVersionQualifier}"
}
if (isSnapshot) {
opensearch_build += "-SNAPSHOT"
}
common_utils_version = System.getProperty("common_utils.version", opensearch_build)
kotlin_version = System.getProperty("kotlin.version", "1.9.23")
}
repositories {
mavenLocal()
maven { url "https://aws.oss.sonatype.org/content/repositories/snapshots" }
mavenCentral()
maven { url "https://plugins.gradle.org/m2/" }
maven { url "https://ci.opensearch.org/ci/dbc/snapshots/lucene/" }
}
dependencies {
classpath "${opensearch_group}.gradle:build-tools:${opensearch_version}"
classpath "gradle.plugin.com.dorongold.plugins:task-tree:1.5"
configurations.all {
resolutionStrategy {
force("org.eclipse.platform:org.eclipse.core.runtime:3.29.0") // for spotless transitive dependency CVE (for 3.26.100)
}
}
}
configurations {
classpath {
resolutionStrategy {
//in order to handle jackson's higher release version in shadow, this needs to be upgraded to latest
force(group: "org.ow2.asm", name: "asm", version: asm_version)
force(group: "org.ow2.asm", name: "asm-commons", version: asm_version)
}
}
}
}
plugins {
id 'com.netflix.nebula.ospackage' version "11.5.0"
id 'java'
id "io.freefair.lombok" version "8.4"
id 'jacoco'
}
apply plugin: "com.dorongold.task-tree"
allprojects {
group = 'org.opensearch'
version = opensearch_build
apply from: "$rootDir/build-tools/repositories.gradle"
plugins.withId('java') {
sourceCompatibility = JavaVersion.VERSION_21;
targetCompatibility = JavaVersion.VERSION_21;
}
plugins.withId('jacoco') {
jacoco.toolVersion = '0.8.10'
}
project.getExtensions().getExtraProperties().set("versions", VersionProperties.getVersions());
}
subprojects {
configurations {
testImplementation.extendsFrom compileOnly
}
configurations.all {
// Force spotless depending on newer version of guava due to CVE-2023-2976. Remove after spotless upgrades.
resolutionStrategy.force "com.google.guava:guava:32.1.2-jre"
resolutionStrategy.force 'org.apache.commons:commons-compress:1.26.0'
}
}
ext {
projectSubstitutions = [:]
licenseFile = rootProject.file('LICENSE.txt')
noticeFile = rootProject.file('NOTICE.txt')
}
// updateVersion: Task to auto increment to the next development iteration
task updateVersion {
onlyIf { System.getProperty('newVersion') }
doLast {
ext.newVersion = System.getProperty('newVersion')
println "Setting version to ${newVersion}."
// String tokenization to support -SNAPSHOT
// Include the required files that needs to be updated with new Version
ant.replaceregexp(file:'build.gradle', match: '"opensearch.version", "\\d.*"', replace: '"opensearch.version", "' + newVersion.tokenize('-')[0] + '-SNAPSHOT"', flags:'g', byline:true)
}
}