Skip to content
This repository has been archived by the owner on Feb 20, 2023. It is now read-only.

Commit

Permalink
Move architecture/mvi code to separate gradle module.
Browse files Browse the repository at this point in the history
  • Loading branch information
pocmo authored and colintheshots committed Feb 1, 2019
1 parent 27a56e2 commit 344bc0a
Show file tree
Hide file tree
Showing 11 changed files with 80 additions and 9 deletions.
3 changes: 2 additions & 1 deletion app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,8 @@ androidExtensions {
}

dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation project(':architecture')

implementation Deps.kotlin_stdlib
implementation Deps.androidx_appcompat
implementation Deps.androidx_constraintlayout
Expand Down
40 changes: 40 additions & 0 deletions architecture/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */

apply plugin: 'com.android.library'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'

android {
compileSdkVersion 28

defaultConfig {
minSdkVersion 21
targetSdkVersion 28
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}

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

androidExtensions {
experimental = true
}

dependencies {
implementation Deps.kotlin_stdlib

implementation Deps.androidx_annotation
implementation Deps.androidx_lifecycle_runtime

implementation Deps.mozilla_support_base

implementation Deps.rxAndroid
implementation Deps.rxKotlin
}
21 changes: 21 additions & 0 deletions architecture/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
5 changes: 5 additions & 0 deletions architecture/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<!-- This Source Code Form is subject to the terms of the Mozilla Public
- License, v. 2.0. If a copy of the MPL was not distributed with this
- file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="org.mozilla.fenix.mvi"/>
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ package org.mozilla.fenix.mvi
import io.reactivex.ObservableTransformer
import io.reactivex.subjects.Subject
import mozilla.components.support.base.log.logger.Logger
import org.mozilla.fenix.BuildConfig

/**
* An action is a command or intent the user performed
Expand Down
4 changes: 2 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ task clean(type: Delete) {
detekt {
// The version number is duplicated, please refer to plugins block for more details
version = "1.0.0.RC9.2"
input = files("$projectDir/app")
input = files("$projectDir/app", "$projectDir/architecture")
config = files("$projectDir/config/detekt.yml")
filters = ".*test.*,.*/resources/.*,.*/tmp/.*"

Expand All @@ -62,5 +62,5 @@ task ktlint(type: JavaExec, group: "verification") {
description = "Check Kotlin code style."
classpath = configurations.ktlint
main = "com.github.shyiko.ktlint.Main"
args "app/**/*.kt"
args "app/**/*.kt", "architecture/**/*.kt"
}
13 changes: 9 additions & 4 deletions buildSrc/src/main/java/Dependencies.kt
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,16 @@ private object Versions {
const val androidx_appcompat = "1.0.2"
const val androidx_constraint_layout = "2.0.0-alpha3"
const val androidx_preference = "1.1.0-alpha02"
const val androidx_legacy = "1.0.0"
const val androidx_annotation = "1.0.1"
const val androidx_lifecycle = "2.0.0"

const val mozilla_android_components = "0.41.0-SNAPSHOT"

const val junit = "4.12"
const val test_tools = "1.0.2"
const val espresso_core = "2.2.2"

const val androidx_legacy = "1.0.0"
const val android_arch_navigation = "1.0.0-alpha11"
}

Expand All @@ -42,9 +44,6 @@ object Deps {
const val geckoview_nightly_arm = "org.mozilla.geckoview:geckoview-nightly-armeabi-v7a:${Versions.geckoNightly}"
const val geckoview_nightly_x86 = "org.mozilla.geckoview:geckoview-nightly-x86:${Versions.geckoNightly}"

const val androidx_appcompat = "androidx.appcompat:appcompat:${Versions.androidx_appcompat}"
const val androidx_constraintlayout = "androidx.constraintlayout:constraintlayout:${Versions.androidx_constraint_layout}"

const val mozilla_concept_engine = "org.mozilla.components:concept-engine:${Versions.mozilla_android_components}"
const val mozilla_concept_tabstray = "org.mozilla.components:concept-tabstray:${Versions.mozilla_android_components}"
const val mozilla_concept_toolbar = "org.mozilla.components:concept-toolbar:${Versions.mozilla_android_components}"
Expand Down Expand Up @@ -79,6 +78,7 @@ object Deps {

const val mozilla_lib_crash = "org.mozilla.components:lib-crash:${Versions.mozilla_android_components}"

const val mozilla_support_base = "org.mozilla.components:support-base:${Versions.mozilla_android_components}"
const val mozilla_support_ktx = "org.mozilla.components:support-ktx:${Versions.mozilla_android_components}"

const val sentry = "io.sentry:sentry-android:${Versions.sentry}"
Expand All @@ -87,8 +87,13 @@ object Deps {
const val tools_test_runner = "com.android.support.test:runner:${Versions.test_tools}"
const val tools_espresso_core = "com.android.support.test.espresso:espresso-core:${Versions.espresso_core}"

const val androidx_annotation = "androidx.annotation:annotation:${Versions.androidx_annotation}"
const val androidx_appcompat = "androidx.appcompat:appcompat:${Versions.androidx_appcompat}"
const val androidx_constraintlayout = "androidx.constraintlayout:constraintlayout:${Versions.androidx_constraint_layout}"
const val androidx_legacy = "androidx.legacy:legacy-support-v4:${Versions.androidx_legacy}"
const val androidx_lifecycle_runtime = "androidx.lifecycle:lifecycle-runtime:${Versions.androidx_lifecycle}"
const val androidx_preference = "androidx.preference:preference-ktx:${Versions.androidx_preference}"
const val android_arch_navigation = "android.arch.navigation:navigation-fragment:${Versions.android_arch_navigation}"

}

2 changes: 1 addition & 1 deletion settings.gradle
Original file line number Diff line number Diff line change
@@ -1 +1 @@
include ':app'
include ':app', ':architecture'

0 comments on commit 344bc0a

Please sign in to comment.