Skip to content

Commit

Permalink
Setup dependencies and firebase
Browse files Browse the repository at this point in the history
  • Loading branch information
andraantariksa committed Apr 3, 2022
1 parent 6d10cce commit 1cc3238
Show file tree
Hide file tree
Showing 6 changed files with 124 additions and 21 deletions.
46 changes: 26 additions & 20 deletions app/build.gradle
Original file line number Diff line number Diff line change
@@ -1,8 +1,16 @@
plugins {
id 'com.android.application'
id 'org.jetbrains.kotlin.android'
id 'kotlin-android'
id 'kotlin-kapt'
id "dagger.hilt.android.plugin"
id 'com.google.gms.google-services'
id 'com.google.firebase.crashlytics'
}

apply from: 'script/versioning.gradle'

ext {
versionName = "0.0.1-dev"
}

android {
Expand All @@ -12,22 +20,18 @@ android {
applicationId "id.shaderboi.koffie"
minSdk 21
targetSdk 32
versionCode 1
versionName "1.0"
versionCode buildVersionCode(project.versionName)
versionName project.versionName

testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"

buildConfigField "String", "MIDTRANS_API", "\"SB-Mid-client-FGDd5FsG_5p0EiWB\""
}

buildTypes {
debug {
buildConfigField "String", "MIDTRANS_API", "Mid-client-ezhmz-zycV9jTa5b"
}

release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'

buildConfigField "String", "MIDTRANS_API", "SB-Mid-client-FGDd5FsG_5p0EiWB"
}
}
buildFeatures {
Expand Down Expand Up @@ -55,8 +59,9 @@ dependencies {
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-android:$coroutineVersion"

// Firebase
implementation platform('com.google.firebase:firebase-bom:28.1.0')
implementation platform('com.google.firebase:firebase-bom:29.3.0')
implementation 'com.google.firebase:firebase-analytics-ktx'
implementation 'com.google.firebase:firebase-auth-ktx:'
implementation 'com.google.firebase:firebase-crashlytics-ktx'

// Network
Expand All @@ -67,16 +72,6 @@ dependencies {
implementation "com.squareup.moshi:moshi:$moshiVersion"
kapt "com.squareup.moshi:moshi-kotlin-codegen:$moshiVersion"

implementation "androidx.core:core-splashscreen:1.0.0-beta02"

implementation "com.airbnb.android:lottie:$lottieVersion"

implementation "androidx.preference:preference:1.2.0"

debugImplementation "com.midtrans:uikit:1.28.0-SANDBOX"
implementation "com.midtrans:uikit:1.28.0"
implementation 'com.google.android.flexbox:flexbox:3.0.0'

// Hilt
implementation "com.google.dagger:hilt-android:$hiltVersion"
kapt "com.google.dagger:hilt-compiler:$hiltVersion"
Expand All @@ -87,6 +82,17 @@ dependencies {
// Logger
implementation 'com.jakewharton.timber:timber:5.0.1'


implementation "androidx.core:core-splashscreen:1.0.0-beta02"

implementation "com.airbnb.android:lottie:$lottieVersion"

implementation "androidx.preference:preference-ktx:1.2.0"

// debugImplementation "com.midtrans:uikit:1.31.0-SANDBOX"
implementation "com.midtrans:uikit:1.31.0"
implementation 'com.google.android.flexbox:flexbox:3.0.0'

implementation 'androidx.core:core-ktx:1.7.0'
implementation 'androidx.appcompat:appcompat:1.4.1'
implementation 'com.google.android.material:material:1.5.0'
Expand Down
39 changes: 39 additions & 0 deletions app/google-services.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
{
"project_info": {
"project_number": "725480389193",
"project_id": "koffie-f7a6c",
"storage_bucket": "koffie-f7a6c.appspot.com"
},
"client": [
{
"client_info": {
"mobilesdk_app_id": "1:725480389193:android:e80fbcb1661541e8eb1d98",
"android_client_info": {
"package_name": "id.shaderboi.koffie"
}
},
"oauth_client": [
{
"client_id": "725480389193-mfihmtgvhb6qoebab9r84v97n3v7jd9c.apps.googleusercontent.com",
"client_type": 3
}
],
"api_key": [
{
"current_key": "AIzaSyCdjwYHL7TIpqmz_ONbGICRdPVHHY14kFY"
}
],
"services": {
"appinvite_service": {
"other_platform_oauth_client": [
{
"client_id": "725480389193-mfihmtgvhb6qoebab9r84v97n3v7jd9c.apps.googleusercontent.com",
"client_type": 3
}
]
}
}
}
],
"configuration_version": "1"
}
54 changes: 54 additions & 0 deletions app/script/versioning.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
ext {
buildVersionCode = { String versionName ->
/**
* Here is representation of Version code generation from version name.
*
* *--------- major version
* | *------ minor version
* | | *--- patch version
* | | |*-- buildType (dev/alpha/beta/rc/release)
* | | ||*- flavor - disabled.
* | | |||
* X00X00XXX
* so
* 1.13.20-alpha-v19 = 10130201
* see details below:
* *--------- 1 is major version
* | *------ 13 is minor version
* | | *--- 20 is patch version
* | | |*-- type 1 is alpha.
* | | ||*- flavor 0 (disabled)
* | | |||
* 101302010
*/

def (mainPart, typeName) = versionName.toLowerCase().tokenize('-')

if (typeName == null) {
type = "9"
} else if (typeName == "dev") {
type = "0"
} else if (typeName == "alpha") {
type = "1"
} else if (typeName == "beta") {
type = "2"
} else {
println("Unknown build type = " + typeName + ". Please look into app/versioning.gradle.")
throw new RuntimeException("Unknown type = " + typeName)
}

flavor = "0" // disabled

int flavorDigit = 1
int typeDigit = flavorDigit * 10
int patchDigit = typeDigit * 10
int minorDigit = patchDigit * 1000
int majorDigit = minorDigit * 1000

def (major, minor, patch) = mainPart.tokenize('.')
(major, minor, patch, type, flavor) = [major, minor, patch, type, flavor].collect {
it.toInteger()
}
(major * majorDigit) + (minor * minorDigit) + (patch * patchDigit) + (type * typeDigit) + (flavor * flavorDigit)
}
}
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ buildscript {
retrofitVersion = "2.9.0"
}
dependencies {
classpath "com.xendit:xendit-android:2.2.0"
classpath 'com.android.tools.build:gradle:7.1.2'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.6.10"
classpath "com.google.gms:google-services:4.3.10"
classpath 'com.google.firebase:firebase-crashlytics-gradle:2.8.1'
classpath "com.google.dagger:hilt-android-gradle-plugin:$hiltVersion"
}
}
Expand Down
2 changes: 2 additions & 0 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ org.gradle.jvmargs=-Xmx2048m -Dfile.encoding=UTF-8
# Android operating system, and which are packaged with your app"s APK
# https://developer.android.com/topic/libraries/support-library/androidx-rn
android.useAndroidX=true
# Automatically convert third-party libraries to use AndroidX
android.enableJetifier=true
# Kotlin code style for this project: "official" or "obsolete":
kotlin.code.style=official
# Enables namespacing of each library's R class so that its R class includes only the
Expand Down
2 changes: 2 additions & 0 deletions settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,15 @@ pluginManagement {
gradlePluginPortal()
google()
mavenCentral()
maven { url 'https://jitpack.io' }
}
}
dependencyResolutionManagement {
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
repositories {
google()
mavenCentral()
maven { url 'https://jitpack.io' }
}
}
rootProject.name = "Koffie"
Expand Down

0 comments on commit 1cc3238

Please sign in to comment.