apply plugin: 'com.android.application' apply plugin: 'robolectric' buildscript { repositories { mavenCentral() } dependencies { classpath 'org.robolectric:robolectric-gradle-plugin:0.12.+' } } android { compileSdkVersion Integer.parseInt(project.ANDROID_BUILD_SDK_VERSION) buildToolsVersion project.ANDROID_BUILD_TOOLS_VERSION defaultConfig { minSdkVersion Integer.parseInt(project.ANDROID_BUILD_MIN_SDK_VERSION) targetSdkVersion Integer.parseInt(project.ANDROID_BUILD_TARGET_SDK_VERSION) testInstrumentationRunner "com.google.android.apps.common.testing.testrunner.GoogleInstrumentationTestRunner" } buildTypes { release { runProguard false proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt' } } productFlavors { } sourceSets { main { aidl.srcDirs = ['src/main/java'] } instrumentTest.setRoot('src/androidTest/java') androidTest { java.srcDir file('src/androidTest/java') setRoot('src/androidTest/') } } lintOptions { //checkReleaseBuilds false // Or, if you prefer, you can continue to check for errors in release builds, // but continue the build even when errors are found: abortOnError false } } configurations { robolectricTests { extendsFrom compile } } sourceSets { robolectricTests { java.srcDir file('src/androidTest/java') resources.srcDir file('src/androidTest/resources') compileClasspath += configurations.robolectricTests runtimeClasspath += compileClasspath } } configurations.all { resolutionStrategy { force 'com.android.support:support-v4:20.+' force 'com.android.support:appcompat-v7:20.+' } } dependencies { // You must install or update the Google Repository through the SDK manager to use this dependency. // The Google Repository (separate from the corresponding library) can be found in the Extras category. // compile 'com.google.android.gms:play-services:4.2.42' compile files('src/main/libs/gson-2.2.4.jar') compile files('src/main/libs/jsoup-1.7.2.jar') compile project(':Changeloglib:ChangeLogLibrary') compile project(':MessageBar') compile project(':ownCloud-Account-Importer') compile project(':ShowcaseView:library') compile project(':android-HoloCircularProgressBar:library') compile 'com.android.support:support-v4:20.+' compile 'com.android.support:appcompat-v7:20.+' compile 'com.jakewharton:butterknife:5.1.+' compile 'com.squareup.picasso:picasso:2.3.1@jar' compile 'com.sothree.slidinguppanel:library:+' compile 'de.greenrobot:eventbus:2.2.1' compile 'de.greenrobot:greendao:1.3.7@jar' compile 'de.greenrobot:greendao-generator:1.3.1@jar' compile 'org.freemarker:freemarker:2.3.18@jar' androidTestCompile 'org.hamcrest:hamcrest-integration:1.1' androidTestCompile 'org.hamcrest:hamcrest-core:1.1' androidTestCompile 'org.hamcrest:hamcrest-library:1.1' androidTestCompile('org.robolectric:robolectric:2.+'){ exclude module: 'classworlds' exclude module: 'maven-artifact' exclude module: 'maven-artifact-manager' exclude module: 'maven-error-diagnostics' exclude module: 'maven-model' exclude module: 'maven-plugin-registry' exclude module: 'maven-profile' exclude module: 'maven-project' exclude module: 'maven-settings' exclude module: 'nekohtml' exclude module: 'plexus-container-default' exclude module: 'plexus-interpolation' exclude module: 'plexus-utils' exclude module: 'wagon-file' exclude module: 'wagon-http-lightweight' exclude module: 'wagon-http-shared' exclude module: 'wagon-provider-api' exclude group: 'com.android.support', module: 'support-v4' } androidTestCompile('junit:junit:4.+') { exclude module: 'hamcrest-core' } androidTestCompile 'com.squareup.assertj:assertj-android:+' } apply plugin: 'idea' idea { module { testOutputDir = file('build/test-classes') } } /* task robolectric(type: Test, dependsOn: assemble) { workingDir 'src/main' testClassesDir = sourceSets.robolectricTests.output.classesDir android.sourceSets.main.java.srcDirs.each { dir -> def buildDir = dir.getAbsolutePath().split('/') buildDir = (buildDir[0..(buildDir.length - 4)] + ['build', 'classes', 'debug']).join('/') project.getPlugins().getPlugin('android').prepareTaskMap.each { sourceSets.robolectricTests.compileClasspath += files(it.value.explodedDir.getAbsolutePath() + '/classes.jar') sourceSets.robolectricTests.runtimeClasspath += files(it.value.explodedDir.getAbsolutePath() + '/classes.jar') } sourceSets.robolectricTests.compileClasspath += files(buildDir) sourceSets.robolectricTests.runtimeClasspath += files(buildDir) } classpath = sourceSets.robolectricTests.runtimeClasspath } */