-
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathbuild.gradle.kts
94 lines (78 loc) · 2.74 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
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
import org.jetbrains.compose.compose
plugins {
kotlin("multiplatform") // kotlin("jvm") doesn't work well in IDEA/AndroidStudio (https://github.com/JetBrains/compose-jb/issues/22)
id("kotlinx-serialization")
id("org.jetbrains.compose")
id("com.android.application")
}
group = LibraryConstants.group
version = LibraryConstants.versionName
kotlin {
targets {
android()
jvm()
}
sourceSets {
val commonMain by getting {
dependencies {
implementation(project(":parcelable-compose"))
implementation(project(":sample-core"))
implementation(compose.runtime)
implementation(compose.foundation)
implementation(compose.material)
}
}
val androidMain by getting {
dependencies {
implementation("androidx.activity:activity-compose:_")
implementation("androidx.appcompat:appcompat:_")
// Syntax highlighting
implementation("io.noties:prism4j:_")
}
}
val jvmMain by getting {
dependencies {
implementation(compose.desktop.currentOs)
// Syntax highlighting
implementation("io.noties:prism4j:_")
}
}
}
}
android {
compileSdk = LibraryConstants.Android.compileSdkVersion
namespace = "com.chrynan.parcelable.sample.compose"
defaultConfig {
minSdk = 26
targetSdk = LibraryConstants.Android.targetSdkVersion
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
}
buildTypes {
getByName("release") {
proguardFiles(getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro")
}
}
compileOptions {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}
tasks.withType<KotlinCompile> {
kotlinOptions {
jvmTarget = "1.8"
// Opt-in to experimental compose APIs
freeCompilerArgs = listOf(
"-Xopt-in=kotlin.RequiresOptIn"
)
}
}
sourceSets["main"].manifest.srcFile("src/androidMain/AndroidManifest.xml")
sourceSets["main"].java.srcDirs("src/androidMain/kotlin")
sourceSets["main"].res.srcDirs("src/androidMain/res")
sourceSets["test"].java.srcDirs("src/androidTest/kotlin")
sourceSets["test"].res.srcDirs("src/androidTest/res")
}
tasks.withType<Jar> { duplicatesStrategy = DuplicatesStrategy.WARN }
configurations.filter { it.name == "implementation" }.forEach {
it.exclude(group = "org.jetbrains", module = "annotations")
}