Browse Source

Build Configs

Carles Sentis 10 months ago
parent
commit
9870a73587

+ 4 - 2
app/build.gradle.kts

@@ -1,3 +1,5 @@
+import com.codeskraps.weather.ConfigData
+
 @Suppress("DSL_SCOPE_VIOLATION") // TODO: Remove once KTIJ-19369 is fixed
 plugins {
     alias(libs.plugins.android.application)
@@ -28,14 +30,14 @@ android {
 
     buildTypes {
         release {
-            isMinifyEnabled = true
+            isMinifyEnabled = ConfigData.isMinifyRelease
             proguardFiles(
                 getDefaultProguardFile("proguard-android-optimize.txt"),
                 "proguard-rules.pro"
             )
         }
         debug {
-            isMinifyEnabled = false
+            isMinifyEnabled = ConfigData.isMinifyDebug
             applicationIdSuffix = ".debug"
             versionNameSuffix = "-DEBUG"
         }

+ 0 - 5
build.gradle.kts

@@ -1,8 +1,3 @@
-buildscript {
-    dependencies {
-       //classpath(libs.secrets.gradle.plugin)
-    }
-}
 plugins {
     alias(libs.plugins.android.application) apply false
     alias(libs.plugins.android.library) apply false

+ 6 - 1
core/local/build.gradle.kts

@@ -1,3 +1,5 @@
+import com.codeskraps.weather.ConfigData
+
 @Suppress("DSL_SCOPE_VIOLATION") // TODO: Remove once KTIJ-19369 is fixed
 plugins {
     alias(libs.plugins.android.library)
@@ -19,12 +21,15 @@ android {
 
     buildTypes {
         release {
-            isMinifyEnabled = false
+            isMinifyEnabled = ConfigData.isMinifyRelease
             proguardFiles(
                 getDefaultProguardFile("proguard-android-optimize.txt"),
                 "proguard-rules.pro"
             )
         }
+        debug {
+            isMinifyEnabled = ConfigData.isMinifyDebug
+        }
     }
     compileOptions {
         sourceCompatibility = ConfigData.javaVersion

+ 6 - 1
core/location/build.gradle.kts

@@ -1,3 +1,5 @@
+import com.codeskraps.weather.ConfigData
+
 @Suppress("DSL_SCOPE_VIOLATION") // TODO: Remove once KTIJ-19369 is fixed
 plugins {
     alias(libs.plugins.android.library)
@@ -19,12 +21,15 @@ android {
 
     buildTypes {
         release {
-            isMinifyEnabled = false
+            isMinifyEnabled = ConfigData.isMinifyRelease
             proguardFiles(
                 getDefaultProguardFile("proguard-android-optimize.txt"),
                 "proguard-rules.pro"
             )
         }
+        debug {
+            isMinifyEnabled = ConfigData.isMinifyDebug
+        }
     }
     compileOptions {
         sourceCompatibility = ConfigData.javaVersion

+ 6 - 1
feature/common/build.gradle.kts

@@ -1,3 +1,5 @@
+import com.codeskraps.weather.ConfigData
+
 @Suppress("DSL_SCOPE_VIOLATION") // TODO: Remove once KTIJ-19369 is fixed
 plugins {
     alias(libs.plugins.android.library)
@@ -18,12 +20,15 @@ android {
 
     buildTypes {
         release {
-            isMinifyEnabled = false
+            isMinifyEnabled = ConfigData.isMinifyRelease
             proguardFiles(
                 getDefaultProguardFile("proguard-android-optimize.txt"),
                 "proguard-rules.pro"
             )
         }
+        debug {
+            isMinifyEnabled = ConfigData.isMinifyDebug
+        }
     }
     compileOptions {
         sourceCompatibility = ConfigData.javaVersion

+ 6 - 1
feature/geocoding/build.gradle.kts

@@ -1,3 +1,5 @@
+import com.codeskraps.weather.ConfigData
+
 @Suppress("DSL_SCOPE_VIOLATION") // TODO: Remove once KTIJ-19369 is fixed
 plugins {
     alias(libs.plugins.android.library)
@@ -21,12 +23,15 @@ android {
 
     buildTypes {
         release {
-            isMinifyEnabled = false
+            isMinifyEnabled = ConfigData.isMinifyRelease
             proguardFiles(
                 getDefaultProguardFile("proguard-android-optimize.txt"),
                 "proguard-rules.pro"
             )
         }
+        debug {
+            isMinifyEnabled = ConfigData.isMinifyDebug
+        }
     }
     compileOptions {
         sourceCompatibility = ConfigData.javaVersion

+ 6 - 1
feature/maps/build.gradle.kts

@@ -1,3 +1,5 @@
+import com.codeskraps.weather.ConfigData
+
 @Suppress("DSL_SCOPE_VIOLATION") // TODO: Remove once KTIJ-19369 is fixed
 plugins {
     alias(libs.plugins.android.library)
@@ -20,12 +22,15 @@ android {
 
     buildTypes {
         release {
-            isMinifyEnabled = false
+            isMinifyEnabled = ConfigData.isMinifyRelease
             proguardFiles(
                 getDefaultProguardFile("proguard-android-optimize.txt"),
                 "proguard-rules.pro"
             )
         }
+        debug {
+            isMinifyEnabled = ConfigData.isMinifyDebug
+        }
     }
     compileOptions {
         sourceCompatibility = ConfigData.javaVersion

+ 6 - 1
feature/weather/build.gradle.kts

@@ -1,3 +1,5 @@
+import com.codeskraps.weather.ConfigData
+
 @Suppress("DSL_SCOPE_VIOLATION") // TODO: Remove once KTIJ-19369 is fixed
 plugins {
     alias(libs.plugins.android.library)
@@ -21,12 +23,15 @@ android {
 
     buildTypes {
         release {
-            isMinifyEnabled = false
+            isMinifyEnabled = ConfigData.isMinifyRelease
             proguardFiles(
                 getDefaultProguardFile("proguard-android-optimize.txt"),
                 "proguard-rules.pro"
             )
         }
+        debug {
+            isMinifyEnabled = ConfigData.isMinifyDebug
+        }
     }
     compileOptions {
         sourceCompatibility = ConfigData.javaVersion

+ 2 - 2
feature/weather/src/main/java/com/codeskraps/feature/weather/data/mappers/WeatherMappers.kt

@@ -92,8 +92,8 @@ fun WeatherInfo.toWeatherLocation(): WeatherLocation {
     )
 }
 
-fun WeatherLocation.toGeoLocation(): com.codeskraps.core.local.domain.model.GeoLocation {
-    return com.codeskraps.core.local.domain.model.GeoLocation(
+fun WeatherLocation.toGeoLocation(): GeoLocation {
+    return GeoLocation(
         name = name,
         latitude = lat,
         longitude = long,