-
Notifications
You must be signed in to change notification settings - Fork 20
/
build.gradle.kts
156 lines (130 loc) · 3.86 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
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
import org.jetbrains.kotlin.gradle.ExperimentalKotlinGradlePluginApi
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
buildscript {
dependencies {
classpath(libs.dokka.base) // needed for dokka custom format config
}
}
plugins {
alias(libs.plugins.jetbrainsCompose)
alias(libs.plugins.compose.compiler)
alias(libs.plugins.kotlinMultiplatform)
alias(libs.plugins.androidLibrary)
alias(libs.plugins.dokka)
alias(libs.plugins.detekt)
id("convention.publication")
}
repositories {
google()
mavenCentral()
maven("https://maven.pkg.jetbrains.space/public/p/compose/dev")
}
dependencies {
detektPlugins(libs.detekt.formatting)
}
group = "io.github.koalaplot"
version = "0.8.0-dev1"
kotlin {
explicitApi()
androidTarget {
publishLibraryVariants("release")
@OptIn(ExperimentalKotlinGradlePluginApi::class)
compilerOptions {
jvmTarget.set(JvmTarget.JVM_11)
}
}
iosArm64()
iosSimulatorArm64()
iosX64()
js(IR) {
browser()
}
jvm("desktop") {
@OptIn(ExperimentalKotlinGradlePluginApi::class)
compilerOptions {
jvmTarget.set(JvmTarget.JVM_11)
}
}
@OptIn(org.jetbrains.kotlin.gradle.ExperimentalWasmDsl::class)
wasmJs {
browser()
}
sourceSets {
commonMain.dependencies {
implementation(compose.runtime)
implementation(compose.foundation)
implementation(compose.material3)
api(compose.ui)
api(compose.animation)
implementation(libs.kotlinx.coroutines)
}
commonTest.dependencies {
implementation(kotlin("test"))
}
val desktopMain by getting {
dependsOn(commonMain.get())
dependencies {}
}
val desktopTest by getting {
dependencies {
implementation(kotlin("test"))
@OptIn(org.jetbrains.compose.ExperimentalComposeLibrary::class)
implementation(compose.desktop.uiTestJUnit4)
implementation(compose.desktop.currentOs)
}
}
val iosX64Main by getting
val iosArm64Main by getting
val iosSimulatorArm64Main by getting
val iosMain by creating {
dependsOn(commonMain.get())
dependencies { }
iosX64Main.dependsOn(this)
iosArm64Main.dependsOn(this)
iosSimulatorArm64Main.dependsOn(this)
}
}
@OptIn(ExperimentalKotlinGradlePluginApi::class)
compilerOptions {
freeCompilerArgs.add("-opt-in=kotlin.RequiresOptIn")
}
}
android {
namespace = "io.github.koalaplot"
compileSdk = 34
defaultConfig {
minSdk = 23
}
compileOptions {
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
}
publishing {
singleVariant("release") {
withSourcesJar()
}
}
}
/**
* Custom format adds a custom logo
*/
tasks.register<org.jetbrains.dokka.gradle.DokkaTask>("dokkaCustomFormat") {
moduleName.set("Koala Plot Core")
outputDirectory.set(layout.buildDirectory.dir("docs/api/${project.version}").get())
pluginConfiguration<org.jetbrains.dokka.base.DokkaBase, org.jetbrains.dokka.base.DokkaBaseConfiguration> {
customStyleSheets = listOf(file("src/docs/dokka/logo-styles.css"))
customAssets = listOf(file("src/docs/assets/images/logo-icon.svg"))
}
}
tasks["build"].dependsOn.add("dokkaCustomFormat")
tasks.withType<org.jetbrains.kotlin.gradle.tasks.KotlinCompile> {
detekt {
source.setFrom("src")
parallel = true
config.setFrom("$rootDir/detekt.yml")
buildUponDefaultConfig = true
}
}
tasks.withType<io.gitlab.arturbosch.detekt.Detekt>().configureEach {
exclude("**/desktopTest/**")
}