Download File
Download Project
Settings
Line Wrap
Themes
default
ambiance
bespin
dracula
eclipse
material
mbo
mdn-like
neat
solarized dark
ttcn
zenburn
build.gradle
apply plugin: 'com.android.application' android { compileSdkVersion rootProject.ext.compileSdkVersion buildToolsVersion rootProject.ext.buildToolsVersion /* Test only modules require other artifacts like the classes.jar to be published, so the test can reference the tested java sources and compile them correctly. In order to get all these artifacts published from the tested module publishNonDefault needs to be set to true. */ publishNonDefault true defaultConfig { minSdkVersion rootProject.ext.minSdkVersion targetSdkVersion rootProject.ext.targetSdkVersion applicationId 'com.example.android.testing.blueprint' versionCode 1 versionName '1.0' testInstrumentationRunner 'android.support.test.runner.AndroidJUnitRunner' /* The Android Testing Support Library collects analytics to continuously improve the testing experience. More specifically, it uploads a hash of the package name of the application under test for each invocation. If you do not wish to upload this data, you can opt-out by passing the following argument to the test runner: disableAnalytics "true". */ //testInstrumentationRunnerArguments disableAnalytics: 'true' /* Uncomment this to pass custom arguments to AndroidJUnitRunner. If uncommented the custom argument "argument1" will be passed to AndroidJUnitRunner and make AndroidLibraryModuleIntegrationTest fail. */ // testInstrumentationRunnerArgument "argument1", "make_test_fail" } buildTypes { debug { // Run code coverage reports by default on debug builds. testCoverageEnabled = true // Uncomment this to run test against a minified version of the production APK /* minifyEnabled true proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' testProguardFile 'proguard-test-rules.pro' */ } release { minifyEnabled true proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' } } productFlavors { flavor1 { applicationId 'com.example.android.testing.blueprint.flavor1' } flavor2 { applicationId 'com.example.android.testing.blueprint.flavor2' } } // Always show the result of every unit test, even if it passes. testOptions.unitTests.all { testLogging { events 'passed', 'skipped', 'failed', 'standardOut', 'standardError' } } } dependencies { // App's dependencies, including test compile 'com.android.support:appcompat-v7:' + rootProject.ext.supportLibVersion compile project(':module-plain-java') // Optional module for non-Android code compile project(':module-android-library') // Optional module for additional Android code // Dependencies for local unit tests testCompile 'junit:junit:' + rootProject.ext.junitVersion testCompile 'org.mockito:mockito-all:' + rootProject.ext.mockitoVersion testCompile 'org.hamcrest:hamcrest-all:' + rootProject.ext.hamcrestVersion // Android Testing Support Library's runner and rules androidTestCompile 'com.android.support.test:runner:' + rootProject.ext.runnerVersion androidTestCompile 'com.android.support.test:rules:' + rootProject.ext.rulesVersion // Espresso UI Testing androidTestCompile 'com.android.support.test.espresso:espresso-core:' + rootProject.ext.espressoVersion // Espresso-Contrib, Intents and Web dependencies are not used in this project. /* androidTestCompile 'com.android.support.test.espresso:espresso-contrib:' + rootProject.ext.espressoVersion androidTestCompile 'com.android.support.test.espresso:espresso-intents:' + rootProject.ext.espressoVersion androidTestCompile 'com.android.support.test.espresso:espresso-web:' + rootProject.ext.espressoVersion */ // UIAutomator Testing. Learn about this dependency in this projects README file. androidTestCompile 'com.android.support.test.uiautomator:uiautomator-v18:' + rootProject.ext.uiautomatorVersion // Resolve conflicts between main and test APK: androidTestCompile "com.android.support:support-annotations:$rootProject.supportLibVersion" }