-
Notifications
You must be signed in to change notification settings - Fork 3
/
build.gradle.kts
112 lines (90 loc) · 2.71 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
plugins {
kotlin("jvm") version "1.8.20"
kotlin("plugin.serialization") version "1.8.20"
id("org.cadixdev.licenser") version "0.6.1"
}
allprojects {
apply(plugin = "java")
apply(plugin = "idea")
apply(plugin = "eclipse")
defaultTasks("licenseFormat", "build")
group = "org.lanternpowered"
version = "1.0-SNAPSHOT"
repositories {
mavenCentral()
maven("https://oss.sonatype.org/content/groups/public")
}
}
subprojects {
afterEvaluate {
apply(plugin = "org.cadixdev.licenser")
dependencies {
implementation(kotlin("stdlib-jdk8"))
}
tasks {
val javadocJar = create<Jar>("javadocJar") {
archiveBaseName.set(project.name)
archiveClassifier.set("javadoc")
from(javadoc)
}
val sourceJar = create<Jar>("sourceJar") {
archiveClassifier.set("sources")
from(sourceSets.main.get().allSource)
exclude("**/*.class") // For module-info.class
}
assemble {
dependsOn(sourceJar)
dependsOn(javadocJar)
}
artifacts {
archives(jar.get())
archives(sourceJar)
archives(javadocJar)
}
listOf(jar.get(), sourceJar, javadocJar).forEach {
it.from(project.file("LICENSE.txt"))
}
test {
useJUnitPlatform()
}
withType<org.jetbrains.kotlin.gradle.tasks.KotlinCompile>().forEach {
it.kotlinOptions.apply {
jvmTarget = "17"
languageVersion = "1.9"
val args = mutableListOf<String>()
args += "-Xjvm-default=all"
args += "-Xallow-result-return-type"
fun optIn(name: String) {
args += "-opt-in=$name"
}
fun enableLanguageFeature(name: String) {
args += "-XXLanguage:+$name"
}
enableLanguageFeature("InlineClasses")
enableLanguageFeature("NewInference")
enableLanguageFeature("NonParenthesizedAnnotationsOnFunctionalTypes")
optIn("kotlin.ExperimentalUnsignedTypes")
optIn("kotlin.contracts.ExperimentalContracts")
optIn("kotlin.ExperimentalStdlibApi")
optIn("kotlin.experimental.ExperimentalTypeInference")
optIn("kotlin.time.ExperimentalTime")
optIn("kotlinx.coroutines.InternalCoroutinesApi")
optIn("kotlinx.coroutines.ExperimentalCoroutinesApi")
freeCompilerArgs = args
}
}
}
license {
header(rootProject.file("HEADER.txt"))
newLine(false)
ignoreFailures(false)
include("**/*.java")
include("**/*.kt")
ext {
set("name", rootProject.name)
set("url", "https://www.lanternpowered.org")
set("organization", "LanternPowered")
}
}
}
}