Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
# Comma-separated list of rules to disable (Since 0.34.0)
# Note that rules in any ruleset other than the standard ruleset will need to be prefixed
# by the ruleset identifier.
disabled_rules=import-ordering,experimental:annotation
disabled_rules=no-wildcard-imports,import-ordering,experimental:annotation
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

😍

2 changes: 1 addition & 1 deletion .github/workflows/cicd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
bundle install --path vendor/bundle
# Runs build with Gradle
- name: Build with Fastlane
run: bundle exec fastlane debug_dev
run: bundle exec fastlane debug
- name: Send notification of build result
uses: 8398a7/action-slack@v3
with:
Expand Down
6 changes: 5 additions & 1 deletion .idea/gradle.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions .idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

152 changes: 38 additions & 114 deletions app/build.gradle
Original file line number Diff line number Diff line change
@@ -1,14 +1,11 @@
apply plugin: 'com.android.application'
plugins {
id "com.android.application"
id "kotlin-android"
id "kotlin-kapt"
id "com.google.gms.google-services"
id "com.google.firebase.crashlytics"

apply plugin: 'kotlin-android'

apply plugin: 'kotlin-kapt'

apply plugin: 'dagger.hilt.android.plugin'

apply plugin: 'com.google.gms.google-services'

apply plugin: 'com.google.firebase.crashlytics'
}

