Skip to content

Commit 97ebe37

Browse files
committed
cleaning up build.gradle
1 parent 9130713 commit 97ebe37

File tree

2 files changed

+117
-65
lines changed

2 files changed

+117
-65
lines changed

alerting/build.gradle

Lines changed: 3 additions & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -21,24 +21,6 @@ import org.opensearch.gradle.test.RestIntegTestTask
2121
import org.opensearch.gradle.testclusters.OpenSearchCluster
2222
import org.opensearch.gradle.testclusters.StandaloneRestIntegTestTask
2323

24-
buildscript {
25-
ext {
26-
opensearch_group = "org.opensearch"
27-
opensearch_version = System.getProperty("opensearch.version", "3.1.0-SNAPSHOT")
28-
isSnapshot = "true" == System.getProperty("build.snapshot", "true")
29-
buildVersionQualifier = System.getProperty("build.version_qualifier", "")
30-
kotlin_version = System.getProperty("kotlin.version", "1.9.25")
31-
version_tokens = opensearch_version.tokenize('-')
32-
opensearch_build = version_tokens[0] + '.0'
33-
if (buildVersionQualifier) {
34-
opensearch_build += "-${buildVersionQualifier}"
35-
}
36-
if (isSnapshot) {
37-
opensearch_build += "-SNAPSHOT"
38-
}
39-
}
40-
}
41-
4224
apply plugin: 'java'
4325
apply plugin: 'idea'
4426
apply plugin: 'org.jetbrains.kotlin.jvm'
@@ -99,7 +81,6 @@ publishing {
9981
}
10082

