-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.gradle.kts
More file actions
100 lines (78 loc) · 2.58 KB
/
build.gradle.kts
File metadata and controls
100 lines (78 loc) · 2.58 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.tasks.wrapper.Wrapper.DistributionType.ALL
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
plugins {
val kotlinVersion = "1.8.0"
val propactiveVersion = "1.2.0"
application
id("java-library")
id("io.github.propactive") version propactiveVersion
kotlin("jvm") version kotlinVersion
id("org.jlleitschuh.gradle.ktlint") version "11.0.0"
}
version = System.getenv("VERSION") ?: "DEV-SNAPSHOT"
propactive {
implementationClass = "io.github.propactive.demo.Properties"
destination = layout.buildDirectory.dir("properties").get().asFile.absolutePath
}
application {
val mainClassReference: String by project
val propertiesConfigPath = layout.buildDirectory.dir("properties").get().asFile.absolutePath
mainClass.set(mainClassReference)
applicationDefaultJvmArgs = listOf(
"-Xmx512m",
"-XX:MaxMetaspaceSize=256m",
"-Dproperties.config.path=$propertiesConfigPath"
)
tasks["run"]
.dependsOn("generateApplicationProperties")
}
repositories {
mavenLocal() // This is needed for (SNAPSHOT TESTING)
mavenCentral()
}
dependencies {
val jupiterVersion: String by project
val kotestVersion: String by project
val propactiveVersion: String by project
implementation("io.github.propactive:propactive-jvm:$propactiveVersion")
testImplementation("org.junit.jupiter:junit-jupiter:$jupiterVersion")
testImplementation("io.kotest:kotest-assertions-core:$kotestVersion")
testImplementation("io.kotest:kotest-runner-junit5:$kotestVersion")
}
tasks {
test {
useJUnitPlatform()
testLogging { showStandardStreams = true }
}
wrapper {
distributionType = ALL
}
jar {
val mainClassReference: String by project
manifest.apply {
attributes["Implementation-Title"] = project.name
attributes["Implementation-Version"] = project.version
attributes["Implementation-Vendor"] = "Propactive"
attributes["Main-Class"] = mainClassReference
}
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
from(sourceSets.main.get().output)
dependsOn(configurations.runtimeClasspath)
from({
configurations.runtimeClasspath.get()
.filter { it.name.endsWith("jar") }
.map { zipTree(it) }
})
}
withType<KotlinCompile>().configureEach {
kotlinOptions.jvmTarget = "17"
}
ktlint {
verbose.set(true)
}
}
java {
toolchain {
languageVersion.set(JavaLanguageVersion.of(17))
}
}