Skip to content

Commit

Permalink
Merge pull request #32 from sheikh-20/develop
Browse files Browse the repository at this point in the history
toml file updated
  • Loading branch information
sheikh-20 authored Feb 19, 2024
2 parents dfaa19b + 141f1fc commit 740f791
Show file tree
Hide file tree
Showing 4 changed files with 120 additions and 72 deletions.
107 changes: 61 additions & 46 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,22 @@ android {
namespace = "com.application.moviesapp"
compileSdk = 33

signingConfigs {
create("config") {
keyAlias = "moviesapp"
keyPassword = "Sheikh"
storeFile = file("/media/sheikh/hdd/AndroidStudioProjects/AndroidStudioProjects/MoviesApp/app/keystore.jks")
storePassword = "Sheikh"
enableV4Signing = true
}
}

defaultConfig {
applicationId = "com.application.moviesapp"
minSdk = 24
targetSdk = 33
versionCode = 1
versionName = "1.0"
versionName = "1.0.0"

testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
vectorDrawables {
Expand All @@ -61,8 +71,10 @@ android {
buildConfig = true
}
buildTypes {
debug {
getByName("debug") {
isDebuggable = true
isMinifyEnabled = false

val TEST_API_KEY: String by project
val FACEBOOK_APP_ID: String by project
val YOUTUBE_API_KEY: String by project
Expand All @@ -75,10 +87,11 @@ android {
resValue("string", "FACEBOOK_APP_ID", FACEBOOK_APP_ID)

}
release {

getByName("release") {
isDebuggable = false
isMinifyEnabled = false
isMinifyEnabled = true
isShrinkResources = true

proguardFiles(
getDefaultProguardFile("proguard-android-optimize.txt"),
"proguard-rules.pro"
Expand All @@ -93,6 +106,8 @@ android {
buildConfigField(type = "String", name = "YOUTUBE_API_KEY", value = YOUTUBE_API_KEY)
buildConfigField(type = "String", name = "YOUTUBE_BASE_URL", value = "\"https://youtube.googleapis.com/\"")
resValue("string", "FACEBOOK_APP_ID", FACEBOOK_APP_ID)

signingConfig = signingConfigs.getByName("config")
}
}
compileOptions {
Expand All @@ -111,66 +126,66 @@ android {
}
}

flavorDimensions += "pyVersion"
productFlavors {
create("py310") { dimension = "pyVersion" }
create("py311") { dimension = "pyVersion" }
}
// flavorDimensions += "pyVersion"
// productFlavors {
// create("py310") { dimension = "pyVersion" }
// create("py311") { dimension = "pyVersion" }
// }
}

dependencies {
implementation("com.google.firebase:firebase-crashlytics:18.6.0")
implementation("com.google.firebase:firebase-analytics:21.5.0")
implementation("com.google.firebase:firebase-database:20.3.0")
implementation("com.google.firebase:firebase-storage:20.3.0")
implementation("com.google.firebase:firebase-messaging:23.4.0")

// core
implementation(libs.androidx.core.ktx)
implementation(libs.androidx.activity.compose)
implementation(libs.androidx.lifecycle.runtime.ktx)
implementation(libs.androidx.lifecycle.runtime.compose)
implementation(platform(libs.compose.bom))
implementation(libs.bundles.compose)

val lifecycle_version = "2.6.1"
val timber_version = "5.0.1"
val lottie_version = "6.1.0"
val paging_version = "3.2.1"
val room_version = "2.5.2"
val firebase_version = "22.1.1"

implementation(platform("androidx.compose:compose-bom:2023.03.00"))
implementation(platform("androidx.compose:compose-bom:2023.03.00"))
androidTestImplementation(platform("androidx.compose:compose-bom:2023.03.00"))
androidTestImplementation(platform("androidx.compose:compose-bom:2023.03.00"))
implementation("androidx.core:core-ktx:1.9.0")
implementation("androidx.lifecycle:lifecycle-runtime-ktx:2.6.1")

// Lifecycle
implementation("androidx.lifecycle:lifecycle-runtime-compose:2.6.2")
implementation("androidx.activity:activity-compose:1.7.2")
implementation(platform("androidx.compose:compose-bom:2023.03.00"))
implementation("androidx.compose.ui:ui")
implementation("androidx.compose.ui:ui-graphics")
implementation("androidx.compose.ui:ui-tooling-preview")
implementation("androidx.compose.material3:material3:1.2.0-alpha05")

testImplementation("junit:junit:4.13.2")
androidTestImplementation("androidx.test.ext:junit:1.1.5")
androidTestImplementation("androidx.test.espresso:espresso-core:3.5.1")
androidTestImplementation(platform("androidx.compose:compose-bom:2023.03.00"))
androidTestImplementation("androidx.compose.ui:ui-test-junit4")
debugImplementation("androidx.compose.ui:ui-tooling")
debugImplementation("androidx.compose.ui:ui-test-manifest")

implementation("androidx.core:core-splashscreen:1.1.0-alpha01")
// material3
implementation(libs.compose.material3)

// test
testImplementation(libs.junit)
androidTestImplementation(libs.androidx.junit)
androidTestImplementation(libs.androidx.espresso.core)
androidTestImplementation(platform(libs.compose.bom))
androidTestImplementation(libs.compose.junit)
debugImplementation(libs.compose.ui.tooling)
debugImplementation(libs.compose.test.manifest)

// firebase
implementation(libs.firebase.crashlytics)
implementation(libs.firebase.analytics)
implementation(libs.firebase.database)
implementation(libs.firebase.storage)
implementation(libs.firebase.messaging)

// splash
implementation(libs.androidx.core.splashscreen)

// Dagger - Hilt
implementation("com.google.dagger:hilt-android:2.44")
kapt("com.google.dagger:hilt-android-compiler:2.44")
implementation("androidx.hilt:hilt-navigation-compose:1.0.0")
implementation(libs.dagger.hilt)
kapt(libs.dagger.hilt.compiler)
implementation(libs.dagger.nav.compose)

// ViewModel with ktx
implementation("androidx.lifecycle:lifecycle-viewmodel-ktx:$lifecycle_version")
implementation(libs.androidx.lifecycle.viewmodel.ktx)

// Compose viewmodel utility
implementation("androidx.lifecycle:lifecycle-viewmodel-compose:$lifecycle_version")
implementation(libs.androidx.lifecycle.viewmodel.compose)


// Timber for log
implementation("com.jakewharton.timber:timber:$timber_version")
implementation(libs.timber)

// Retrofit
implementation("com.squareup.retrofit2:retrofit:2.9.0")
Expand Down
72 changes: 51 additions & 21 deletions app/proguard-rules.pro
Original file line number Diff line number Diff line change
@@ -1,21 +1,51 @@
# Add project specific ProGuard rules here.
# You can control the set of applied configuration files using the
# proguardFiles setting in build.gradle.
#
# For more details, see
# http://developer.android.com/guide/developing/tools/proguard.html

# If your project uses WebView with JS, uncomment the following
# and specify the fully qualified class name to the JavaScript interface
# class:
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
# public *;
#}

# Uncomment this to preserve the line number information for
# debugging stack traces.
#-keepattributes SourceFile,LineNumberTable

# If you keep the line number information, uncomment this to
# hide the original source file name.
#-renamesourcefileattribute SourceFile
##---------------Begin: proguard configuration for Gson ----------
# Gson uses generic type information stored in a class file when working with fields. Proguard
# removes such information by default, so configure it to keep all of it.
-keepattributes Signature

# For using GSON @Expose annotation
-keepattributes *Annotation*

# Gson specific classes
-dontwarn sun.misc.**
#-keep class com.google.gson.stream.** { *; }

# Application classes that will be serialized/deserialized over Gson
-keep class com.application.moviesapp.domain.model.** { <fields>; }

# Prevent proguard from stripping interface information from TypeAdapter, TypeAdapterFactory,
# JsonSerializer, JsonDeserializer instances (so they can be used in @JsonAdapter)
-keep class * extends com.google.gson.TypeAdapter
-keep class * implements com.google.gson.TypeAdapterFactory
-keep class * implements com.google.gson.JsonSerializer
-keep class * implements com.google.gson.JsonDeserializer

# Prevent R8 from leaving Data object members always null
-keepclassmembers,allowobfuscation class * {
@com.google.gson.annotations.SerializedName <fields>;
}

# Retain generic signatures of TypeToken and its subclasses with R8 version 3.0 and higher.
-keep,allowobfuscation,allowshrinking class com.google.gson.reflect.TypeToken
-keep,allowobfuscation,allowshrinking class * extends com.google.gson.reflect.TypeToken

##---------------End: proguard configuration for Gson ----------


# Keep generic signature of Call, Response (R8 full mode strips signatures from non-kept items).
-keep,allowobfuscation,allowshrinking interface retrofit2.Call
-keep,allowobfuscation,allowshrinking class retrofit2.Response
-keep class com.application.moviesapp.data** {
*;
}


# With R8 full mode generic signatures are stripped for classes that are not
# kept. Suspend functions are wrapped in continuations where the type argument
# is used.
-keep,allowobfuscation,allowshrinking class kotlin.coroutines.Continuation

-dontwarn javax.annotation.Nullable
-dontwarn javax.annotation.ParametersAreNonnullByDefault

-keep class * extends com.google.protobuf.GeneratedMessageLite { *; }
4 changes: 3 additions & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,10 @@ android.nonTransitiveRClass=true
android.defaults.buildfeatures.buildconfig=true

TEST_API_KEY="eyJhbGciOiJIUzI1NiJ9.eyJhdWQiOiI2Nzc1YTNlOTcwY2M5OWNlMjliNTYzYTk2NWZhNTMwOSIsInN1YiI6IjY0YzIyMjYxZGY4NmE4MDEyNTgyZTdlYiIsInNjb3BlcyI6WyJhcGlfcmVhZCJdLCJ2ZXJzaW9uIjoxfQ.ni0jCHekgotLCOb_krhgZYa0ss-aDpW39W8tOYXFowk"
PRO_API_KEY=""
PRO_API_KEY="eyJhbGciOiJIUzI1NiJ9.eyJhdWQiOiI2Nzc1YTNlOTcwY2M5OWNlMjliNTYzYTk2NWZhNTMwOSIsInN1YiI6IjY0YzIyMjYxZGY4NmE4MDEyNTgyZTdlYiIsInNjb3BlcyI6WyJhcGlfcmVhZCJdLCJ2ZXJzaW9uIjoxfQ.ni0jCHekgotLCOb_krhgZYa0ss-aDpW39W8tOYXFowk"

YOUTUBE_API_KEY="AIzaSyAuxwNxSnaIhzvOTvQMpxC0pPU8REsuPSU"

FACEBOOK_APP_ID="201783502905844"

android.injected.testOnly=false
9 changes: 5 additions & 4 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
[versions]
activity-compose = "1.8.2"
accompanist-flowlayout = "0.32.0"
accompanist-pager = "0.28.0"
accompanist-permissions = "0.23.1"
accompanist-systemuicontroller = "0.31.6-rc"
activity-compose = "1.8.2"
androidx-junit = "1.1.5"
androidx-media3-ui = "1.2.0-rc01"
coil-compose = "2.4.0"
Expand Down Expand Up @@ -51,6 +51,7 @@ chaquopy-version = "15.0.0"
protobuf-version = "0.9.1"
crashlytics = "2.9.9"
gradle-tool = "7.3.1"
material3-version = "1.2.0-alpha05"

[libraries]
accompanist-flowlayout = { module = "com.google.accompanist:accompanist-flowlayout", version.ref = "accompanist-flowlayout" }
Expand Down Expand Up @@ -107,7 +108,7 @@ timber = { module = "com.jakewharton.timber:timber", version.ref = "timber_versi

dagger-hilt = { module = "com.google.dagger:hilt-android", version.ref = "hilt-version" }
dagger-hilt-compiler = { module = "com.google.dagger:hilt-android-compiler", version.ref = "hilt-version" }
nav_compose = { module = "androidx.hilt:hilt-navigation-compose", version.ref = "nav_compose_version"}
dagger_nav_compose = { module = "androidx.hilt:hilt-navigation-compose", version.ref = "nav_compose_version"}
androidx-hilt-compiler = { module = "androidx.hilt:hilt-compiler", version.ref = "nav_compose_version" }
androidx-hilt-work = { module = "androidx.hilt:hilt-work", version.ref = "nav_compose_version" }

Expand All @@ -116,7 +117,7 @@ compose-bom = { module = "androidx.compose:compose-bom", version.ref = "bom" }
compose-ui = { module = "androidx.compose.ui:ui" }
compose-ui-graphics = { module = "androidx.compose.ui:ui-graphics" }
compose-ui-preview = { module = "androidx.compose.ui:ui-tooling-preview" }
compose-material3 = { module = "androidx.compose.ui:ui-tooling-preview" }
compose-material3 = { module = "androidx.compose.material3:material3", version.ref = "material3-version" }

#test
junit = { module = "junit:junit", version.ref = "junit" }
Expand All @@ -129,7 +130,7 @@ compose-test-manifest = { module = "androidx.compose.ui:ui-test-manifest" }
gradle = { module = "com.android.tools.build:gradle", version.ref = "gradle-tool" }

[bundles]
compose = [ "compose-ui", "compose-ui-graphics", "compose-ui-preview", "compose-material3" ]
compose = [ "compose-ui", "compose-ui-graphics", "compose-ui-preview" ]

[plugins]
android-application = { id = "com.android.application", version.ref = "android-gradle" }
Expand Down

0 comments on commit 740f791

Please sign in to comment.