Skip to content

Commit

Permalink
Merge branch 'dev' into feature/13-automatic-project-build
Browse files Browse the repository at this point in the history
# Conflicts:
#	app/build.gradle.kts
  • Loading branch information
JudjinGM committed Nov 29, 2023
2 parents fdb3ede + 8228776 commit 3a71b09
Show file tree
Hide file tree
Showing 12 changed files with 189 additions and 11 deletions.
47 changes: 36 additions & 11 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import com.android.build.gradle.internal.cxx.configure.gradleLocalProperties

import com.google.firebase.appdistribution.gradle.firebaseAppDistribution

plugins {
alias(libs.plugins.android.application)
alias(libs.plugins.android.kotlin)
Expand All @@ -9,6 +11,8 @@ plugins {
alias(libs.plugins.kotlinx.serialization)
alias(libs.plugins.firebase.crashlytics.gradle)
alias(libs.plugins.gms.googleServices)
alias(libs.plugins.firebase.appdistribution)

}

android {
Expand Down Expand Up @@ -65,6 +69,14 @@ android {
proguardFiles(
getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro"
)

}

firebaseAppDistribution{
artifactType = "APK"
releaseNotesFile = "app/src/stage/qa/releaseNotes.txt"
testers = "QA"

signingConfig = signingConfigs.getByName("release")
}
}
Expand Down Expand Up @@ -95,57 +107,70 @@ android {
}
}

task("appDistirbutionToQaStageQa") {
dependsOn("assembleStageQa")
dependsOn("appDistributionUploadStageQa")
}

task("appDistirbutionToQaProdQa") {
dependsOn("assembleProdQa")
dependsOn("appDistributionUploadProdQa")
}

dependencies {

// Core
// Core
implementation(libs.androidx.core.ktx)
implementation(libs.androidx.appcompat)
implementation(libs.material)
implementation(libs.androidx.constraintlayout)

// Hilt
// Hilt
implementation(libs.hilt.android)
kapt(libs.hilt.android.compiler)

// Coroutines
// Coroutines
implementation(libs.kotlinx.coroutines.android)

// Room
// Room
ksp(libs.androidx.room.compiler)
implementation(libs.androidx.room.runtime)
implementation(libs.androidx.room.ktx)

// Navigation Component
// Navigation Component
implementation(libs.androidx.navigation.fragment.ktx)
implementation(libs.androidx.navigation.ui.ktx)
implementation(libs.androidx.fragment.ktx)

// Glide
// Glide
implementation(libs.glide)
annotationProcessor(libs.compiler)

// Timber
// Timber
implementation(libs.timber)

// ViewModel + Lifecycle
// ViewModel + Lifecycle
implementation(libs.androidx.lifecycle.viewmodel.ktx)
implementation(libs.androidx.activity.ktx)

// Network
// Network
implementation(libs.retrofit)
implementation(libs.kotlinx.serialization.json)
implementation(libs.okhttp)
implementation(libs.logging.interceptor)

// Test
// Test
testImplementation(libs.junit)
androidTestImplementation(libs.androidx.junit)
androidTestImplementation(libs.androidx.espresso.core)

//Firebase
//Firebase
implementation(libs.firebase.crashlytics)
implementation(libs.firebase.analytics)
implementation(platform(libs.firebase.bom))

// Ui Kit Library
implementation(project(":uikit"))
}

