From cc6c6bf096c15d38003f6339c48d36652d206c12 Mon Sep 17 00:00:00 2001 From: Jan Berkel Date: Wed, 17 Dec 2014 12:47:39 +0100 Subject: [PATCH] Tests-on-jvm should be a subproject --- build.gradle | 9 +++------ settings.gradle | 1 + tests-on-jvm/build.gradle | 11 +++++++---- 3 files changed, 11 insertions(+), 10 deletions(-) diff --git a/build.gradle b/build.gradle index 12b5ae3ed..1e1af3749 100644 --- a/build.gradle +++ b/build.gradle @@ -77,7 +77,9 @@ android { buildTypes { release { - signingConfig signingConfigs.release + if (project.hasProperty('storeFile')) { + signingConfig signingConfigs.release + } } } @@ -105,11 +107,6 @@ task checkstyle(type: Checkstyle) { classpath = files() } -task testsOnJVM(type: GradleBuild, dependsOn: assembleDebug) { - buildFile = 'tests-on-jvm/build.gradle' - tasks = ['test'] -} - if (project.hasProperty('keyAlias')) { android.signingConfigs.release.keyAlias = keyAlias } diff --git a/settings.gradle b/settings.gradle index d0eaf9438..05e675797 100644 --- a/settings.gradle +++ b/settings.gradle @@ -2,3 +2,4 @@ include ':plugins:Android-PullToRefresh:library' include ':plugins:ckChangeLog:library' include ':plugins:HoloColorPicker' include ':plugins:openpgp-api-library' +include ':tests-on-jvm' diff --git a/tests-on-jvm/build.gradle b/tests-on-jvm/build.gradle index 1a4b3e722..23e8608ef 100644 --- a/tests-on-jvm/build.gradle +++ b/tests-on-jvm/build.gradle @@ -5,8 +5,8 @@ repositories { apply plugin: 'java' dependencies { - testCompile 'junit:junit:4.+' - testCompile fileTree(dir: '../libs', include: '*.jar') + testCompile project(':') + testCompile 'junit:junit:4.12' } sourceSets { @@ -17,14 +17,17 @@ sourceSets { } test { - compileClasspath += files(['../build/intermediates/classes/debug']) - runtimeClasspath += files(['../build/intermediates/classes/debug']) + compileClasspath += files(rootProject.compileDebugJava.destinationDir) + runtimeClasspath += files(rootProject.compileDebugJava.destinationDir) + runtimeClasspath += rootProject.compileDebugJava.classpath java { srcDirs = ['src'] } } } +test.dependsOn ':compileDebugJava' + task wrapper(type: Wrapper) { gradleVersion = '1.11' }