11import  com.google.firebase.crashlytics.buildtools.gradle.CrashlyticsExtension 
2+ import  java.io.FileInputStream 
23import  java.text.SimpleDateFormat 
3- import  java.util.* 
4+ import  java.util.Date 
5+ import  java.util.Locale 
6+ import  java.util.Properties 
47
58plugins {
69    id(" com.android.application"  )
@@ -17,12 +20,15 @@ plugins {
1720
1821android {
1922    namespace =  " com.example.moviedb" 
23+     val  appId =  " com.example.moviedb" 
2024    defaultConfig {
21-         applicationId =  " com.example.moviedb " 
22-         buildToolsVersion =  " 34 .0.0" 
25+         applicationId =  appId 
26+         buildToolsVersion =  " 35 .0.0-rc3 " 
2327        minSdk =  23 
24-         compileSdk =  34 
25-         targetSdk =  34 
28+ //         compileSdk = 34
29+ //         targetSdk = 34
30+         compileSdkPreview =  " VanillaIceCream" 
31+         targetSdkPreview =  " VanillaIceCream" 
2632        multiDexEnabled =  true 
2733        vectorDrawables {
2834            useSupportLibrary =  true 
@@ -35,6 +41,21 @@ android {
3541        )
3642        testInstrumentationRunner =  " androidx.test.runner.AndroidJUnitRunner" 
3743    }
44+     //  check signingKey cmd ./gradlew signingReport
45+     val  signingKeyInfoFile =  rootProject.file(" signing/release.properties"  )
46+     val  signingKeyName =  " release-key" 
47+     if  (signingKeyInfoFile.exists()) {
48+         val  releaseProperties =  Properties ()
49+         releaseProperties.load(FileInputStream (signingKeyInfoFile))
50+         signingConfigs {
51+             create(signingKeyName) {
52+                 storeFile =  releaseProperties[" keystore"  ]?.let  { rootProject.file(it) }
53+                 storePassword =  releaseProperties[" storePassword"  ]?.toString()
54+                 keyAlias =  releaseProperties[" keyAlias"  ]?.toString()
55+                 keyPassword =  releaseProperties[" keyPassword"  ]?.toString()
56+             }
57+         }
58+     }
3859    buildTypes {
3960        getByName(" debug"  ) {
4061            isDebuggable =  true 
@@ -43,6 +64,7 @@ android {
4364            configure<CrashlyticsExtension > {
4465                mappingFileUploadEnabled =  false 
4566            }
67+             signingConfig =  signingConfigs.getByName(signingKeyName)
4668        }
4769        /* create("beta") {
4870            isDebuggable = true 
@@ -52,6 +74,7 @@ android {
5274                mappingFileUploadEnabled = true 
5375            } 
5476            proguardFiles(getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro") 
77+             signingConfig = signingConfigs.getByName(signingKeyName) 
5578        }*/  
5679        getByName(" release"  ) {
5780            isDebuggable =  false 
@@ -61,66 +84,39 @@ android {
6184                mappingFileUploadEnabled =  true 
6285            }
6386            proguardFiles(getDefaultProguardFile(" proguard-android.txt"  ), " proguard-rules.pro"  )
87+             signingConfig =  signingConfigs.getByName(signingKeyName)
6488        }
6589    }
66- 
6790    val  serverDimension =  " server" 
68-     flavorDimensions.addAll(listOf (serverDimension))
91+     val  devServer =  " dev" 
92+     val  prdServer =  " prd" 
93+     flavorDimensions.add(serverDimension)
6994    productFlavors {
70-         create(" dev "  ) {
95+         create(devServer ) {
7196            dimension =  serverDimension
7297            applicationIdSuffix =  " .dev" 
7398            resValue(" string"  , " app_name"  , " Movie DB Dev"  )
7499            buildConfigField(" boolean"  , " MOCK_DATA"  , " true"  )
75-             val  keyFile =  rootProject.file(" signing/debug.properties"  )
76-             if  (keyFile.exists()) {
77-                 val  properties =  Properties ()
78-                 properties.load(keyFile.inputStream())
79-                 val  signKeyName =  " dev-key" 
80-                 signingConfigs {
81-                     create(signKeyName) {
82-                         storeFile =  properties[" keystore"  ]?.let  { rootProject.file(it) }
83-                         storePassword =  properties[" storePassword"  ]?.toString()
84-                         keyAlias =  properties[" keyAlias"  ]?.toString()
85-                         keyPassword =  properties[" keyPassword"  ]?.toString()
86-                     }
87-                 }
88-                 signingConfig =  signingConfigs.getByName(signKeyName)
89-             }
90100        }
91-         create(" prd "  ) {
101+         create(prdServer ) {
92102            dimension =  serverDimension
93103            resValue(" string"  , " app_name"  , " Movie DB"  )
94104            buildConfigField(" boolean"  , " MOCK_DATA"  , " false"  )
95-             val  keyFile =  rootProject.file(" signing/release.properties"  )
96-             if  (keyFile.exists()) {
97-                 val  properties =  Properties ()
98-                 properties.load(keyFile.inputStream())
99-                 val  signKeyName =  " prd-key" 
100-                 signingConfigs {
101-                     create(signKeyName) {
102-                         storeFile =  properties[" keystore"  ]?.let  { rootProject.file(it) }
103-                         storePassword =  properties[" storePassword"  ]?.toString()
104-                         keyAlias =  properties[" keyAlias"  ]?.toString()
105-                         keyPassword =  properties[" keyPassword"  ]?.toString()
106-                     }
107-                 }
108-                 signingConfig =  signingConfigs.getByName(signKeyName)
109-             }
110105        }
111106    }
112- 
113107    applicationVariants.all {
108+         //  need Rebuild Project to apply changes
114109        buildConfigField(" String"  , " BASE_URL"  , " \" https://api.themoviedb.org/\" "  )
110+         buildConfigField(" String"  , " PLAY_STORE_APP_ID"  , " \" $appId \" "  )
115111        buildConfigField(" String"  , " SMALL_IMAGE_URL"  , " \" https://image.tmdb.org/t/p/w200\" "  )
116112        buildConfigField(" String"  , " LARGE_IMAGE_URL"  , " \" https://image.tmdb.org/t/p/w500\" "  )
117113        buildConfigField(" String"  , " ORIGINAL_IMAGE_URL"  , " \" https://image.tmdb.org/t/p/original\" "  )
118114        buildConfigField(" String"  , " TMBD_API_KEY"  , " \" 2cdf3a5c7cf412421485f89ace91e373\" "  )
119115        when  (flavorName) {
120-             " dev "   ->  {
116+             devServer  ->  {
121117            }
122118
123-             " prd "   ->  {
119+             prdServer  ->  {
124120            }
125121        }
126122    }
@@ -153,43 +149,43 @@ dependencies {
153149    implementation(" androidx.legacy:legacy-support-v4:1.0.0"  )
154150    implementation(" androidx.constraintlayout:constraintlayout:2.1.4"  )
155151    implementation(" androidx.recyclerview:recyclerview:1.3.2"  )
156-     implementation(" com.google.android.material:material:1.10 .0"  )
152+     implementation(" com.google.android.material:material:1.12 .0"  )
157153    implementation(" org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.9.20"  )
158154    implementation(" org.jetbrains.kotlin:kotlin-reflect:1.9.20"  )
159155    implementation(" androidx.multidex:multidex:2.0.1"  )
160156
161157    //  List of KTX extensions
162158    //  https://developer.android.com/kotlin/ktx/extensions-list
163-     implementation(" androidx.core:core-ktx:1.12.0 "  )
164-     implementation(" androidx.activity:activity-ktx:1.8 .0"  )
165-     implementation(" androidx.fragment:fragment-ktx:1.6.2 "  )
159+     implementation(" androidx.core:core-ktx:1.13.1 "  )
160+     implementation(" androidx.activity:activity-ktx:1.9 .0"  )
161+     implementation(" androidx.fragment:fragment-ktx:1.7.1 "  )
166162
167163    //  Lifecycle
168164    //  https://developer.android.com/jetpack/androidx/releases/lifecycle
169-     implementation(" androidx.lifecycle:lifecycle-viewmodel-ktx:2.6.2 "  )
165+     implementation(" androidx.lifecycle:lifecycle-viewmodel-ktx:2.8.0 "  )
170166//     implementation("androidx.lifecycle:lifecycle-livedata-ktx:2.6.1")
171-     implementation(" androidx.lifecycle:lifecycle-runtime-ktx:2.6.2 "  )
172-     implementation(" androidx.lifecycle:lifecycle-common-java8:2.6.2 "  )
167+     implementation(" androidx.lifecycle:lifecycle-runtime-ktx:2.8.0 "  )
168+     implementation(" androidx.lifecycle:lifecycle-common-java8:2.8.0 "  )
173169
174170    //  Preferences DataStore
175171    //  https://android-developers.googleblog.com/2020/09/prefer-storing-data-with-jetpack.html
176-     implementation(" androidx.datastore:datastore-preferences:1.0.0 "  )
172+     implementation(" androidx.datastore:datastore-preferences:1.1.1 "  )
177173
178174    //  room
179175    //  https://developer.android.com/topic/libraries/architecture/room
180-     implementation(" androidx.room:room-runtime:2.6.0 "  )
181-     ksp(" androidx.room:room-compiler:2.6.0 "  )
182-     implementation(" androidx.room:room-ktx:2.6.0 "  )
176+     implementation(" androidx.room:room-runtime:2.6.1 "  )
177+     ksp(" androidx.room:room-compiler:2.6.1 "  )
178+     implementation(" androidx.room:room-ktx:2.6.1 "  )
183179
184180    //  paging
185181    //  https://developer.android.com/topic/libraries/architecture/paging
186-     implementation(" androidx.paging:paging-runtime-ktx:3.2.1 "  )
182+     implementation(" androidx.paging:paging-runtime-ktx:3.3.0 "  )
187183
188184    //  navigation
189185    //  https://developer.android.com/jetpack/androidx/releases/navigation
190-     implementation(" androidx.navigation:navigation-runtime-ktx:2.7.5 "  )
191-     implementation(" androidx.navigation:navigation-fragment-ktx:2.7.5 "  )
192-     implementation(" androidx.navigation:navigation-ui-ktx:2.7.5 "  )
186+     implementation(" androidx.navigation:navigation-runtime-ktx:2.7.7 "  )
187+     implementation(" androidx.navigation:navigation-fragment-ktx:2.7.7 "  )
188+     implementation(" androidx.navigation:navigation-ui-ktx:2.7.7 "  )
193189
194190    //  coroutines
195191    //  https://github.com/Kotlin/kotlinx.coroutines
@@ -222,18 +218,18 @@ dependencies {
222218    ksp(" com.github.bumptech.glide:ksp:4.16.0"  )
223219
224220    //  dagger hilt
225-     implementation(" com.google.dagger:hilt-android:2.48.1 "  )
226-     ksp(" com.google.dagger:hilt-android-compiler:2.48.1 "  )
227-     implementation(" androidx.hilt:hilt-navigation-fragment:1.1 .0"  )
228-     ksp(" androidx.hilt:hilt-compiler:1.1 .0"  )
221+     implementation(" com.google.dagger:hilt-android:2.49 "  )
222+     ksp(" com.google.dagger:hilt-android-compiler:2.49 "  )
223+     implementation(" androidx.hilt:hilt-navigation-fragment:1.2 .0"  )
224+     ksp(" androidx.hilt:hilt-compiler:1.2 .0"  )
229225
230226    //  runtime permission
231227    //  https://github.com/googlesamples/easypermissions
232228    implementation(" pub.devrel:easypermissions:3.0.0"  )
233229
234230    //  firebase
235231    //  https://firebase.google.com/docs/android/setup
236-     implementation(platform(" com.google.firebase:firebase-bom:32.4 .0"  ))
232+     implementation(platform(" com.google.firebase:firebase-bom:33.0 .0"  ))
237233    implementation(" com.google.firebase:firebase-analytics-ktx"  )
238234    implementation(" com.google.firebase:firebase-crashlytics-ktx"  )
239235    implementation(" com.google.firebase:firebase-messaging-ktx"  )
@@ -247,7 +243,7 @@ dependencies {
247243    implementation(" com.jakewharton.timber:timber:5.0.1"  )
248244
249245    //  viewpager2
250-     implementation(" androidx.viewpager2:viewpager2:1.0 .0"  )
246+     implementation(" androidx.viewpager2:viewpager2:1.1 .0"  )
251247
252248    //  unit test
253249    testImplementation(" junit:junit:4.13.2"  )
@@ -256,7 +252,7 @@ dependencies {
256252    testImplementation(" io.mockk:mockk:1.13.8"  )
257253    testImplementation(" androidx.arch.core:core-testing:2.2.0"  )
258254    testImplementation(" com.squareup.okhttp3:mockwebserver:5.0.0-alpha.11"  )
259-     testImplementation(" org.jetbrains.kotlin:kotlin-stdlib:1.9.20 "  )
255+     testImplementation(" org.jetbrains.kotlin:kotlin-stdlib:1.9.22 "  )
260256//     testImplementation("org.robolectric:robolectric:4.3")
261257
262258    /* *
@@ -380,40 +376,40 @@ dependencies {
380376//     implementation("androidx.compose:compose-bom:2023.04.00")
381377//     androidTestImplementation("androidx.compose:compose-bom:2023.04.00")
382378    //  Foundation (Border, Background, Box, Image, Scroll, shapes, animations, etc.)
383-     implementation(" androidx.compose.foundation:foundation:1.5.4 "  )
379+     implementation(" androidx.compose.foundation:foundation:1.6.7 "  )
384380    //  or Material Design 2
385-     implementation(" androidx.compose.material:material:1.5.4 "  )
381+     implementation(" androidx.compose.material:material:1.6.7 "  )
386382    //  Material Design 3
387-     implementation(" androidx.compose.material3:material3:1.1.2 "  )
383+     implementation(" androidx.compose.material3:material3:1.2.1 "  )
388384    //  Android Studio Preview support
389-     implementation(" androidx.compose.ui:ui-tooling-preview:1.5.4 "  )
390-     debugImplementation(" androidx.compose.ui:ui-tooling:1.5.4 "  )
385+     implementation(" androidx.compose.ui:ui-tooling-preview:1.6.7 "  )
386+     debugImplementation(" androidx.compose.ui:ui-tooling:1.6.7 "  )
391387    //  UI Tests
392-     androidTestImplementation(" androidx.compose.ui:ui-test-junit4:1.5.4 "  )
393-     debugImplementation(" androidx.compose.ui:ui-test-manifest:1.5.4 "  )
388+     androidTestImplementation(" androidx.compose.ui:ui-test-junit4:1.6.7 "  )
389+     debugImplementation(" androidx.compose.ui:ui-test-manifest:1.6.7 "  )
394390    //  Animations
395-     implementation(" androidx.compose.animation:animation:1.5.4 "  )
391+     implementation(" androidx.compose.animation:animation:1.6.7 "  )
396392    //  Constraint layout
397393    implementation(" androidx.constraintlayout:constraintlayout-compose:1.0.1"  )
398394    //  Optional - Included automatically by material, only add when you need
399395    //  the icons but not the material library (e.g. when using Material3 or a
400396    //  custom design system based on Foundation)
401397//     implementation("androidx.compose.material:material-icons-core")
402398    //  Optional - Add full set of material icons
403-     implementation(" androidx.compose.material:material-icons-extended:1.5.4 "  )
399+     implementation(" androidx.compose.material:material-icons-extended:1.6.7 "  )
404400    //  Optional - Add window size utils
405-     implementation(" androidx.compose.material3:material3-window-size-class:1.1.2 "  )
401+     implementation(" androidx.compose.material3:material3-window-size-class:1.2.1 "  )
406402    //  Optional - Integration with activities
407-     implementation(" androidx.activity:activity-compose:1.8 .0"  )
403+     implementation(" androidx.activity:activity-compose:1.9 .0"  )
408404    //  Optional - Integration with ViewModels
409-     implementation(" androidx.lifecycle:lifecycle-viewmodel-compose:2.6.2 "  )
405+     implementation(" androidx.lifecycle:lifecycle-viewmodel-compose:2.8.0 "  )
410406    //  Optional - Integration with LiveData
411407//     implementation("androidx.compose.runtime:runtime-livedata:1.4.3")
412408    //  Lifecycle utilities for Compose
413-     implementation(" androidx.lifecycle:lifecycle-runtime-compose:2.6.2 "  )
409+     implementation(" androidx.lifecycle:lifecycle-runtime-compose:2.8.0 "  )
414410    //  navigation
415-     implementation(" androidx.navigation:navigation-compose:2.7.5 "  )
416-     implementation(" androidx.hilt:hilt-navigation-compose:1.1 .0"  )
411+     implementation(" androidx.navigation:navigation-compose:2.7.7 "  )
412+     implementation(" androidx.hilt:hilt-navigation-compose:1.2 .0"  )
417413    //  https://github.com/skydoves/landscapist
418414//     implementation("com.github.skydoves:landscape-bom:2.1.7")
419415    implementation(" com.github.skydoves:landscapist-glide:2.2.10"  )
0 commit comments