|
| 1 | +/* |
| 2 | + * Copyright (c) 2022(-0001) STMicroelectronics. |
| 3 | + * All rights reserved. |
| 4 | + * This software is licensed under terms that can be found in the LICENSE file in |
| 5 | + * the root directory of this software component. |
| 6 | + * If no LICENSE file comes with this software, it is provided AS-IS. |
| 7 | + */ |
| 8 | + |
| 9 | +val stLocoApiKey: String by project |
| 10 | +val stCompileSdk: Int by rootProject.extra |
| 11 | +val stMinSdk: Int by rootProject.extra |
| 12 | +val stTargetSdk: Int by rootProject.extra |
| 13 | + |
| 14 | +plugins { |
| 15 | + alias(libs.plugins.androidApplication) |
| 16 | + alias(libs.plugins.composeCompiler) |
| 17 | + alias(libs.plugins.arturboschDetekt) |
| 18 | + alias(libs.plugins.googleHilt) |
| 19 | + alias(libs.plugins.kotlinAndroid) |
| 20 | + alias(libs.plugins.kotlinSerialization) |
| 21 | + alias(libs.plugins.devtoolsKsp) |
| 22 | + alias(libs.plugins.jlleitschuhKtlint) |
| 23 | + alias(libs.plugins.appswithloveLoco) |
| 24 | + alias(libs.plugins.androidxSafeargs) |
| 25 | +} |
| 26 | + |
| 27 | +apply { |
| 28 | + from("st_dependencies.gradle") |
| 29 | +} |
| 30 | + |
| 31 | +android { |
| 32 | + namespace = "com.st.bluems" |
| 33 | + compileSdk = stCompileSdk |
| 34 | + |
| 35 | + defaultConfig { |
| 36 | + applicationId = "com.st.bluems" |
| 37 | + minSdk = stMinSdk |
| 38 | + targetSdk = stTargetSdk |
| 39 | + versionCode = 209 |
| 40 | + versionName = "5.2.4" |
| 41 | + |
| 42 | + testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" |
| 43 | + vectorDrawables { useSupportLibrary = true } |
| 44 | + |
| 45 | + manifestPlaceholders["appAuthRedirectScheme"] = "stblesensor" |
| 46 | + |
| 47 | + buildConfigField( |
| 48 | + type = "String", |
| 49 | + name = "VESPUCCI_ENVIRONMENT", |
| 50 | + value = "\"PROD\"" // "\"PRE_PROD\" ""\"DEV\"" |
| 51 | + ) |
| 52 | + } |
| 53 | + |
| 54 | + hilt { |
| 55 | + enableAggregatingTask = true |
| 56 | + } |
| 57 | + |
| 58 | + buildTypes { |
| 59 | + release { |
| 60 | + isMinifyEnabled = false |
| 61 | + |
| 62 | + proguardFiles( |
| 63 | + getDefaultProguardFile("proguard-android-optimize.txt"), |
| 64 | + "proguard-rules.pro" |
| 65 | + ) |
| 66 | + } |
| 67 | + } |
| 68 | + |
| 69 | + compileOptions { |
| 70 | + isCoreLibraryDesugaringEnabled = true |
| 71 | + sourceCompatibility = JavaVersion.VERSION_17 |
| 72 | + targetCompatibility = JavaVersion.VERSION_17 |
| 73 | + } |
| 74 | + |
| 75 | + buildFeatures { |
| 76 | + buildConfig = true |
| 77 | + compose = true |
| 78 | + viewBinding = true |
| 79 | + } |
| 80 | + |
| 81 | + composeCompiler { |
| 82 | + enableStrongSkippingMode = true |
| 83 | + } |
| 84 | + |
| 85 | + ksp { |
| 86 | + arg("room.schemaLocation", "$projectDir/schemas") |
| 87 | + arg("room.generateKotlin", "true") |
| 88 | + } |
| 89 | + |
| 90 | + packaging { resources { excludes += "/META-INF/{AL2.0,LGPL2.1}" } } |
| 91 | +} |
| 92 | + |
| 93 | +detekt { |
| 94 | + config.setFrom("../detekt-config-compose.yml") |
| 95 | +} |
| 96 | + |
| 97 | +configure<org.jlleitschuh.gradle.ktlint.KtlintExtension> { |
| 98 | + verbose.set(true) |
| 99 | + debug.set(true) |
| 100 | + android.set(true) |
| 101 | + version.set("0.22.0") |
| 102 | +} |
| 103 | + |
| 104 | +Loco { |
| 105 | + config { |
| 106 | + apiKey = stLocoApiKey |
| 107 | + // lang = ["it", "en"] // add as many languages as you want, they need to exist on localise.biz |
| 108 | + defLang = "en" |
| 109 | + fallbackLang = "en" |
| 110 | + tags = "st_bluems" |
| 111 | + resDir = "$projectDir/src/main/res" |
| 112 | + } |
| 113 | +} |
| 114 | + |
| 115 | +dependencies { |
| 116 | + // Blue ST module: |
| 117 | + // - Core |
| 118 | + implementation(project(":st_core")) |
| 119 | + // - UI |
| 120 | + implementation(project(":st_ui")) |
| 121 | + // - Preferences |
| 122 | + implementation(project(":st_preferences")) |
| 123 | + // - User Profiling |
| 124 | + implementation(project(":st_user_profiling")) |
| 125 | + // - Welcome |
| 126 | + implementation(project(":st_welcome")) |
| 127 | + // - Terms |
| 128 | + implementation(project(":st_terms")) |
| 129 | + // - Demos |
| 130 | + implementation(project(":st_demo_showcase")) |
| 131 | + // - Discover Catalog |
| 132 | + implementation(project(":st_catalog")) |
| 133 | + // - Login |
| 134 | + implementation(project(":st_login")) |
| 135 | + |
| 136 | + // Blue ST SDK |
| 137 | + implementation(libs.st.sdk) |
| 138 | + |
| 139 | + |
| 140 | + // Room |
| 141 | + implementation(libs.bundles.room) |
| 142 | + ksp(libs.androidx.room.compiler) |
| 143 | + annotationProcessor(libs.androidx.room.compiler) |
| 144 | + |
| 145 | + // Hilt |
| 146 | + implementation(libs.hilt.android) |
| 147 | + implementation(libs.hilt.navigationFragment) |
| 148 | + ksp(libs.hilt.compiler) |
| 149 | + |
| 150 | + // Dependency required for API desugaring. |
| 151 | + coreLibraryDesugaring(libs.desugar.jdk.libs.nio) |
| 152 | + |
| 153 | + debugImplementation(libs.androidx.compose.uitestmanifest) |
| 154 | +} |
0 commit comments