forked from opensearch-project/job-scheduler
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
151 lines (126 loc) · 4 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
/*
* Copyright OpenSearch Contributors
* SPDX-License-Identifier: Apache-2.0
*/
buildscript {
ext {
opensearch_version = System.getProperty("opensearch.version", "1.3.0-SNAPSHOT")
}
repositories {
mavenLocal()
mavenCentral()
maven { url "https://aws.oss.sonatype.org/content/repositories/snapshots" }
}
dependencies {
classpath "org.opensearch.gradle:build-tools:${opensearch_version}"
}
}
plugins {
id 'nebula.ospackage' version "8.3.0"
id 'java-library'
}
apply plugin: 'opensearch.opensearchplugin'
apply plugin: 'opensearch.testclusters'
apply plugin: 'opensearch.java-rest-test'
ext {
projectSubstitutions = [:]
licenseFile = rootProject.file('LICENSE.txt')
noticeFile = rootProject.file('NOTICE')
}
licenseHeaders.enabled = true
testingConventions.enabled = false
forbiddenApis.ignoreFailures = false
dependencyLicenses.enabled = false
thirdPartyAudit.enabled = false
forbiddenApisTest.ignoreFailures = true
validateNebulaPom.enabled = false
loggerUsageCheck.enabled = false
opensearchplugin {
name 'opensearch-job-scheduler'
description 'OpenSearch Job Scheduler plugin'
classname 'org.opensearch.jobscheduler.JobSchedulerPlugin'
}
javaRestTest {
// add "-Dtests.security.manager=false" to VM options if you want to run integ tests in IntelliJ
systemProperty 'tests.security.manager', 'false'
}
testClusters.javaRestTest {
testDistribution = 'INTEG_TEST'
}
ext {
isSnapshot = "true" == System.getProperty("build.snapshot", "true")
}
allprojects {
group = 'org.opensearch'
version = opensearch_version - '-SNAPSHOT' + '.0'
if (isSnapshot) {
version += "-SNAPSHOT"
}
apply from: "$rootDir/build-tools/repositories.gradle"
plugins.withId('java') {
sourceCompatibility = targetCompatibility = "1.8"
}
}
repositories {
mavenLocal()
mavenCentral()
maven { url "https://aws.oss.sonatype.org/content/repositories/snapshots" }
}
dependencies {
compile project(path: ":${rootProject.name}-spi", configuration: 'shadow')
javaRestTestImplementation project.sourceSets.main.runtimeClasspath
}
// RPM & Debian build
apply plugin: 'nebula.ospackage'
// This is afterEvaluate because the bundlePlugin ZIP task is updated afterEvaluate and changes the ZIP name to match the plugin name
afterEvaluate {
ospackage {
packageName = "${name}"
release = isSnapshot ? "0.1" : '1'
version = "${project.version}" - "-SNAPSHOT"
into '/usr/share/opensearch/plugins'
from(zipTree(bundlePlugin.archivePath)) {
into opensearchplugin.name
}
user 'root'
permissionGroup 'root'
fileMode 0644
dirMode 0755
requires('opensearch', versions.opensearch, EQUAL)
packager = 'Amazon'
vendor = 'Amazon'
os = 'LINUX'
prefix '/usr'
license 'ASL-2.0'
maintainer 'OpenSearch Team <[email protected]>'
url 'https://opensearch.org/downloads.html'
summary '''
JobScheduler plugin for OpenSearch.
Reference documentation can be found at https://docs-beta.opensearch.org/.
'''.stripIndent().replace('\n', ' ').trim()
}
buildRpm {
arch = 'NOARCH'
dependsOn 'assemble'
finalizedBy 'renameRpm'
task renameRpm(type: Copy) {
from("$buildDir/distributions")
into("$buildDir/distributions")
include archiveName
rename archiveName, "${packageName}-${version}.rpm"
doLast { delete file("$buildDir/distributions/$archiveName") }
}
}
buildDeb {
arch = 'all'
dependsOn 'assemble'
finalizedBy 'renameDeb'
task renameDeb(type: Copy) {
from("$buildDir/distributions")
into("$buildDir/distributions")
include archiveName
rename archiveName, "${packageName}-${version}.deb"
doLast { delete file("$buildDir/distributions/$archiveName") }
}
}
}