-
Notifications
You must be signed in to change notification settings - Fork 252
Expand file tree
/
Copy pathsmithy-rs.kotlin-conventions.gradle.kts
More file actions
68 lines (56 loc) · 1.62 KB
/
smithy-rs.kotlin-conventions.gradle.kts
File metadata and controls
68 lines (56 loc) · 1.62 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
import org.gradle.api.tasks.testing.logging.TestExceptionFormat
import org.gradle.kotlin.dsl.the
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
plugins {
kotlin("jvm")
}
// Workaround per: https://github.com/gradle/gradle/issues/15383
val Project.libs get() = the<org.gradle.accessors.dm.LibrariesForLibs>()
// Ensure Kotlin stdlib dependencies have explicit versions in published POMs
configurations.all {
resolutionStrategy {
eachDependency {
if (requested.group == "org.jetbrains.kotlin" && requested.name.startsWith("kotlin-stdlib")) {
useVersion(libs.versions.kotlin.version.get())
}
}
}
}
java {
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
withSourcesJar()
}
tasks.compileKotlin {
compilerOptions.jvmTarget.set(JvmTarget.JVM_11)
}
tasks.compileTestKotlin {
compilerOptions.jvmTarget.set(JvmTarget.JVM_11)
}
// Reusable license copySpec
val licenseSpec = copySpec {
from("${project.rootDir}/LICENSE")
from("${project.rootDir}/NOTICE")
}
// Configure jars to include license related info
tasks.jar {
metaInf.with(licenseSpec)
inputs.property("moduleName", project.name)
manifest {
attributes["Automatic-Module-Name"] = project.name
}
}
tasks.test {
useJUnitPlatform()
testLogging {
events("failed")
exceptionFormat = TestExceptionFormat.FULL
showCauses = true
showExceptions = true
showStackTraces = true
}
}
tasks.test.configure {
val isTestingEnabled: String by project
enabled = isTestingEnabled.toBoolean()
}