-
Notifications
You must be signed in to change notification settings - Fork 11
Expand file tree
/
Copy pathbuild.gradle.kts
More file actions
109 lines (95 loc) · 3.53 KB
/
Copy pathbuild.gradle.kts
File metadata and controls
109 lines (95 loc) · 3.53 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
101
102
103
104
105
106
107
108
109
import java.util.Date
/*
* ***************************************************************************
* Copyright 2014-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 {
id("base-compile-conventions")
application
}
dependencies {
implementation(platform(libs.ds3Bom))
implementation(platform(libs.jacksonBom))
api(libs.jacksonDatatypeGuava)
api(libs.commonsCli)
api(libs.jodaTime)
implementation(libs.commonsCsv)
implementation(libs.ds3Sdk)
implementation(libs.guava)
implementation(libs.guiceCore)
implementation(libs.jacksonAnnotations)
implementation(libs.jacksonCore)
implementation(libs.jacksonDatabind)
implementation(libs.jacksonDataformatXml)
implementation(libs.kotlinCoroutinesCore)
implementation(libs.logbackClassic)
implementation(fileTree("lib") {
include("*.jar")
})
testImplementation(libs.commonsIo)
testImplementation(libs.junit)
testImplementation(libs.hamcrestLib)
testImplementation(libs.powermockMockito)
testImplementation(libs.powermockJunit4)
}
application {
mainClass.set("com.spectralogic.ds3cli.Main")
}
val genConfigProperties = tasks.register("genConfigProperties") {
val configFile = sourceSets.main.get().output.resourcesDir!!.resolve("ds3_cli.properties")
outputs.file(configFile)
doLast {
configFile.writeText("""
version=${version}
build.date=${Date().toString()}
""".trimIndent())
}
}
tasks.compileTestKotlin {
dependsOn(genConfigProperties)
}
tasks.jar {
dependsOn(genConfigProperties)
}
// convenience task name for github tests
tasks.register<Test>("test8") {
dependsOn(tasks.test)
}
tasks.register<Test>("test11") {
javaLauncher.set(javaToolchains.launcherFor {
languageVersion.set(JavaLanguageVersion.of(11))
vendor.set(JvmVendorSpec.ADOPTIUM)
// powermock warnings for Java >= 11
jvmArgs = listOf("--add-opens", "java.base/java.lang=ALL-UNNAMED",
"--add-opens", "java.base/java.util.regex=ALL-UNNAMED",
"--add-opens", "java.base/java.text=ALL-UNNAMED",
"--add-opens", "java.base/java.io=ALL-UNNAMED",
"--add-opens", "java.base/sun.nio.fs=ALL-UNNAMED",
"--add-opens", "java.base/java.util=ALL-UNNAMED",
)
})
}
tasks.register<Test>("test17") {
javaLauncher.set(javaToolchains.launcherFor {
languageVersion.set(JavaLanguageVersion.of(17))
vendor.set(JvmVendorSpec.ADOPTIUM)
// powermock warnings for Java >= 11
jvmArgs = listOf("--add-opens", "java.base/java.lang=ALL-UNNAMED",
"--add-opens", "java.base/java.util.regex=ALL-UNNAMED",
"--add-opens", "java.base/java.text=ALL-UNNAMED",
"--add-opens", "java.base/java.io=ALL-UNNAMED",
"--add-opens", "java.base/sun.nio.fs=ALL-UNNAMED",
"--add-opens", "java.base/java.util=ALL-UNNAMED",
)
})
}