android {
compileSdkVersion 31
Expand All @@ -18,7 +15,7 @@ android {
targetSdkVersion 31
versionCode 42
versionName "1.0"
testInstrumentationRunner 'com.rootstrap.android.CustomTestRunner'
testInstrumentationRunner "com.rootstrap.android.CustomTestRunner"
}

compileOptions {
Expand All @@ -32,7 +29,7 @@ android {
}

kotlinOptions {
jvmTarget = '1.8'
jvmTarget = "1.8"
}

signingConfigs {
Expand All @@ -45,50 +42,37 @@ android {
}

buildTypes {
debug {
minifyEnabled false
}

release {
signingConfig signingConfigs.releaseConfig
getByName("debug") {
applicationIdSuffix = ".debug"
versionNameSuffix "-debug"
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}

kapt {
correctErrorTypes true
}

flavorDimensions "server"

productFlavors {
dev {
dimension "server"
applicationIdSuffix ".dev"
versionNameSuffix "-dev"
buildConfigField("String", "API_URL", "\"https://rails5-api-base.herokuapp.com/api/v1/\"")
buildConfigField("String", "SECURE_KEY_ALIAS", "\"$projectKeyAlias\"")
buildConfigField("String", "SECURE_FILE_NAME", "\"appPreferencesDev\"")
}

staging {
dimension "server"
applicationIdSuffix ".staging"
versionNameSuffix "-staging"
create("staging") {
initWith(getByName("debug"))
applicationIdSuffix = ".staging"
initWith(getByName("debug"))
buildConfigField("String", "API_URL", "\"https://proj-staging.herokuapp.com/api/\"")
buildConfigField("String", "SECURE_KEY_ALIAS", "\"$projectKeyAlias\"")
buildConfigField("String", "SECURE_FILE_NAME", "\"appPreferencesStaging\"")
}

prod {
dimension "server"
getByName("release") {
signingConfig signingConfigs.releaseConfig
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
buildConfigField("String", "API_URL", "\"https://proj-production.herokuapp.com/api/\"")
buildConfigField("String", "SECURE_KEY_ALIAS", "\"$projectKeyAlias\"")
buildConfigField("String", "SECURE_FILE_NAME", "\"appPreferences\"")
}
}

kapt {
correctErrorTypes true
}

applicationVariants.all { variant ->
variant.outputs.all { output ->
def apk = output.outputFile
Expand Down Expand Up @@ -139,80 +123,20 @@ android {
}

dependencies {
def room_version = "2.3.0"
def lifecycle_version = "2.4.0"
def mockkVersion = '1.12.0'

implementation project(":data")
implementation project(":domain")
implementation project(":usecases")

implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-android:1.5.1'
implementation 'androidx.appcompat:appcompat:1.3.1'
implementation 'androidx.core:core-ktx:1.7.0'
implementation 'androidx.constraintlayout:constraintlayout:2.1.1'
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
implementation "androidx.preference:preference-ktx:1.1.1"
implementation 'com.google.android.material:material:1.4.0'
testImplementation 'junit:junit:4.13.1'
testImplementation 'org.mockito:mockito-core:2.28.2'
testImplementation "org.jetbrains.kotlinx:kotlinx-coroutines-test:1.5.1"
testImplementation 'android.arch.core:core-testing:1.1.1'
testImplementation "io.mockk:mockk:$mockkVersion"

androidTestImplementation 'androidx.test:runner:1.4.0'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
androidTestImplementation 'androidx.test.espresso:espresso-intents:3.4.0'
androidTestImplementation 'androidx.test.ext:junit:1.1.3'
androidTestImplementation 'androidx.test.uiautomator:uiautomator:2.2.0'
androidTestImplementation 'androidx.test:rules:1.4.0'
androidTestImplementation 'com.squareup.okhttp3:mockwebserver:4.3.1'

//---- ROOM ----
implementation "androidx.room:room-runtime:$room_version"
kapt "androidx.room:room-compiler:$room_version"
// Kotlin Extensions and Coroutines support for Room
implementation "androidx.room:room-ktx:$room_version"

//---- LIFECYCLE ----]
implementation "androidx.lifecycle:lifecycle-runtime-ktx:$lifecycle_version"
implementation "androidx.lifecycle:lifecycle-livedata-ktx:$lifecycle_version"
implementation "androidx.lifecycle:lifecycle-extensions:2.2.0"
implementation "androidx.lifecycle:lifecycle-viewmodel-ktx:$lifecycle_version"
implementation "androidx.lifecycle:lifecycle-common-java8:$lifecycle_version"

//---- GOOGLE JSON SERIALIZER/DESERIALIZER ----
implementation 'com.google.code.gson:gson:2.8.6'

//---- MixPanel ----
implementation 'com.mixpanel.android:mixpanel-android:5.6.1'

//---- Firebase ----
implementation platform('com.google.firebase:firebase-bom:28.4.2')
implementation 'com.google.firebase:firebase-core:20.0.0'
implementation 'com.google.firebase:firebase-analytics-ktx'
implementation 'com.google.firebase:firebase-crashlytics-ktx'
implementation 'org.jetbrains.kotlin:kotlin-reflect:1.5.31'

//---- Image ----
implementation group: 'com.github.bumptech.glide', name: 'glide', version: '4.10.0'

//---- Network ----
implementation 'com.squareup.retrofit2:retrofit:2.6.2'
implementation 'com.squareup.moshi:moshi-kotlin:1.12.0'
implementation 'com.squareup.retrofit2:converter-moshi:2.5.0'
implementation 'com.squareup.okhttp3:logging-interceptor:4.3.1'

//---- Events ----
implementation 'com.squareup:otto:1.3.8'

//---- Linters ----
ktlint "com.pinterest:ktlint:0.35.0"

//---- Hilt ----
implementation "com.google.dagger:hilt-android:$hilt_version"
kapt "com.google.dagger:hilt-android-compiler:$hilt_version"
kapt 'androidx.hilt:hilt-compiler:1.0.0'
androidTestImplementation "com.google.dagger:hilt-android-testing:$hilt_version"
kaptAndroidTest "com.google.dagger:hilt-android-compiler:$hilt_version"

//security crypto
implementation "androidx.security:security-crypto:1.1.0-alpha03"

implementation androidLibs.values()
implementation androidDataLibs.values()
implementation kotlinLibs.values()
implementation platform(Libs.firebaseBom)
implementation libs.values()
kapt androidKaptLibs.values()
ktlint ktlintLibs.values()
testImplementation testLibs.values()
androidTestImplementation androidTestLibs.values()
}
2 changes: 1 addition & 1 deletion app/google-services.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
"client_info": {
"mobilesdk_app_id": "1:289773649665:android:d4cfc41fd5630d4bf1e500",
"android_client_info": {
"package_name": "com.rootstrap.android.dev"
"package_name": "com.rootstrap.android.debug"
}
},
"oauth_client": [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,9 @@ import androidx.test.espresso.Espresso.onView
import androidx.test.espresso.action.ViewActions.click
import androidx.test.espresso.matcher.ViewMatchers.withId
import com.rootstrap.android.R
import com.rootstrap.android.ui.activity.main.ProfileActivity
import com.rootstrap.android.ui.activity.main.SignUpActivity
import com.rootstrap.android.ui.profile.ProfileActivity
import com.rootstrap.android.ui.login.SignUpActivity
import com.rootstrap.android.utils.BaseTests
import dagger.hilt.android.testing.HiltAndroidTest
import okhttp3.mockwebserver.Dispatcher
import okhttp3.mockwebserver.MockResponse
import okhttp3.mockwebserver.RecordedRequest
Expand All @@ -17,7 +16,6 @@ import org.junit.Assert.assertEquals
import org.junit.Before
import org.junit.Test

@HiltAndroidTest
class ProfileActivityTest : BaseTests() {

private lateinit var activity: ProfileActivity
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ package com.rootstrap.android.tests
import androidx.test.core.app.ActivityScenario
import com.google.gson.Gson
import com.rootstrap.android.R
import com.rootstrap.android.network.models.UserSerializer
import com.rootstrap.android.ui.activity.main.ProfileActivity
import com.rootstrap.android.ui.activity.main.SignInActivity
import com.rootstrap.data.dto.response.UserSerializer
import com.rootstrap.android.ui.profile.ProfileActivity
import com.rootstrap.android.ui.login.SignInActivity
import com.rootstrap.android.utils.BaseTests
import dagger.hilt.android.testing.HiltAndroidTest
import okhttp3.mockwebserver.Dispatcher
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ package com.rootstrap.android.tests
import androidx.test.core.app.ActivityScenario
import com.google.gson.Gson
import com.rootstrap.android.R
import com.rootstrap.android.network.models.UserSerializer
import com.rootstrap.android.ui.activity.main.ProfileActivity
import com.rootstrap.android.ui.activity.main.SignInActivity
import com.rootstrap.android.ui.activity.main.SignUpActivity
import com.rootstrap.data.dto.response.UserSerializer
import com.rootstrap.android.ui.profile.ProfileActivity
import com.rootstrap.android.ui.login.SignInActivity
import com.rootstrap.android.ui.login.SignUpActivity
import com.rootstrap.android.utils.BaseTests
import dagger.hilt.android.testing.HiltAndroidTest
import okhttp3.mockwebserver.Dispatcher
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package com.rootstrap.android.tests.utils

import android.content.SharedPreferences
import androidx.security.crypto.EncryptedSharedPreferences
import com.rootstrap.android.util.Prefs
import com.rootstrap.data.util.Prefs
import dagger.hilt.android.testing.HiltAndroidRule
import dagger.hilt.android.testing.HiltAndroidTest
import org.junit.Assert
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ import androidx.test.espresso.matcher.ViewMatchers.withId
import androidx.test.internal.runner.junit4.AndroidJUnit4ClassRunner
import androidx.test.runner.lifecycle.ActivityLifecycleMonitorRegistry
import androidx.test.runner.lifecycle.Stage
import com.rootstrap.android.network.managers.session.SessionManager
import com.rootstrap.android.network.models.User
import com.rootstrap.android.network.providers.ServiceProviderModule
import com.rootstrap.data.managers.session.SessionManager
import com.rootstrap.data.dto.response.UserDTO
import com.rootstrap.data.api.ApiServiceFactory
import dagger.hilt.android.testing.HiltAndroidRule
import okhttp3.mockwebserver.Dispatcher
import org.junit.Rule
Expand All @@ -38,15 +38,15 @@ open class BaseTests {

open fun before() {
mockServer.startServer()
ServiceProviderModule.URL_API = mockServer.server().url("/").toString()
ApiServiceFactory.URL_API = mockServer.server().url("/").toString()
hiltRule.inject()
}

open fun after() {
mockServer.stopServer()
}

open fun testUser() = User(
open fun testUser() = UserDTO(
"9032",
"user123@mail.com",
"Richard",
Expand Down
6 changes: 3 additions & 3 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
android:theme="@style/AppTheme">

<activity
android:name=".ui.activity.main.SignUpActivity"
android:name=".ui.login.SignUpActivity"
android:screenOrientation="portrait"
android:exported="true">
<intent-filter>
Expand All @@ -26,11 +26,11 @@
</activity>

<activity
android:name=".ui.activity.main.ProfileActivity"
android:name=".ui.profile.ProfileActivity"
android:screenOrientation="portrait" />

<activity
android:name=".ui.activity.main.SignInActivity"
android:name=".ui.login.SignInActivity"
android:screenOrientation="portrait" />

</application>
Expand Down
Loading