|
1 | | -plugins { |
| 1 | +plugins { |
| 2 | + |
2 | 3 | alias(libs.plugins.android.application) |
| 4 | + |
3 | 5 | alias(libs.plugins.kotlin.android) |
| 6 | + |
4 | 7 | alias(libs.plugins.kotlin.compose) |
| 8 | + |
5 | 9 | id("com.google.android.libraries.mapsplatform.secrets-gradle-plugin") |
| 10 | + |
6 | 11 | id("org.jlleitschuh.gradle.ktlint") |
7 | 12 | } |
8 | 13 |
|
9 | 14 | ktlint { |
| 15 | + |
10 | 16 | android.set(true) |
| 17 | + |
11 | 18 | reporters { |
| 19 | + |
12 | 20 | reporter(org.jlleitschuh.gradle.ktlint.reporter.ReporterType.PLAIN) |
| 21 | + |
13 | 22 | reporter(org.jlleitschuh.gradle.ktlint.reporter.ReporterType.CHECKSTYLE) |
14 | 23 | } |
15 | 24 | } |
16 | 25 |
|
17 | 26 | android { |
| 27 | + |
18 | 28 | namespace = "com.mapconductor.example" |
| 29 | + |
19 | 30 | compileSdk = project.property("compileSdk").toString().toInt() |
20 | 31 |
|
21 | 32 | defaultConfig { |
| 33 | + |
22 | 34 | applicationId = "com.mapconductor.example" |
| 35 | + |
23 | 36 | minSdk = project.property("minSdk").toString().toInt() |
| 37 | + |
24 | 38 | targetSdk = project.property("targetSdk").toString().toInt() |
| 39 | + ndk { abiFilters += listOf("arm64-v8a") } |
| 40 | + vectorDrawables { |
| 41 | + useSupportLibrary = true |
| 42 | + } |
| 43 | + |
25 | 44 | versionCode = 1 |
| 45 | + |
26 | 46 | versionName = "1.0" |
| 47 | + |
27 | 48 | testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" |
28 | 49 | } |
29 | 50 |
|
30 | 51 | composeOptions { |
| 52 | + |
31 | 53 | kotlinCompilerExtensionVersion = |
| 54 | + |
32 | 55 | project.property("kotlinCompilerExtensionVersion").toString() |
33 | 56 | } |
34 | 57 |
|
35 | 58 | buildTypes { |
| 59 | + |
| 60 | + debug { |
| 61 | + |
| 62 | + isMinifyEnabled = false |
| 63 | + |
| 64 | + proguardFiles( |
| 65 | + getDefaultProguardFile("proguard-android.txt"), |
| 66 | + "proguard-rules.pro", |
| 67 | + ) |
| 68 | + } |
| 69 | + |
36 | 70 | release { |
37 | | - isMinifyEnabled = project.property("isMinifyEnabled").toString().toBoolean() |
| 71 | + |
| 72 | + isMinifyEnabled = true |
| 73 | + |
| 74 | + isShrinkResources = true |
| 75 | + |
38 | 76 | proguardFiles( |
39 | 77 | getDefaultProguardFile("proguard-android-optimize.txt"), |
40 | 78 | "proguard-rules.pro", |
41 | 79 | ) |
| 80 | + |
| 81 | + // Force legacy ProGuard instead of R8 |
| 82 | + |
| 83 | + buildConfigField("String", "BUILD_CONFIG_VERSION", "\"release\"") |
| 84 | + signingConfig = signingConfigs.getByName("debug") |
42 | 85 | } |
43 | 86 | } |
| 87 | + |
| 88 | + packaging { |
| 89 | + |
| 90 | + resources { |
| 91 | + |
| 92 | + excludes += "META-INF/versions/9/previous-compilation-data.bin" |
| 93 | + excludes += "META-INF/*.kotlin_module" |
| 94 | + excludes += "META-INF/AL2.0" |
| 95 | + excludes += "META-INF/LGPL2.1" |
| 96 | + excludes += "META-INF/androidx.*.version" |
| 97 | + excludes += "**/*.proto" |
| 98 | + } |
| 99 | + |
| 100 | + jniLibs { |
| 101 | + useLegacyPackaging = true |
| 102 | + } |
| 103 | + } |
| 104 | + |
44 | 105 | compileOptions { |
| 106 | + |
45 | 107 | sourceCompatibility = JavaVersion.toVersion(project.property("javaVersion").toString()) |
| 108 | + |
46 | 109 | targetCompatibility = JavaVersion.toVersion(project.property("javaVersion").toString()) |
47 | 110 | } |
| 111 | + |
48 | 112 | kotlinOptions { |
| 113 | + |
49 | 114 | jvmTarget = project.property("jvmTarget").toString() |
50 | 115 | } |
| 116 | + |
51 | 117 | buildFeatures { |
| 118 | + |
52 | 119 | compose = true |
| 120 | + |
| 121 | + buildConfig = true |
53 | 122 | } |
| 123 | + |
| 124 | + bundle { |
| 125 | + language { |
| 126 | + enableSplit = true |
| 127 | + } |
| 128 | + density { |
| 129 | + enableSplit = true |
| 130 | + } |
| 131 | + abi { |
| 132 | + enableSplit = true |
| 133 | + } |
| 134 | + } |
| 135 | + |
54 | 136 | testOptions { |
| 137 | + |
55 | 138 | unitTests { |
| 139 | + |
56 | 140 | isIncludeAndroidResources = true |
57 | 141 | } |
58 | 142 | } |
59 | 143 | } |
| 144 | + |
60 | 145 | secrets { |
| 146 | + |
61 | 147 | // To add your Maps API key to this project: |
| 148 | + |
62 | 149 | // 1. If the secrets.properties file does not exist, create it in the same folder as the local.properties file. |
| 150 | + |
63 | 151 | // 2. Add this line, where YOUR_API_KEY is your API key: |
| 152 | + |
64 | 153 | // MAPS_API_KEY=YOUR_API_KEY |
| 154 | + |
65 | 155 | propertiesFileName = "secrets.properties" |
66 | 156 |
|
67 | 157 | // A properties file containing default secret values. This file can be |
| 158 | + |
68 | 159 | // checked in version control. |
| 160 | + |
69 | 161 | defaultPropertiesFileName = "local.defaults.properties" |
70 | 162 | } |
71 | 163 |
|
72 | 164 | dependencies { |
73 | 165 |
|
74 | 166 | implementation(libs.androidx.core.ktx) |
| 167 | + |
75 | 168 | implementation(libs.androidx.lifecycle.runtime.ktx) |
| 169 | + |
76 | 170 | implementation(libs.androidx.activity.compose) |
| 171 | + |
77 | 172 | implementation(libs.androidx.lifecycle.viewmodel.compose) |
| 173 | + |
78 | 174 | implementation(platform(libs.androidx.compose.bom)) |
| 175 | + |
79 | 176 | implementation(libs.androidx.ui) |
| 177 | + |
80 | 178 | implementation(libs.androidx.ui.graphics) |
| 179 | + |
81 | 180 | implementation(libs.androidx.ui.tooling.preview) |
| 181 | + |
82 | 182 | implementation(libs.androidx.material3) |
| 183 | + |
83 | 184 | implementation(libs.androidx.appcompat) |
| 185 | + |
84 | 186 | implementation(platform(libs.firebase.bom)) |
85 | 187 |
|
86 | 188 | // Google Maps SDK |
| 189 | + |
87 | 190 | implementation(libs.play.services.maps) |
| 191 | + |
88 | 192 | // Here Maps SDK |
| 193 | + |
89 | 194 | val hereSdkAarName: String by project |
| 195 | + |
90 | 196 | implementation(files("${rootProject.projectDir}/libs/$hereSdkAarName.aar")) |
| 197 | + |
91 | 198 | // Mapbox SDK |
| 199 | + |
92 | 200 | implementation(libs.mapbox.android) |
93 | 201 |
|
94 | 202 | // ArcGIS Maps for Kotlin - SDK dependency |
| 203 | + |
95 | 204 | implementation(libs.arcgis.maps.kotlin) |
| 205 | + |
96 | 206 | implementation(platform(libs.arcgis.maps.kotlin.toolkit.bom)) |
| 207 | + |
97 | 208 | implementation(libs.arcgis.maps.kotlin.toolkit.geoview.compose) |
| 209 | + |
98 | 210 | implementation(libs.arcgis.maps.kotlin.toolkit.authentication) |
99 | 211 |
|
100 | 212 | // Map Conductor |
| 213 | + |
101 | 214 | implementation(project(":mapconductor-core")) |
| 215 | + |
102 | 216 | implementation(project(":mapconductor-icons")) |
| 217 | + |
103 | 218 | implementation(project(":mapconductor-for-googlemaps")) |
| 219 | + |
104 | 220 | implementation(project(":mapconductor-for-here")) |
| 221 | + |
105 | 222 | implementation(project(":mapconductor-for-mapbox")) |
| 223 | + |
106 | 224 | implementation(project(":mapconductor-for-arcgis")) |
| 225 | + |
107 | 226 | implementation(libs.androidx.vectordrawable) |
| 227 | + |
108 | 228 | implementation(libs.androidx.room.runtime.android) |
109 | 229 |
|
110 | 230 | testImplementation(libs.junit) |
| 231 | + |
111 | 232 | testImplementation(libs.androidx.core) |
| 233 | + |
112 | 234 | testImplementation(libs.androidx.junit) |
| 235 | + |
113 | 236 | testImplementation(libs.androidx.runner) |
| 237 | + |
114 | 238 | androidTestImplementation(libs.androidx.junit) |
| 239 | + |
115 | 240 | androidTestImplementation(libs.androidx.espresso.core) |
| 241 | + |
116 | 242 | androidTestImplementation(platform(libs.androidx.compose.bom)) |
| 243 | + |
117 | 244 | androidTestImplementation(libs.androidx.ui.test.junit4) |
| 245 | + |
118 | 246 | debugImplementation(libs.androidx.ui.tooling) |
| 247 | + |
119 | 248 | debugImplementation(libs.androidx.ui.test.manifest) |
120 | 249 | } |
0 commit comments