Skip to content

Commit

Permalink
Final app
Browse files Browse the repository at this point in the history
  • Loading branch information
PhilippeBoisney committed Apr 11, 2019
1 parent 51eb44d commit ff75e29
Show file tree
Hide file tree
Showing 189 changed files with 1,476 additions and 905 deletions.
2 changes: 1 addition & 1 deletion .idea/gradle.xml

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

18 changes: 12 additions & 6 deletions android_commons.gradle
Original file line number Diff line number Diff line change
@@ -1,15 +1,21 @@
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'

android {
compileSdkVersion versions.compileSdk
compileSdkVersion Versions.compileSdk
defaultConfig {
minSdkVersion versions.minSdk
targetSdkVersion versions.targetSdk
versionCode 1
versionName "1.0.0"
minSdkVersion Versions.minSdk
targetSdkVersion Versions.targetSdk
versionCode Releases.versionCode
versionName Releases.versionName
}
buildTypes {
release {
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
}

dependencies {
implementation AndroidLibraries.kotlin
}
18 changes: 18 additions & 0 deletions android_core_dependencies.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
/**
* Shared dependencies between modules
*/
dependencies {
// KOTLIN
implementation AndroidLibraries.kotlin
implementation AndroidLibraries.kotlinCoroutineCore
implementation AndroidLibraries.kotlinCoroutineAndroid
// ANDROID
implementation AndroidLibraries.appCompat
implementation AndroidLibraries.coreKtx
implementation AndroidLibraries.constraintLayout
implementation AndroidLibraries.lifecycleViewModel
implementation AndroidLibraries.lifecycleExtensions
implementation AndroidLibraries.recyclerView
implementation AndroidLibraries.navigation
implementation AndroidLibraries.navigationFrag
}
29 changes: 29 additions & 0 deletions android_feature_dependencies.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
/**
* Feature dependencies
*/
apply plugin: 'com.android.library'
apply from: '../../android_core_dependencies.gradle'
apply from: '../../android_commons.gradle'

dependencies {
implementation project(Modules.common)
implementation project(Modules.commonTest)
implementation project(Modules.repository)
implementation project(Modules.navigation)
// KOIN (Because each feature has to handle its dependencies)
implementation Libraries.koin
implementation Libraries.koinViewModel
// TEST
androidTestImplementation TestLibraries.androidTestRunner
androidTestImplementation TestLibraries.junit
androidTestImplementation TestLibraries.mockkAndroid
androidTestImplementation TestLibraries.fragmentNav
androidTestImplementation TestLibraries.espresso
androidTestImplementation TestLibraries.espressoContrib
androidTestImplementation TestLibraries.koin
androidTestImplementation TestLibraries.archCoreTest
testImplementation TestLibraries.junit
testImplementation TestLibraries.mockk
testImplementation TestLibraries.archCoreTest
kaptAndroidTest TestLibraries.databinding
}
14 changes: 6 additions & 8 deletions android_test_dependencies.gradle
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
dependencies {
// ANDROID TEST
androidTestImplementation "androidx.test:runner:${versions.androidTestRunner}"
androidTestImplementation "androidx.test.espresso:espresso-core:${versions.espressoCore}"
androidTestImplementation TestLibraries.androidTestRunner
androidTestImplementation TestLibraries.espresso
// KOIN
androidTestImplementation "org.koin:koin-test:${versions.koin}"
androidTestImplementation TestLibraries.koin
// ANDROID
androidTestImplementation "androidx.arch.core:core-testing:${versions.archCoreTest}"
androidTestImplementation "androidx.test.ext:junit:${versions.androidJunit}"
// MOCK WEBSERVER
androidTestImplementation "com.squareup.okhttp:mockwebserver:${versions.mockwebserver}"
androidTestImplementation TestLibraries.archCoreTest
androidTestImplementation TestLibraries.junit
// MOCK
androidTestImplementation "io.mockk:mockk-android:${versions.mockk}"
androidTestImplementation TestLibraries.mockk
}
30 changes: 18 additions & 12 deletions app/build.gradle
Original file line number Diff line number Diff line change
@@ -1,14 +1,9 @@
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
apply from: '../repositories.gradle'
apply from: '../core_dependencies.gradle'
apply from: '../test_dependencies.gradle'
apply from: '../android_commons.gradle'

android {
defaultConfig {
applicationId names.applicationId
applicationId ApplicationId.id
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
dataBinding {
Expand All @@ -17,11 +12,22 @@ android {
}

dependencies {
// DI modules
implementation project(':di')
// COMMON
implementation project(Modules.common)
// DATA modules
implementation project(Modules.local)
implementation project(Modules.remote)
implementation project(Modules.repository)
// FEATURES modules
implementation project(':features:home')
implementation project(':features:detail')
// NAVIGATION module
implementation project(':navigation')
implementation project(Modules.featureHome)
implementation project(Modules.featureDetail)
// NAVIGATION
implementation project(Modules.navigation)
// KOIN
implementation Libraries.koin
implementation Libraries.koinViewModel
// ANDROID
implementation AndroidLibraries.appCompat
implementation AndroidLibraries.navigation
implementation AndroidLibraries.navigationFrag
}

This file was deleted.

5 changes: 3 additions & 2 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="io.philippeboisney.archapp">

<application
Expand All @@ -9,11 +10,11 @@
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/AppTheme">
android:theme="@style/AppTheme"
tools:ignore="GoogleAppIndexingWarning">
<activity android:name=".MainActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN"/>

<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
</activity>
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/java/io/philippeboisney/archapp/App.kt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package io.philippeboisney.archapp

import android.app.Application
import io.philippeboisney.di.appComponent
import io.philippeboisney.archapp.di.appComponent
import org.koin.android.ext.android.startKoin

open class App: Application() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package io.philippeboisney.archapp

import androidx.appcompat.app.AppCompatActivity
import android.os.Bundle
import androidx.lifecycle.MediatorLiveData
import androidx.navigation.NavController
import androidx.navigation.findNavController
import androidx.navigation.ui.AppBarConfiguration
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
package io.philippeboisney.archapp.di

import io.philippeboisney.detail.di.featureDetailModule
import io.philippeboisney.home.di.featureHomeModule
import io.philippeboisney.local.di.localModule
import io.philippeboisney.remote.di.createRemoteModule
import io.philippeboisney.repository.di.repositoryModule

val appComponent= listOf(createRemoteModule("https://api.github.com/"), repositoryModule, featureHomeModule, featureDetailModule, localModule)
2 changes: 1 addition & 1 deletion app/src/main/res/layout/activity_main.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@
app:layout_constraintBottom_toBottomOf="parent"

app:defaultNavHost="true"
app:navGraph="@navigation/nav_graph"
app:navGraph="@navigation/nav_graph_home_feature"
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"/>
3 changes: 0 additions & 3 deletions app/src/main/res/values/strings.xml

This file was deleted.

17 changes: 0 additions & 17 deletions app/src/test/java/io/philippeboisney/archapp/ExampleUnitTest.kt

This file was deleted.

64 changes: 25 additions & 39 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,47 +1,33 @@
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript { scriptHandler ->
apply from: 'repositories.gradle', to: scriptHandler
ext.names = [
'applicationId': 'io.philippeboisney.archapp'
]
ext.versions = [
'kotlin' : '1.3.21',
'gradle' : '3.3.2',
'compileSdk' : 28,
'minSdk' : 23,
'targetSdk' : 28,
'appCompat' : '1.1.0-alpha02',
'coreKtx' : '1.1.0-alpha04',
'constraintLayout' : '1.1.3',
'junit' : '4.12',
'androidTestRunner' : '1.1.2-alpha02',
'espressoCore' : '3.2.0-alpha02',
'retrofit' : '2.5.0',
'retrofitCoroutines' : '0.9.2',
'retrofitGson' : '2.4.0',
'gson' : '2.8.5',
'okHttp' : '3.12.1',
'coroutines' : '1.0.1',
'koin' : '1.0.2',
'timber' : '4.7.1',
'lifecycle' : '2.1.0-alpha03',
'nav' : '2.0.0',
'room' : '2.1.0-alpha05',
'recyclerview' : '1.0.0',
'safeArgs' : '2.1.0-alpha01',
'glide' : '4.9.0',
'mockwebserver' : '2.7.5',
'archCoreTest' : '2.0.0',
'androidJunit' : '1.1.0',
'mockk' : '1.9.2'
]
buildscript {
repositories {
google()
jcenter()
}
dependencies {
classpath "com.android.tools.build:gradle:${versions.gradle}"
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:${versions.kotlin}"
classpath "androidx.navigation:navigation-safe-args-gradle-plugin:${versions.safeArgs}"
classpath "com.android.tools.build:gradle:${Versions.gradle}"
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:${Versions.kotlin}"
classpath "androidx.navigation:navigation-safe-args-gradle-plugin:${Versions.safeArgs}"
}
}

plugins {
id "io.gitlab.arturbosch.detekt" version "1.0.0-RC14"
id "com.github.ben-manes.versions" version "0.20.0"
}

allprojects {
apply from: "$rootDir/ktlint.gradle"
apply from: "$rootDir/detekt.gradle"

repositories {
google()
jcenter()
}
}

task clean(type: Delete) {
delete rootProject.buildDir
}

task x(type: GradleBuild) { tasks = ["detekt", "ktlint", "lintDebug", "testDebugUnitTest"] }
9 changes: 9 additions & 0 deletions buildSrc/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import org.gradle.kotlin.dsl.`kotlin-dsl`

plugins {
`kotlin-dsl`
}
// Required since Gradle 4.10+.
repositories {
jcenter()
}
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added buildSrc/build/classes/kotlin/main/Modules.class
Binary file not shown.
Binary file added buildSrc/build/classes/kotlin/main/Releases.class
Binary file not shown.
Binary file not shown.
Binary file added buildSrc/build/classes/kotlin/main/Versions.class
Binary file not shown.
1 change: 1 addition & 0 deletions buildSrc/build/kotlin/buildSrcjar-classes.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/Users/Philippe/Documents/Github/Publics/ArchApp/buildSrc/build/classes/kotlin/main/AndroidLibraries.class:/Users/Philippe/Documents/Github/Publics/ArchApp/buildSrc/build/classes/kotlin/main/ApplicationId.class:/Users/Philippe/Documents/Github/Publics/ArchApp/buildSrc/build/classes/kotlin/main/Libraries.class:/Users/Philippe/Documents/Github/Publics/ArchApp/buildSrc/build/classes/kotlin/main/Modules.class:/Users/Philippe/Documents/Github/Publics/ArchApp/buildSrc/build/classes/kotlin/main/Releases.class:/Users/Philippe/Documents/Github/Publics/ArchApp/buildSrc/build/classes/kotlin/main/TestLibraries.class:/Users/Philippe/Documents/Github/Publics/ArchApp/buildSrc/build/classes/kotlin/main/Versions.class
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
��
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
15
14
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
3011001
1 change: 1 addition & 0 deletions buildSrc/build/kotlin/compileKotlin/format-version.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
9011001
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
4011001
Binary file added buildSrc/build/kotlin/compileKotlin/last-build.bin
Binary file not shown.
Binary file added buildSrc/build/libs/buildSrc.jar
Binary file not shown.
8 changes: 8 additions & 0 deletions buildSrc/build/source-roots/buildSrc/source-roots.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
src/main/resources
src/main/java
src/main/groovy
src/main/kotlin
src/test/resources
src/test/java
src/test/groovy
src/test/kotlin
2 changes: 2 additions & 0 deletions buildSrc/build/tmp/jar/MANIFEST.MF
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Manifest-Version: 1.0

Loading

0 comments on commit ff75e29

Please sign in to comment.