-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle.kts
113 lines (99 loc) · 3.02 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
import org.jetbrains.compose.desktop.application.dsl.TargetFormat
import org.jetbrains.gradle.ext.settings
import org.jetbrains.gradle.ext.taskTriggers
plugins {
alias(libs.plugins.kotlin.multiplatform)
alias(libs.plugins.jetbrains.compose)
alias(libs.plugins.compose.compiler)
alias(libs.plugins.google.ksp)
alias(libs.plugins.jetbrains.ideaExt)
alias(libs.plugins.centralPortalPublisher)
alias(libs.plugins.keyring)
}
group = "me.okonecny"
version = "1.0-SNAPSHOT"
repositories {
google()
mavenCentral()
maven("https://maven.pkg.jetbrains.space/public/p/compose/dev")
maven("https://packages.jetbrains.team/maven/p/kpm/public/")
}
keyring {
secret("maven_central_token_user")
secret("maven_central_token_password")
}
kotlin {
jvm {
withJava()
}
jvmToolchain {
languageVersion = JavaLanguageVersion.of(libs.versions.javaTargetVersion.get())
vendor = JvmVendorSpec.JETBRAINS
}
sourceSets {
val jvmMain by getting {
kotlin.srcDir("build/generated/ksp/jvm/jvmMain/kotlin")
dependencies {
implementation(compose.desktop.currentOs)
implementation(libs.kermit)
implementation(libs.kotlin.inject.runtime)
implementation(project("markdown-editor"))
}
}
val jvmTest by getting {
kotlin.srcDir("build/generated/ksp/jvm/jvmTest/kotlin")
}
}
}
compose.desktop {
application {
mainClass = "me.okonecny.markdowneditor.demo.MainKt"
jvmArgs(
"--add-exports=java.desktop/sun.java2d=ALL-UNNAMED", // For access to SunGraphicsEnvironment.
"-Djava.net.useSystemProxies=true"
)
nativeDistributions {
targetFormats(TargetFormat.Dmg, TargetFormat.Msi, TargetFormat.AppImage)
packageName = "markdowneditordemo"
packageVersion = "1.0.0"
}
}
}
dependencies {
add("kspJvm", libs.kotlin.inject.compiler)
add("kspJvmTest", libs.kotlin.inject.compiler)
}
idea.project.settings.taskTriggers {
afterSync("kspKotlinJvm", "kspTestKotlinJvm")
}
sonatypePortalPublisher {
authentication {
username = keyring.secrets["maven_central_token_user"]
password = keyring.secrets["maven_central_token_password"]
}
settings {
autoPublish = false
aggregation = true
}
}
val patchReadme: Task by tasks.creating {
val readmeFile = File("README.md")
inputs.files(readmeFile)
outputs.files(readmeFile)
subprojects.forEach { proj ->
inputs.property(proj.path, proj.version)
}
doLast {
var readmeContents = readmeFile.readText()
subprojects.forEach { proj ->
readmeContents = readmeContents.replace(
Regex("${proj.group}:${proj.name}:\\d+\\.\\d+\\.\\d+"),
"${proj.group}:${proj.name}:${proj.version}"
)
}
readmeFile.writeText(readmeContents)
}
}
tasks.build.configure {
dependsOn(patchReadme)
}