-
Notifications
You must be signed in to change notification settings - Fork 15
/
Copy pathbuild.gradle.kts
136 lines (123 loc) · 3.81 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
import com.konyaco.fluent.plugin.build.BuildConfig
import com.konyaco.fluent.plugin.build.applyTargets
import org.jetbrains.compose.desktop.application.dsl.TargetFormat
plugins {
alias(libs.plugins.kotlin.multiplatform)
alias(libs.plugins.kotlin.compose)
alias(libs.plugins.compose)
alias(libs.plugins.android.application)
alias(libs.plugins.ksp)
}
kotlin {
applyTargets(publish = false)
wasmJs { binaries.executable() }
js { binaries.executable() }
listOf(
iosX64(),
iosArm64(),
iosSimulatorArm64()
).forEach {
it.binaries.framework {
baseName = "ComposeApp"
isStatic = true
}
}
sourceSets {
val commonMain by getting {
dependencies {
implementation(compose.foundation)
implementation(compose.components.resources)
implementation(project(":fluent"))
implementation(project(":fluent-icons-extended"))
implementation(compose.uiUtil)
implementation(libs.highlights)
implementation(project(":source-generated"))
}
kotlin.srcDir("build/generated/ksp/metadata/commonMain/kotlin")
}
val commonTest by getting {
dependencies {
implementation(kotlin("test"))
}
}
val androidMain by getting {
dependencies {
implementation(libs.androidx.activity.compose)
}
}
val androidUnitTest by getting
val androidInstrumentedTest by getting {
dependencies {
implementation(libs.androidx.test.junit)
}
}
val desktopMain by getting {
dependencies {
implementation(compose.preview)
implementation(libs.window.styler)
}
}
val desktopTest by getting
}
}
android {
compileSdk = BuildConfig.Android.compileSdkVersion
namespace = BuildConfig.packageName + ".gallery"
defaultConfig {
minSdk = BuildConfig.Android.minSdkVersion
targetSdk = BuildConfig.Android.compileSdkVersion
versionCode = 1
versionName = "1.0"
vectorDrawables {
useSupportLibrary = true
}
}
buildTypes {
release {
isMinifyEnabled = true
proguardFiles(getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.android.pro")
}
}
packaging {
resources {
excludes.add("/META-INF/{AL2.0,LGPL2.1}")
}
}
compileOptions {
sourceCompatibility = BuildConfig.Jvm.javaVersion
targetCompatibility = BuildConfig.Jvm.javaVersion
}
}
compose.desktop {
application {
mainClass = "${BuildConfig.packageName}.gallery.MainKt"
nativeDistributions {
targetFormats(TargetFormat.Dmg, TargetFormat.Msi, TargetFormat.Deb)
packageName = "Compose Fluent Design Gallery"
packageVersion = "1.0.0"
macOS {
iconFile.set(project.file("icons/icon.icns"))
jvmArgs(
"-Dapple.awt.application.appearance=system"
)
}
windows {
iconFile.set(project.file("icons/icon.ico"))
}
linux {
iconFile.set(project.file("icons/icon.png"))
}
}
}
}
dependencies {
val processor = project(":gallery-processor")
add("kspCommonMainMetadata", processor)
}
// workaround for KSP only in Common Main.
// https://github.com/google/ksp/issues/567
tasks.withType<org.jetbrains.kotlin.gradle.dsl.KotlinCompile<*>>().all {
if (name != "kspCommonMainKotlinMetadata") {
dependsOn("kspCommonMainKotlinMetadata")
}
}