mirror of
https://github.com/android10/Android-CleanArchitecture.git
synced 2026-03-13 10:13:41 +08:00
Added domain and data layers. Configured tests.
This commit is contained in:
27
data-test/build.gradle
Normal file
27
data-test/build.gradle
Normal file
@@ -0,0 +1,27 @@
|
||||
apply plugin: 'java'
|
||||
|
||||
dependencies {
|
||||
def dataLayer = project(':data')
|
||||
compile dataLayer
|
||||
|
||||
testCompile 'org.mockito:mockito-core:1.9.5'
|
||||
testCompile 'junit:junit:4.11'
|
||||
testCompile 'org.robolectric:robolectric:2.2'
|
||||
|
||||
testCompile dataLayer.android.libraryVariants.toList().first().javaCompile.classpath
|
||||
testCompile dataLayer.android.libraryVariants.toList().first().javaCompile.outputs.files
|
||||
testCompile files(dataLayer.plugins.findPlugin("com.android.library").getBootClasspath())
|
||||
}
|
||||
|
||||
sourceSets {
|
||||
test {
|
||||
java.srcDirs = ['src/test/java']
|
||||
}
|
||||
}
|
||||
|
||||
tasks.withType(Test) {
|
||||
scanForTestClasses = false
|
||||
include "**/*Should.class"
|
||||
include "**/*Test.class"
|
||||
include "**/*Tests.class"
|
||||
}
|
||||
1
data/.gitignore
vendored
Normal file
1
data/.gitignore
vendored
Normal file
@@ -0,0 +1 @@
|
||||
/build
|
||||
35
data/build.gradle
Normal file
35
data/build.gradle
Normal file
@@ -0,0 +1,35 @@
|
||||
apply plugin: 'com.android.library'
|
||||
|
||||
android {
|
||||
compileSdkVersion 19
|
||||
buildToolsVersion '19.1.0'
|
||||
|
||||
defaultConfig {
|
||||
applicationId "com.fernandocejas.android10.sample.data"
|
||||
minSdkVersion 15
|
||||
targetSdkVersion 19
|
||||
}
|
||||
|
||||
packagingOptions {
|
||||
exclude 'META-INF/DEPENDENCIES'
|
||||
exclude 'META-INF/ASL2.0'
|
||||
exclude 'META-INF/NOTICE'
|
||||
exclude 'META-INF/LICENSE'
|
||||
}
|
||||
|
||||
lintOptions {
|
||||
abortOnError false;
|
||||
disable 'InvalidPackage' // Some libraries have issues with this
|
||||
disable 'OldTargetApi' // Due to Robolectric that modifies the manifest when running tests
|
||||
}
|
||||
}
|
||||
|
||||
dependencies {
|
||||
def domainLayer = project(':domain')
|
||||
|
||||
//project dependencies
|
||||
compile domainLayer
|
||||
|
||||
//library dependencies
|
||||
compile('com.google.code.gson:gson:2.2.4')
|
||||
}
|
||||
17
data/proguard-rules.pro
vendored
Normal file
17
data/proguard-rules.pro
vendored
Normal file
@@ -0,0 +1,17 @@
|
||||
# Add project specific ProGuard rules here.
|
||||
# By default, the flags in this file are appended to flags specified
|
||||
# in /Users/fcejas/Software/SDKs/android-sdk/tools/proguard/proguard-android.txt
|
||||
# You can edit the include path and order by changing the proguardFiles
|
||||
# directive in build.gradle.
|
||||
#
|
||||
# For more details, see
|
||||
# http://developer.android.com/guide/developing/tools/proguard.html
|
||||
|
||||
# Add any project specific keep options here:
|
||||
|
||||
# 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 *;
|
||||
#}
|
||||
5
data/src/main/AndroidManifest.xml
Normal file
5
data/src/main/AndroidManifest.xml
Normal file
@@ -0,0 +1,5 @@
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
package="com.fernandocejas.android10.sample.data">
|
||||
|
||||
<application android:allowBackup="true" />
|
||||
</manifest>
|
||||
@@ -38,7 +38,11 @@ android {
|
||||
|
||||
dependencies {
|
||||
def domainLayer = project(':domain')
|
||||
def dataLayer = project(':data')
|
||||
|
||||
//project dependencies
|
||||
compile domainLayer
|
||||
compile dataLayer
|
||||
|
||||
//compile this only for testing. I had to use a workaround for using Espresso (it is not in the
|
||||
//maven central repository): since both Mockito and Espresso use 'hamcrest' I had to remove them
|
||||
|
||||
@@ -22,7 +22,7 @@ public class MainActivity extends Activity {
|
||||
* Maps the graphical user interface controls.
|
||||
*/
|
||||
private void mapGUI() {
|
||||
btn_LoadData = (Button)findViewById(R.id.btn_LoadData);
|
||||
btn_LoadData = (Button) findViewById(R.id.btn_LoadData);
|
||||
btn_LoadData.setOnClickListener(loadDataOnClickListener);
|
||||
}
|
||||
|
||||
|
||||
@@ -1 +1 @@
|
||||
include ':presentation', ':domain'
|
||||
include ':presentation', ':domain', ':data', ':data-test'
|
||||
|
||||
Reference in New Issue
Block a user