-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
178 lines (147 loc) · 5.28 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
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
import org.opensearch.gradle.test.RestIntegTestTask
import org.opensearch.gradle.info.BuildParams
apply plugin: 'java'
apply plugin: 'idea'
apply plugin: 'opensearch.opensearchplugin'
apply plugin: 'opensearch.yaml-rest-test'
apply plugin: 'opensearch.pluginzip'
def pluginName = 'eliatra-cloud-lock'
def pluginDescription = 'Eliatra Cloud Lock: Encryption at Rest for OpenSearch'
def projectPath = 'com.eliatra'
def pathToPlugin = 'cloud.lock.plugin'
def pluginClassName = 'EliatraCloudLockPlugin'
licenseHeaders.enabled = false
forbiddenApisMain.enabled = false
forbiddenApisTest.enabled = false
dependencyLicenses.enabled = false
thirdPartyAudit.enabled = false
publishing {
publications {
pluginZip(MavenPublication) { publication ->
pom {
name = pluginName
description = pluginDescription
licenses {
license {
name = "Commercial"
url = "https://eliatra.com"
}
}
developers {
developer {
name = "Eliatra"
url = "https://eliatra.com"
}
}
}
}
}
}
opensearchplugin {
name pluginName
description pluginDescription
classname "${projectPath}.${pathToPlugin}.${pluginClassName}"
licenseFile rootProject.file('LICENSE.txt')
noticeFile rootProject.file('NOTICE.txt')
}
// This requires an additional Jar not published as part of build-tools
loggerUsageCheck.enabled = false
// No need to validate pom, as we do not upload to maven/sonatype
validateNebulaPom.enabled = false
buildscript {
ext {
opensearch_version = System.getProperty("opensearch.version", "2.11.1")
buildVersionQualifier = System.getProperty("build.version_qualifier", "")
version_tokens = opensearch_version.tokenize('-')
opensearch_build = version_tokens[0] + '.0'
if (buildVersionQualifier) {
opensearch_build += "-${buildVersionQualifier}"
}
targetCompatibility = JavaVersion.VERSION_11
sourceCompatibility = JavaVersion.VERSION_11
}
repositories {
mavenLocal()
maven { url "https://aws.oss.sonatype.org/content/repositories/snapshots" }
mavenCentral()
maven { url "https://plugins.gradle.org/m2/" }
}
dependencies {
classpath "org.opensearch.gradle:build-tools:${opensearch_version}"
}
}
allprojects {
group = "com.eliatra"
version = opensearch_build
}
repositories {
mavenLocal()
maven { url "https://aws.oss.sonatype.org/content/repositories/snapshots" }
maven {
url "https://maven.search-guard.com/util"
metadataSources {
artifact() //Look directly for artifact
}
}
mavenCentral()
maven { url "https://plugins.gradle.org/m2/" }
}
test {
include '**/*Tests.class'
}
task integTest(type: RestIntegTestTask) {
description = "Run tests against a cluster"
testClassesDirs = sourceSets.test.output.classesDirs
classpath = sourceSets.test.runtimeClasspath
}
tasks.named("check").configure { dependsOn(integTest) }
integTest {
// The --debug-jvm command-line option makes the cluster debuggable; this makes the tests debuggable
if (System.getProperty("test.debug") != null) {
jvmArgs '-agentlib:jdwp=transport=dt_socket,server=y,suspend=y,address=*:5005'
}
}
testClusters.integTest {
testDistribution = "INTEG_TEST"
// This installs our plugin into the testClusters
plugin(project.tasks.bundlePlugin.archiveFile)
}
run {
useCluster testClusters.integTest
}
// updateVersion: Task to auto update version 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
ant.replaceregexp(file:'build.gradle', match: '"opensearch.version", "\\d.*"', replace: '"opensearch.version", "' + newVersion.tokenize('-')[0] + '-SNAPSHOT"', flags:'g', byline:true)
}
}
dependencies {
implementation 'com.google.crypto.tink:tink:1.13.0'
implementation 'com.floragunn:codova:1.8.0'
implementation 'com.floragunn:fluent-collections:1.0.1'
implementation 'com.google.guava:guava:33.1.0-jre'
implementation 'com.google.guava:failureaccess:1.0.2'
implementation 'org.bouncycastle:bcprov-jdk18on:1.78.1'
implementation 'org.cryptacular:cryptacular:1.2.6'
}
bundlePlugin {
from('plugin-security.policy')
}
tasks.withType(Test) {
jvmArgs('--add-opens=java.base/java.io=ALL-UNNAMED')
jvmArgs('--add-opens=java.base/java.util.concurrent=ALL-UNNAMED')
jvmArgs('--add-opens=java.base/java.time=ALL-UNNAMED')
jvmArgs('--add-opens=java.base/java.util.stream=ALL-UNNAMED')
jvmArgs('--add-opens=java.base/sun.nio.fs=ALL-UNNAMED')
jvmArgs('--add-opens=java.base/java.nio.file=ALL-UNNAMED')
jvmArgs('--add-opens=java.base/java.lang=ALL-UNNAMED')
jvmArgs('--add-opens=java.base/java.util=ALL-UNNAMED')
if (JavaVersion.current().compareTo(JavaVersion.VERSION_17) > 0) {
jvmArgs += ["-Djava.security.manager=allow"]
}
}
//check.dependsOn spotlessCheck