10183
repositories {
102-
mavenLocal()
10384
maven {
10485
name = "Snapshots"
10586
url = "https://aws.oss.sonatype.org/content/repositories/snapshots"
@@ -165,18 +146,6 @@ def bwcVersion = bwcVersionShort + ".0"
165146
def bwcOpenSearchVersion = bwcVersionShort + "-SNAPSHOT"
166147
def bwcPluginVersion = bwcVersion + "-SNAPSHOT"
167148

168-
def sqlJarDirectory = "$buildDir/dependencies/opensearch-sql-plugin"
169-
170-
task addJarsToClasspath(type: Copy) {
171-
from(fileTree(dir: sqlJarDirectory)) {
172-
include "opensearch-sql-${opensearch_build}.jar"
173-
include "ppl-${opensearch_build}.jar"
174-
include "protocol-${opensearch_build}.jar"
175-
include "core-${opensearch_build}.jar"
176-
}
177-
into("$buildDir/classes")
178-
}
179-
180149
dependencies {
181150
// Needed for integ tests
182151
zipArchive group: 'org.opensearch.plugin', name:'opensearch-notifications-core', version: "${opensearch_build}"
@@ -200,10 +169,8 @@ dependencies {
200169

201170
// SQL/PPL plugin dependencies
202171
implementation 'org.json:json:20240303'
203-
// implementation fileTree(dir: sqlJarDirectory, include: ["opensearch-sql-thin-${opensearch_build}.jar", "ppl-${opensearch_build}.jar", "protocol-${opensearch_build}.jar", "core-${opensearch_build}.jar"])
204-
// zipArchive group: 'org.opensearch.plugin', name:'opensearch-sql-plugin', version: "${opensearch_build}"
205-
206172
api project(":alerting-core")
173+
207174
implementation "com.github.seancfoley:ipaddress:5.4.1"
208175
implementation project(path: ":alerting-spi", configuration: 'shadow')
209176

@@ -216,29 +183,6 @@ dependencies {
216183
testImplementation "org.opensearch.plugin:lang-mustache-client:${opensearch_version}"
217184
}
218185

219-
task extractSqlJar(type: Copy) {
220-
mustRunAfter()
221-
from(zipTree(configurations.zipArchive.find { it.name.startsWith("opensearch-sql-plugin") }))
222-
into sqlJarDirectory
223-
}
224-
225-
task extractSqlClass(type: Copy, dependsOn: [extractSqlJar]) {
226-
from zipTree("${sqlJarDirectory}/opensearch-sql-${opensearch_build}.jar")
227-
into("$buildDir/opensearch-sql")
228-
include 'org/opensearch/sql/**'
229-
}
230-
231-
task replaceSqlJar(type: Jar, dependsOn: [extractSqlClass]) {
232-
from("$buildDir/opensearch-sql")
233-
archiveFileName = "opensearch-sql-thin-${opensearch_build}.jar"
234-
destinationDirectory = file(sqlJarDirectory)
235-
doLast {
236-
file("${sqlJarDirectory}/opensearch-sql-${opensearch_build}.jar").delete()
237-
}
238-
}
239-
240-
tasks.addJarsToClasspath.dependsOn(replaceSqlJar)
241-
242186
javadoc.enabled = false // turn off javadoc as it barfs on Kotlin code
243187
licenseHeaders.enabled = true
244188
dependencyLicenses.enabled = false
@@ -570,6 +514,8 @@ task bwcTestSuite(type: StandaloneRestIntegTestTask) {
570514

571515
run {
572516
doFirst {
517+
dependsOn addJarsToClasspath
518+
573519
// There seems to be an issue when running multi node run or integ tasks with unicast_hosts
574520
// not being written, the waitForAllConditions ensures it's written
575521
getClusters().forEach { cluster ->
@@ -714,11 +660,3 @@ def waitForClusterSetup(OpenSearchCluster cluster, Boolean securityEnabled) {
714660
}
715661

716662
apply from: '../build-tools/pkgbuild.gradle'
717-
718-
//compileJava {
719-
// dependsOn addJarsToClasspath
720-
//}
721-
//
722-
//compileKotlin {
723-
// dependsOn addJarsToClasspath
724-
//}
Lines changed: 114 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,114 @@
1+
{
2+
"dynamic": "strict",
3+
"_routing": {
4+
"required": true
5+
},
6+
"_meta" : {
7+
"schema_version": 5
8+
},
9+
"properties": {
10+
"schema_version": {
11+
"type": "integer"
12+
},
13+
"monitor_id": {
14+
"type": "keyword"
15+
},
16+
"monitor_version": {
17+
"type": "long"
18+
},
19+
"id": {
20+
"type": "keyword"
21+
},
22+
"version": {
23+
"type": "long"
24+
},
25+
"severity": {
26+
"type": "keyword"
27+
},
28+
"monitor_name": {
29+
"type": "text",
30+
"fields": {
31+
"keyword": {
32+
"type": "keyword",
33+
"ignore_above": 256
34+
}
35+
}
36+
},
37+
"monitor_user": {
38+
"properties": {
39+
"name": {
40+
"type": "text",
41+
"fields": {
42+
"keyword": {
43+
"type": "keyword",
44+
"ignore_above": 256
45+
}
46+
}
47+
},
48+
"backend_roles": {
49+
"type" : "text",
50+
"fields" : {
51+
"keyword" : {
52+
"type" : "keyword"
53+
}
54+
}
55+
},
56+
"roles": {
57+
"type" : "text",
58+
"fields" : {
59+
"keyword" : {
60+
"type" : "keyword"
61+
}
62+
}
63+
},
64+
"custom_attribute_names": {
65+
"type" : "text",
66+
"fields" : {
67+
"keyword" : {
68+
"type" : "keyword"
69+
}
70+
}
71+
}
72+
}
73+
},
74+
"execution_id": {
75+
"type": "keyword"
76+
},
77+
"trigger_id": {
78+
"type": "keyword"
79+
},
80+
"trigger_name": {
81+
"type": "text",
82+
"fields": {
83+
"keyword": {
84+
"type": "keyword",
85+
"ignore_above": 256
86+
}
87+
}
88+
},
89+
"triggered_time": {
90+
"type": "date"
91+
},
92+
"expiration_time": {
93+
"type": "date"
94+
},
95+
"error_message": {
96+
"type": "text"
97+
},
98+
"query_results": {
99+
"type": "nested",
100+
"properties": {
101+
"schema": {
102+
"type": "nested",
103+
"dynamic": true
104+
},
105+
"datarows": {
106+
"type": "text"
107+
},
108+
"total": {
109+
"type": "integer"
110+
}
111+
}
112+
}
113+
}
114+
}

0 commit comments

Comments
 (0)