-
Notifications
You must be signed in to change notification settings - Fork 65
Expand file tree
/
Copy pathbuild.gradle
More file actions
100 lines (84 loc) · 3.08 KB
/
Copy pathbuild.gradle
File metadata and controls
100 lines (84 loc) · 3.08 KB
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
import org.gradle.api.internal.tasks.testing.junitplatform.JUnitPlatformTestFramework
/*
* SPDX-License-Identifier: Apache-2.0
*
* The OpenSearch Contributors require contributions made to
* this file be licensed under the Apache-2.0 license or a
* compatible open source license.
*
* Modifications Copyright OpenSearch Contributors. See
* GitHub history for details.
*/
plugins {
id 'java'
id "com.diffplug.spotless" version "6.18.0" apply false
id 'jacoco'
id "com.form.diff-coverage" version "0.9.5"
// for javadocs and checks spotless doesn't do
id 'checkstyle'
}
ext {
projectSubstitutions = [:]
licenseFile = rootProject.file('LICENSE.txt')
noticeFile = rootProject.file('NOTICE.txt')
}
apply plugin: 'application'
apply plugin: 'maven-publish'
// Temporary to keep "gradle run" working
// TODO: change this to an extension designed for testing instead of duplicating a sample
// https://github.com/opensearch-project/opensearch-sdk-java/issues/175
mainClassName = 'org.opensearch.sdk.sample.helloworld.HelloWorldExtension'
group 'org.opensearch.sdk.sample'
version '2.0.0-SNAPSHOT'
java {
withSourcesJar()
withJavadocJar()
}
publishing {
publications {
group = "${group}"
version = "${version}"
mavenJava(MavenPublication) {
from components.java
}
sourceCompatibility = 11
targetCompatibility = 11
}
repositories {
maven {
name = "Snapshots" // optional target repository name
url = "https://aws.oss.sonatype.org/content/repositories/snapshots"
credentials {
username "$System.env.SONATYPE_USERNAME"
password "$System.env.SONATYPE_PASSWORD"
}
}
}
}
test {
getTestFrameworkProperty().convention(getProviderFactory().provider(() -> new JUnitPlatformTestFramework(it.getFilter(), false)))
jvmArgs '--enable-preview'
systemProperty 'tests.security.manager', 'false'
}
dependencies {
def opensearchVersion = "3.0.0-SNAPSHOT"
def jobSchedulerVersion = "3.0.0.0-SNAPSHOT"
def junit5Version = "5.9.3"
def junitPlatform = "1.9.3"
implementation project(':')
implementation("org.opensearch.plugin:opensearch-job-scheduler:${jobSchedulerVersion}")
implementation("org.opensearch:opensearch-job-scheduler:${jobSchedulerVersion}")
implementation("org.opensearch:opensearch-job-scheduler-spi:${jobSchedulerVersion}")
testImplementation project(':').sourceSets.test.output
testImplementation("org.junit.jupiter:junit-jupiter-api:${junit5Version}")
testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine:${junit5Version}")
testImplementation("org.opensearch.test:framework:${opensearchVersion}")
testRuntimeOnly("org.junit.platform:junit-platform-launcher:${junitPlatform}")
}
// this task runs the helloworld sample extension
task helloWorld(type: JavaExec) {
group = 'Execution'
description = 'Run HelloWorld Extension.'
mainClass = 'org.opensearch.sdk.sample.helloworld.HelloWorldExtension'
classpath = sourceSets.main.runtimeClasspath
}