kapt {
Expand Down
Empty file.
2 changes: 2 additions & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,6 @@ plugins {
alias(libs.plugins.org.jetbrains.kotlin.kapt) apply false
alias(libs.plugins.firebase.crashlytics.gradle) apply false
alias(libs.plugins.gms.googleServices) apply false
alias(libs.plugins.firebase.appdistribution) apply false
alias(libs.plugins.android.library) apply false
}
14 changes: 14 additions & 0 deletions settings.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,9 @@ dependencyResolutionManagement {
version("firebase-crashlytics-gradle", "2.9.9")
version("firebase-bom", "32.6.0")
version("gms-googleServices", "4.4.0")
version("firebase.appdistribution", "4.0.1")
version("android-library", "8.1.1")


plugin(
"android-application",
Expand Down Expand Up @@ -84,6 +87,16 @@ dependencyResolutionManagement {
"com.google.firebase.crashlytics"
).versionRef("firebase-crashlytics-gradle")

plugin(
"firebase.appdistribution",
"com.google.firebase.appdistribution"
).versionRef("firebase.appdistribution")

plugin(
"android-library",
"com.android.library"
).versionRef("android-library")

// Core
library(
"androidx-core-ktx",
Expand Down Expand Up @@ -283,3 +296,4 @@ dependencyResolutionManagement {

rootProject.name = "Cash Advisor"
include(":app")
include(":uikit")
1 change: 1 addition & 0 deletions uikit/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/build
43 changes: 43 additions & 0 deletions uikit/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
plugins {
alias(libs.plugins.android.library)
alias(libs.plugins.android.kotlin)
}

android {
namespace = "app.cashadvisor.uikit"
compileSdk = 34

defaultConfig {
minSdk = 23

testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
consumerProguardFiles("consumer-rules.pro")
}

buildTypes {
release {
isMinifyEnabled = false
proguardFiles(
getDefaultProguardFile("proguard-android-optimize.txt"),
"proguard-rules.pro"
)
}
}
compileOptions {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}
kotlinOptions {
jvmTarget = "1.8"
}
}

dependencies {

implementation(libs.androidx.core.ktx)
implementation(libs.androidx.appcompat)
implementation(libs.material)
testImplementation(libs.junit)
androidTestImplementation(libs.androidx.junit)
androidTestImplementation(libs.androidx.espresso.core)
}
Empty file added uikit/consumer-rules.pro
Empty file.
21 changes: 21 additions & 0 deletions uikit/proguard-rules.pro
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# 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
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
package app.cashadvisor.uikit

import androidx.test.platform.app.InstrumentationRegistry
import androidx.test.ext.junit.runners.AndroidJUnit4

import org.junit.Test
import org.junit.runner.RunWith

import org.junit.Assert.*

/**
* Instrumented test, which will execute on an Android device.
*
* See [testing documentation](http://d.android.com/tools/testing).
*/
@RunWith(AndroidJUnit4::class)
class ExampleInstrumentedTest {
@Test
fun useAppContext() {
// Context of the app under test.
val appContext = InstrumentationRegistry.getInstrumentation().targetContext
assertEquals("app.cashadvisor.uikit.test", appContext.packageName)
}
}
4 changes: 4 additions & 0 deletions uikit/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android">

</manifest>
27 changes: 27 additions & 0 deletions uikit/src/main/res/values/color_attrs.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>

// White and Black
<attr name="colour1" format="color" />
<attr name="bg1" format="color" />
<attr name="bg2" format="color" />
<attr name="subcolour1" format="color" />
<attr name="subcolour2" format="color" />
<attr name="colour2" format="color" />

// Semantic
<attr name="m1" format="color" />
<attr name="m2" format="color" />
<attr name="m3" format="color" />
<attr name="m4" format="color" />
<attr name="m5" format="color" />
<attr name="m6" format="color" />
<attr name="m7" format="color" />
<attr name="m8" format="color" />
<attr name="m9" format="color" />

<attr name="sm1" format="color" />
<attr name="sm2" format="color" />
<attr name="sm5" format="color" />

</resources>
17 changes: 17 additions & 0 deletions uikit/src/test/java/app/cashadvisor/uikit/ExampleUnitTest.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
package app.cashadvisor.uikit

import org.junit.Test

import org.junit.Assert.*

/**
* Example local unit test, which will execute on the development machine (host).
*
* See [testing documentation](http://d.android.com/tools/testing).
*/
class ExampleUnitTest {
@Test
fun addition_isCorrect() {
assertEquals(4, 2 + 2)
}
}

0 comments on commit 3a71b09

Please sign in to comment.