-
-
Notifications
You must be signed in to change notification settings - Fork 15
Expand file tree
/
Copy pathbuild.gradle.kts
More file actions
114 lines (102 loc) · 4.28 KB
/
Copy pathbuild.gradle.kts
File metadata and controls
114 lines (102 loc) · 4.28 KB
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
import java.util.Properties
// Compose ui-test-junit4-android pulls Espresso 3.5.x; align all androidx.test artifacts or
// ActivityScenario / ActivityInvoker can fail at runtime (see android/android-test#2259).
configurations.configureEach {
if (name.contains("androidTest", ignoreCase = true)) {
resolutionStrategy {
force(
"androidx.test:runner:1.7.0",
"androidx.test:rules:1.7.0",
"androidx.test:core:1.7.0",
"androidx.test:monitor:1.8.0",
"androidx.test.espresso:espresso-core:3.7.0",
"androidx.test.espresso:espresso-idling-resource:3.7.0",
)
}
}
}
plugins {
alias(libs.plugins.kotlin.android)
alias(libs.plugins.kotlin.compose)
alias(libs.plugins.android.application)
id("skip-build-plugin")
}
skip {
}
kotlin {
compilerOptions {
jvmTarget = org.jetbrains.kotlin.gradle.dsl.JvmTarget.fromTarget(libs.versions.jvm.get().toString())
}
}
android {
namespace = group as String
compileSdk = libs.versions.android.sdk.compile.get().toInt()
compileOptions {
sourceCompatibility = JavaVersion.toVersion(libs.versions.jvm.get())
targetCompatibility = JavaVersion.toVersion(libs.versions.jvm.get())
}
defaultConfig {
minSdk = libs.versions.android.sdk.min.get().toInt()
targetSdk = libs.versions.android.sdk.compile.get().toInt()
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
// skip.tools.skip-build-plugin will automatically use Skip.env properties for:
// applicationId = PRODUCT_BUNDLE_IDENTIFIER
// versionCode = CURRENT_PROJECT_VERSION
// versionName = MARKETING_VERSION
}
buildFeatures {
buildConfig = true
compose = true
}
lint {
disable.add("Instantiatable")
disable.add("MissingPermission")
}
dependenciesInfo {
// Disables dependency metadata when building APKs.
includeInApk = false
// Disables dependency metadata when building Android App Bundles.
includeInBundle = false
}
// default signing configuration tries to load from keystore.properties
// see: https://skip.tools/docs/deployment/#export-signing
signingConfigs {
val keystorePropertiesFile = file("keystore.properties")
create("release") {
if (keystorePropertiesFile.isFile) {
val keystoreProperties = Properties()
keystoreProperties.load(keystorePropertiesFile.inputStream())
keyAlias = keystoreProperties.getProperty("keyAlias")
keyPassword = keystoreProperties.getProperty("keyPassword")
storeFile = file(keystoreProperties.getProperty("storeFile"))
storePassword = keystoreProperties.getProperty("storePassword")
} else {
// when there is no keystore.properties file, fall back to signing with debug config
keyAlias = signingConfigs.getByName("debug").keyAlias
keyPassword = signingConfigs.getByName("debug").keyPassword
storeFile = signingConfigs.getByName("debug").storeFile
storePassword = signingConfigs.getByName("debug").storePassword
}
}
}
buildTypes {
release {
signingConfig = signingConfigs.findByName("release")
isMinifyEnabled = true
isShrinkResources = true
isDebuggable = false // can be set to true for debugging release build, but needs to be false when uploading to store
proguardFiles(getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro")
}
}
}
dependencies {
androidTestImplementation(platform(libs.androidx.compose.bom))
androidTestImplementation(libs.androidx.compose.ui.test)
androidTestImplementation(libs.androidx.compose.ui.test.junit4)
debugImplementation(libs.androidx.compose.ui.test.manifest)
androidTestImplementation("androidx.test:runner:1.7.0")
androidTestImplementation("androidx.test:rules:1.7.0")
androidTestImplementation("androidx.test:core:1.7.0")
androidTestImplementation("androidx.test.ext:junit:1.3.0")
androidTestImplementation("androidx.test.uiautomator:uiautomator:2.4.0-beta02")
}