-
Notifications
You must be signed in to change notification settings - Fork 19
/
build.gradle.kts
executable file
·117 lines (105 loc) · 3.92 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
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
buildscript {
repositories {
google()
mavenCentral()
maven("https://plugins.gradle.org/m2/")
maven("https://maven.pkg.jetbrains.space/public/p/compose/dev")
maven("https://maven.pkg.jetbrains.space/kotlin/p/dokka/dev")
maven("https://maven.pkg.jetbrains.space/public/p/kotlinx-html/maven")
}
dependencies {
classpath(libs.compose.desktop)
classpath(libs.kotlin.gradlePlugin)
classpath(libs.dokka.gradlePlugin)
classpath(libs.versionchecker.gradlePlugin)
classpath(libs.mavenpublish.gradlePlugin)
}
}
plugins {
alias(libs.plugins.jetbrainsCompose) apply false
alias(libs.plugins.compose.compiler) apply false
}
allprojects {
repositories {
google()
mavenCentral()
maven("https://maven.pkg.jetbrains.space/public/p/compose/dev")
maven("https://maven.pkg.jetbrains.space/kotlin/p/dokka/dev")
maven("https://maven.pkg.jetbrains.space/public/p/kotlinx-html/maven")
}
tasks.withType<Jar>().configureEach {
isPreserveFileTimestamps = false
isReproducibleFileOrder = true
version = "${project.property("VERSION_NAME")}"
archiveBaseName.set("${rootProject.name}-${project.name}")
manifest {
// add Aurora version and automatic module name to each MANIFEST.MF
attributes["Aurora-Version"] =
"${project.property("VERSION_NAME")} ${project.property("VERSION_CODENAME")}"
if (project.hasProperty("POM_ARTIFACT_ID")) {
attributes["Automatic-Module-Name"] =
"org.pushingpixels." + "${project.property("POM_ARTIFACT_ID")}".replace("-", ".")
}
}
}
tasks.withType<KotlinCompile>().configureEach {
compilerOptions {
// Force class file format for Java 11
jvmTarget.set(JvmTarget.JVM_11)
freeCompilerArgs.add("-opt-in=kotlin.RequiresOptIn")
}
}
configurations {
all {
exclude(group = "org.jetbrains.compose.material", module = "material")
exclude(group = "org.jetbrains.compose.material3", module = "material3")
}
}
}
// To generate report about available dependency updates, run
// ./gradlew dependencyUpdates
apply(plugin = "com.github.ben-manes.versions")
// Copies the compiled jars from all the modules into the drop folder.
tasks.register("copyJars") {
delete("drop/${project.property("VERSION_NAME")}")
mkdir("drop/${project.property("VERSION_NAME")}")
subprojects {
copy {
from(project.layout.buildDirectory.dir("libs").get().asFile)
include("${rootProject.name}-${project.name}-*-${project.property("VERSION_NAME")}.jar")
into("${rootProject.projectDir}/drop/${project.property("VERSION_NAME")}")
}
}
}
tasks.register("getDependencies") {
subprojects {
val runtimeClasspath =
project.configurations.matching { it.name == "desktopRuntimeClasspath" }
runtimeClasspath.all {
for (dep in map { file: File -> file.absoluteFile }) {
project.copy {
from(dep)
into("${rootProject.projectDir}/build/libs")
}
}
}
}
}
tasks.register("printRuntimeDependencies") {
println("Project runtime dependencies:")
allprojects {
println()
println("-------- ${project.name} --------")
project.configurations.matching { it.name == "desktopRuntimeClasspath" }
.matching { !it.allDependencies.isEmpty() }
.forEach {
it.allDependencies.forEach { dep ->
if (dep.group != null) {
println("${dep.group}:${dep.name}:${dep.version}")
}
}
}
}
}