-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle.kts
105 lines (90 loc) · 2.76 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
plugins {
id("com.android.application")
id("org.jetbrains.kotlin.android")
id("org.jetbrains.kotlin.plugin.serialization")
id("org.mozilla.rust-android-gradle.rust-android") version "0.9.2"
}
kotlin {
jvmToolchain(11)
}
// Set in gradle.properties
val composeVersion: String by project
android {
namespace = "io.github.bamboo.krust"
compileSdk = 34
ndkVersion = "25.1.8937393"
defaultConfig {
applicationId = "io.github.bamboo.krust"
minSdk = 28
targetSdk = 33
versionCode = 1
versionName = "1.0"
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
vectorDrawables {
useSupportLibrary = true
}
}
buildTypes {
release {
isMinifyEnabled = false
proguardFiles(
getDefaultProguardFile("proguard-android-optimize.txt"),
"proguard-rules.pro",
)
}
}
compileOptions {
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
}
kotlinOptions {
jvmTarget = "11"
freeCompilerArgs = listOf(
// Kotlin Serialization API
"-opt-in=kotlin.RequiresOptIn",
)
}
buildFeatures {
compose = true
}
composeOptions {
kotlinCompilerExtensionVersion = composeVersion
}
packagingOptions {
resources {
excludes += "/META-INF/{AL2.0,LGPL2.1}"
}
}
}
cargo {
module = "../backend"
libname = "backend"
targets = listOf(
"arm64",
// "arm",
// "x86",
// "x86_64",
)
}
// Run cargo build before packaging the assets for each variant
android.applicationVariants.configureEach {
val productFlavor = productFlavors.joinToString { it.name.capitalize() }
val buildType = buildType.name.capitalize()
tasks.named("generate${productFlavor}${buildType}Assets") {
dependsOn("cargoBuild")
}
}
dependencies {
implementation("androidx.core:core-ktx:1.12.0")
implementation("androidx.compose.ui:ui:1.5.4")
implementation("androidx.compose.material:material:1.5.4")
implementation("androidx.compose.ui:ui-tooling-preview:1.5.4")
implementation("androidx.lifecycle:lifecycle-runtime-ktx:2.7.0")
implementation("androidx.activity:activity-compose:1.8.2")
implementation("org.jetbrains.kotlinx:kotlinx-serialization-json:1.5.1")
testImplementation("junit:junit:4.13.2")
androidTestImplementation("androidx.test.ext:junit:1.1.5")
androidTestImplementation("androidx.test.espresso:espresso-core:3.5.1")
androidTestImplementation("androidx.compose.ui:ui-test-junit4:1.5.4")
debugImplementation("androidx.compose.ui:ui-tooling:1.5.4")
}