forked from opensearch-project/ml-commons
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
127 lines (112 loc) · 3.61 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
/*
* Copyright OpenSearch Contributors
* SPDX-License-Identifier: Apache-2.0
*/
plugins {
id 'java'
id "io.freefair.lombok"
id 'jacoco'
id 'io.github.goooler.shadow' version "8.1.7"
id 'maven-publish'
id 'com.diffplug.spotless' version '6.25.0'
id 'signing'
}
dependencies {
implementation project(path: ":${rootProject.name}-spi", configuration: 'shadow')
implementation project(path: ":${rootProject.name}-common", configuration: 'shadow')
implementation project(path: ":${rootProject.name}-memory", configuration: 'shadow')
compileOnly group: 'org.opensearch', name: 'opensearch', version: "${opensearch_version}"
testImplementation group: 'junit', name: 'junit', version: '4.13.2'
testImplementation group: 'org.mockito', name: 'mockito-core', version: '5.15.2'
}
spotless {
java {
removeUnusedImports()
importOrder 'java', 'javax', 'org', 'com'
eclipse().withP2Mirrors(Map.of("https://download.eclipse.org/", "https://mirror.umd.edu/eclipse/")).configFile rootProject.file('.eclipseformat.xml')
}
}
jacocoTestReport {
reports {
xml.getRequired().set(true)
csv.getRequired().set(false)
html.getRequired().set(true)
}
dependsOn test
}
jacocoTestCoverageVerification {
violationRules {
rule {
limit {
counter = 'LINE'
minimum = 0.8
}
limit {
counter = 'BRANCH'
minimum = 0.8
}
}
}
dependsOn jacocoTestReport
}
check.dependsOn jacocoTestCoverageVerification
shadowJar {
archiveClassifier.set(null)
}
task sourcesJar(type: Jar) {
archiveClassifier.set("sources")
from sourceSets.main.allJava
}
task javadocJar(type: Jar) {
archiveClassifier.set("javadoc")
from javadoc.destinationDir
dependsOn javadoc
}
publishing {
repositories {
maven {
name = 'staging'
url = "${rootProject.buildDir}/local-staging-repo"
}
maven {
name = "Snapshots"
url = "https://aws.oss.sonatype.org/content/repositories/snapshots"
credentials {
username "$System.env.SONATYPE_USERNAME"
password "$System.env.SONATYPE_PASSWORD"
}
}
}
publications {
shadow(MavenPublication) { publication ->
project.shadow.component(publication)
artifact sourcesJar
artifact javadocJar
pom {
name = "OpenSearch Machine Learning Client"
packaging = "jar"
url = "https://github.com/opensearch-project/ml-commons"
description = "OpenSearch Machine Learning Client"
scm {
connection = "scm:git@github.com:opensearch-project/ml-commons.git"
developerConnection = "scm:git@github.com:opensearch-project/ml-commons.git"
url = "git@github.com:opensearch-project/ml-commons.git"
}
licenses {
license {
name = "The Apache License, Version 2.0"
url = "http://www.apache.org/licenses/LICENSE-2.0.txt"
}
}
developers {
developer {
name = "OpenSearch"
url = "https://github.com/opensearch-project/ml-commons"
}
}
}
}
}
}
compileJava.dependsOn(':opensearch-ml-common:shadowJar')
delombok.dependsOn(':opensearch-ml-common:shadowJar')