-
Notifications
You must be signed in to change notification settings - Fork 6
/
build.gradle.kts
141 lines (124 loc) · 4.94 KB
/
build.gradle.kts
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
/*
* ****************************************************************************
* Copyright 2016-2023 Spectra Logic Corporation. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License"). You may not use
* this file except in compliance with the License. A copy of the License is located at
* http://www.apache.org/licenses/LICENSE-2.0
* or in the "license" file accompanying this file.
* This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
* CONDITIONS OF ANY KIND, either express or implied. See the License for the
* specific language governing permissions and limitations under the License.
* **************************************************************************
*/
plugins {
`java-library`
`maven-publish`
alias(libs.plugins.owaspDepCheck)
alias(libs.plugins.versions)
}
group = "com.spectralogic.ds3"
version = "4.1.3-SNAPSHOT"
dependencies {
// handle transitive jackson deps
implementation(platform(libs.jacksonBom))
implementation(libs.okhttp)
implementation(libs.okioJvm)
implementation(libs.reactivexRxjava)
implementation(libs.retrofit)
implementation(libs.retrofitConverterJackson)
implementation(libs.retrofitAdapterRxjava2)
implementation(libs.slf4jApi)
testImplementation(libs.assertjCore)
testImplementation(libs.junit)
testImplementation(libs.junitJupiterApi)
testImplementation(libs.reactivexRxjava)
testImplementation(libs.slf4jSimple)
testRuntimeOnly(libs.junitVintageEngine)
}
java {
toolchain {
languageVersion.set(JavaLanguageVersion.of(17))
}
withJavadocJar()
withSourcesJar()
}
val integrationTest by sourceSets.creating
integrationTest.compileClasspath += sourceSets.main.get().output
integrationTest.runtimeClasspath += sourceSets.main.get().output
configurations[integrationTest.implementationConfigurationName].extendsFrom(configurations.testImplementation.get())
configurations[integrationTest.runtimeOnlyConfigurationName].extendsFrom(configurations.testRuntimeOnly.get())
val integrationTestTask = tasks.register<Test>("integrationTest") {
description = "Runs integration tests."
group = "verification"
testClassesDirs = integrationTest.output.classesDirs
classpath = configurations[integrationTest.runtimeClasspathConfigurationName] + integrationTest.output
shouldRunAfter(tasks.test)
useJUnitPlatform()
}
tasks.check {
dependsOn(integrationTestTask)
}
dependencyCheck {
// fail the build if any vulnerable dependencies are identified (CVSS score > 0)
failBuildOnCVSS = 0f;
suppressionFile = "project_files/owasp/dependency-check-suppression.xml"
}
publishing {
repositories {
maven {
name = "internal"
val releasesRepoUrl = "https://artifacts.eng.sldomain.com/repository/spectra-releases/"
val snapshotsRepoUrl = "https://artifacts.eng.sldomain.com/repository/spectra-snapshots/"
url = uri(if (version.toString().endsWith("SNAPSHOT")) snapshotsRepoUrl else releasesRepoUrl)
credentials {
username = extra.has("artifactsUsername").let {
if (it) extra.get("artifactsUsername") as String else null
}
password = extra.has("artifactsPassword").let {
if (it) extra.get("artifactsPassword") as String else null
}
}
}
}
publications {
create<MavenPublication>(project.name) {
from(components["java"])
}
}
}
tasks.register("publishToInternalRepository") {
group = "publishing"
description = "Publishes all Maven publications to the internal Maven repository."
dependsOn(tasks.withType<PublishToMavenRepository>().matching {
it.repository == publishing.repositories["internal"]
})
}
publishing.publications.filterIsInstance<MavenPublication>().forEach { pub ->
pub.pom {
name.set("${project.group}:${project.name}")
url.set("https://github.com/SpectraLogic/blackpearl_mgmt_client")
licenses {
license {
name.set("The Apache License, Version 2.0")
url.set("http://www.apache.org/licenses/LICENSE-2.0.txt")
}
}
developers {
developer {
name.set("Spectra Logic Developers")
email.set("[email protected]")
organization.set("Spectra Logic")
organizationUrl.set("https://spectralogic.com/")
}
}
scm {
connection.set("scm:git:https://github.com/SpectraLogic/blackpearl_mgmt_client.git")
developerConnection.set("scm:git:https://github.com/SpectraLogic/blackpearl_mgmt_client.git")
url.set("https://github.com/SpectraLogic/blackpearl_mgmt_client")
}
}
}
tasks.wrapper {
// to upgrade the gradle wrapper, bump the version below and run ./gradlew wrapper twice
gradleVersion = "8.3"
}