-
Notifications
You must be signed in to change notification settings - Fork 45
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Scaffold sharedpreferences module (#77)
* Scaffold sharedpreferences module - Attach to store implemetnation - Mock data currently being returned Some housekeeping. * Small configurations for CI Still not working, wanted to make mock work with debug but variants still compain. * Test removing ViewModelModule * Ci why you no work? * Fix lints on CI * Working stuff for CI * housekeeping mobile-ui/build.gradle Had to make some changtes while debuging CI fails. This change still makes sense IMO. #69 * Rename data package to include project name #69 * Remove unecessary .gitignore from other packages Maintenece commit, not really related to this branch feature. * Manifest cleanup and format
- Loading branch information
1 parent
f5e2dfa
commit dfb2163
Showing
46 changed files
with
327 additions
and
123 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -74,4 +74,6 @@ proguard/ | |
*.iml | ||
|
||
# OS | ||
.DS_Store | ||
.DS_Store | ||
bitrise.yml | ||
gradle.deps |
107 changes: 107 additions & 0 deletions
107
transport-eta-android/data-sharedpreferences/build.gradle
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,107 @@ | ||
apply plugin: 'com.android.library' | ||
apply plugin: 'kotlin-kapt' | ||
apply plugin: 'kotlin-android' | ||
apply plugin: 'kotlin-android-extensions' | ||
|
||
android { | ||
compileSdkVersion build_versions.target_sdk | ||
defaultConfig { | ||
minSdkVersion build_versions.min_sdk | ||
targetSdkVersion build_versions.target_sdk | ||
testInstrumentationRunner "com.joaquimley.transporteta.ui.test.TestRunner" | ||
} | ||
|
||
packagingOptions { | ||
exclude 'LICENSE.txt' | ||
exclude 'META-INF/DEPENDENCIES' | ||
exclude 'META-INF/ASL2.0' | ||
exclude 'META-INF/NOTICE' | ||
exclude 'META-INF/LICENSE' | ||
} | ||
|
||
lintOptions { | ||
quiet true | ||
abortOnError false | ||
ignoreWarnings true | ||
disable 'InvalidPackage' //Some libraries have issues with this. | ||
disable 'OldTargetApi' | ||
// Lint gives this warning but SDK 20 would be Android L Beta. | ||
disable 'IconDensities' //For testing purpose. This is safe to remove. | ||
disable 'IconMissingDensityFolder' //For testing purpose. This is safe to remove. | ||
} | ||
|
||
dexOptions { | ||
preDexLibraries true | ||
} | ||
|
||
buildTypes { | ||
debug { | ||
testCoverageEnabled true | ||
} | ||
|
||
release { | ||
minifyEnabled true | ||
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' | ||
} | ||
} | ||
|
||
flavorDimensions "environment" | ||
productFlavors { | ||
mock { | ||
dimension "environment" | ||
} | ||
|
||
prod { | ||
dimension "environment" | ||
} | ||
} | ||
|
||
/** | ||
* Prevent shipping the mock flavor with release variant | ||
* read more at: https://developer.android.com/studio/build/build-variants.html | ||
*/ | ||
variantFilter { variant -> | ||
def names = variant.flavors*.name | ||
// To check for a certain build type, use variant.buildType.name == "<buildType>" | ||
if (names.contains("mock") && variant.buildType.name == "release") { | ||
// Gradle ignores any variants that satisfy the conditions above. | ||
setIgnore(true) | ||
} | ||
} | ||
} | ||
|
||
// Module configuration | ||
androidExtensions { | ||
experimental = true | ||
} | ||
|
||
dependencies { | ||
// Module | ||
implementation project(':data') | ||
// ACC | ||
kapt deps.lifecycle.compiler | ||
implementation deps.lifecycle.livedata | ||
implementation deps.lifecycle.viewmodel | ||
// Javax | ||
implementation deps.javax.inject | ||
compileOnly deps.javax.annotation | ||
// Rx | ||
implementation deps.rx.java2 | ||
implementation deps.rx.android | ||
// Kotlin | ||
implementation deps.kotlin.rx | ||
implementation deps.kotlin.stdlib | ||
|
||
/*********** | ||
* Testing * | ||
***********/ | ||
|
||
// Local unit tests | ||
kaptTest deps.dagger.compiler | ||
testImplementation deps.kotlin.junit | ||
testImplementation deps.mockito.kotlin | ||
testImplementation deps.mockito.inline | ||
testImplementation deps.lifecycle.testing | ||
// Resolve conflicts between main and local unit tests | ||
testImplementation deps.androidx.annotation | ||
} |
21 changes: 21 additions & 0 deletions
21
transport-eta-android/data-sharedpreferences/proguard-rules.pro
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
26 changes: 26 additions & 0 deletions
26
...droidTest/java/com/joaquimley/transporteta/sharedpreferences/ExampleInstrumentedTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
package com.joaquimley.transporteta.sharedpreferences; | ||
|
||
import android.content.Context; | ||
import android.support.test.InstrumentationRegistry; | ||
import android.support.test.runner.AndroidJUnit4; | ||
|
||
import org.junit.Test; | ||
import org.junit.runner.RunWith; | ||
|
||
import static org.junit.Assert.*; | ||
|
||
/** | ||
* Instrumented test, which will execute on an Android device. | ||
* | ||
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a> | ||
*/ | ||
@RunWith(AndroidJUnit4.class) | ||
public class ExampleInstrumentedTest { | ||
@Test | ||
public void useAppContext() { | ||
// Context of the app under test. | ||
Context appContext = InstrumentationRegistry.getTargetContext(); | ||
|
||
assertEquals("com.joaquimley.transporteta.sharedpreferences.test", appContext.getPackageName()); | ||
} | ||
} |
2 changes: 2 additions & 0 deletions
2
transport-eta-android/data-sharedpreferences/src/main/AndroidManifest.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
<manifest | ||
package="com.joaquimley.transporteta.sharedpreferences"/> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 6 additions & 0 deletions
6
...es/src/main/java/com/joaquimley/transporteta/sharedpreferences/mapper/SharedPrefMapper.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
package com.joaquimley.transporteta.sharedpreferences.mapper | ||
|
||
class SharedPrefMapper { | ||
|
||
// TODO | ||
} |
6 changes: 6 additions & 0 deletions
6
.../src/main/java/com/joaquimley/transporteta/sharedpreferences/model/SharedPrefTransport.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
package com.joaquimley.transporteta.sharedpreferences.model | ||
|
||
class SharedPrefTransport { | ||
|
||
// TODO | ||
} |
3 changes: 3 additions & 0 deletions
3
transport-eta-android/data-sharedpreferences/src/main/res/values/strings.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
<resources> | ||
<string name="app_name">sharedprefernces</string> | ||
</resources> |
17 changes: 17 additions & 0 deletions
17
...ferences/src/test/java/com/joaquimley/transporteta/sharedpreferences/ExampleUnitTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
package com.joaquimley.transporteta.sharedpreferences; | ||
|
||
import org.junit.Test; | ||
|
||
import static org.junit.Assert.*; | ||
|
||
/** | ||
* Example local unit test, which will execute on the development machine (host). | ||
* | ||
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a> | ||
*/ | ||
public class ExampleUnitTest { | ||
@Test | ||
public void addition_isCorrect() { | ||
assertEquals(4, 2 + 2); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 3 additions & 3 deletions
6
...oaquimley/data/FavoritesRepositoryImpl.kt → ...nsporteta/data/FavoritesRepositoryImpl.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 3 additions & 3 deletions
6
...oaquimley/data/TransportRepositoryImpl.kt → ...nsporteta/data/TransportRepositoryImpl.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...imley/data/executor/ThreadExecutorImpl.kt → ...rteta/data/executor/ThreadExecutorImpl.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
...uimley/data/mapper/DataTransportMapper.kt → ...orteta/data/mapper/DataTransportMapper.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
.../joaquimley/data/model/TransportEntity.kt → ...ransporteta/data/model/TransportEntity.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
package com.joaquimley.data.model | ||
package com.joaquimley.transporteta.data.model | ||
|
||
data class TransportEntity(val id: String, val name: String, val code: Int, val latestEta: String, | ||
val isFavorite: Boolean = false, val type: String) |
4 changes: 2 additions & 2 deletions
4
...mley/data/source/FrameworkLocalStorage.kt → ...teta/data/source/FrameworkLocalStorage.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
...aquimley/data/store/TransportDataStore.kt → ...sporteta/data/store/TransportDataStore.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 3 additions & 3 deletions
6
...mley/data/store/TransportDataStoreImpl.kt → ...teta/data/store/TransportDataStoreImpl.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 6 additions & 6 deletions
12
...oaquimley/data/FavoritesRepositoryTest.kt → ...nsporteta/data/FavoritesRepositoryTest.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 6 additions & 6 deletions
12
...oaquimley/data/TransportRepositoryTest.kt → ...nsporteta/data/TransportRepositoryTest.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...om/joaquimley/data/factory/DataFactory.kt → .../transporteta/data/factory/DataFactory.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 4 additions & 4 deletions
8
...aquimley/data/factory/TransportFactory.kt → ...sporteta/data/factory/TransportFactory.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 3 additions & 3 deletions
6
...ey/data/mapper/DataTransportMapperTest.kt → ...ta/data/mapper/DataTransportMapperTest.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.