From 3d5302c6312198fbfaa90a8bac30b8e7f23c408d Mon Sep 17 00:00:00 2001 From: Jeff Lockhart Date: Fri, 19 May 2023 20:50:03 -0600 Subject: [PATCH 1/6] Publish gradle module metadata --- android-ktx/gradle.properties | 1 + android-ktx/lib/build.gradle | 30 ++++++++---------------------- android-ktx/test/build.gradle | 5 +---- android/gradle.properties | 1 + android/lib/build.gradle | 28 ++-------------------------- java/gradle.properties | 1 + java/lib/build.gradle | 16 +--------------- 7 files changed, 15 insertions(+), 67 deletions(-) diff --git a/android-ktx/gradle.properties b/android-ktx/gradle.properties index d6ac4b8c..47acd4fe 100644 --- a/android-ktx/gradle.properties +++ b/android-ktx/gradle.properties @@ -27,3 +27,4 @@ android.useAndroidX=true android.enableJetifier=false android.disableAutomaticComponentCreation=true +kotlin.stdlib.default.dependency=false diff --git a/android-ktx/lib/build.gradle b/android-ktx/lib/build.gradle index 2f4b30ea..c640f9c2 100644 --- a/android-ktx/lib/build.gradle +++ b/android-ktx/lib/build.gradle @@ -78,9 +78,6 @@ def MAVEN_URL = (project.hasProperty("mavenUrl")) ? mavenUrl : "http://nowhere.v // ./gradlew -Pcoverage=true coverage def COVERAGE = project.hasProperty("coverage") -// Set true to use mavenLocal instead of Proget -def USE_LOCAL_MAVEN = project.hasProperty("useLocalMaven") - // ---------------------------------------------------------------- // Build @@ -169,7 +166,7 @@ android { } repositories { - if (USE_LOCAL_MAVEN) { mavenLocal() } + if (BUILD_NUMBER == "SNAPSHOT") { mavenLocal() } else { maven { url "http://proget.build.couchbase.com/maven2/cimaven" @@ -185,10 +182,10 @@ dependencies { // androidx.work:work-runtime-ktx:2.8.0 requires 1.3.0 compileOnly 'androidx.annotation:annotation:1.3.0' - implementation "org.jetbrains.kotlinx:kotlinx-coroutines-core:1.6.4" + compileOnly "org.jetbrains.kotlinx:kotlinx-coroutines-core:1.6.4" // Work Manager support - implementation "androidx.work:work-runtime-ktx:2.8.1" + compileOnly "androidx.work:work-runtime-ktx:2.8.1" implementation("com.couchbase.lite:${CBL_ANDROID_LIB}:${BUILD_VERSION}") { changing = true } @@ -199,7 +196,10 @@ dependencies { androidTestImplementation 'androidx.test:rules:1.5.0' androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.1' + androidTestImplementation "org.jetbrains.kotlinx:kotlinx-coroutines-core:1.6.4" + // Work Manager Test support + androidTestImplementation "androidx.work:work-runtime-ktx:2.8.1" androidTestImplementation "androidx.work:work-testing:2.8.1" } @@ -317,7 +317,7 @@ project.afterEvaluate { artifactId CBL_ARTIFACT_ID version BUILD_VERSION - artifact bundleReleaseAar + from components.release artifact dokkaJar artifact sourcesJar @@ -326,13 +326,6 @@ project.afterEvaluate { def root = asNode() root.appendNode('description', CBL_DESCRIPTION) root.children().last() + pomConfig - - def dependenciesNode = root.appendNode('dependencies') - def dep = dependenciesNode.appendNode('dependency') - dep.appendNode('groupId', CBL_GROUP) - dep.appendNode('artifactId', CBL_ANDROID_LIB) - dep.appendNode('version', BUILD_VERSION) - dep.appendNode('type', CBL_ANDROID_TYPE) } } @@ -341,7 +334,7 @@ project.afterEvaluate { artifactId CBL_ARTIFACT_ID version BUILD_VERSION - artifact bundleDebugAar + from components.debug artifact dokkaJar artifact sourcesJar @@ -350,13 +343,6 @@ project.afterEvaluate { def root = asNode() root.appendNode('description', CBL_DESCRIPTION) root.children().last() + pomConfig - - def dependenciesNode = root.appendNode('dependencies') - def dep = dependenciesNode.appendNode('dependency') - dep.appendNode('groupId', CBL_GROUP) - dep.appendNode('artifactId', CBL_ANDROID_LIB) - dep.appendNode('version', BUILD_VERSION) - dep.appendNode('type', CBL_ANDROID_TYPE) } } } diff --git a/android-ktx/test/build.gradle b/android-ktx/test/build.gradle index 6085ff57..bd80e9db 100644 --- a/android-ktx/test/build.gradle +++ b/android-ktx/test/build.gradle @@ -56,9 +56,6 @@ ext { // e.g., -PtestFilter='com.couchbase.lite.internal.utils.SlowTest,com.couchbase.lite.internal.utils.VerySlowTest' def TEST_FILTER = (!project.hasProperty("testFilter")) ? null : testFilter.replaceAll("\\s", "") -// Set true to use mavenLocal instead of Proget -def USE_LOCAL_MAVEN = project.hasProperty("useLocalMaven") - // ---------------------------------------------------------------- // Build @@ -124,7 +121,7 @@ android { } repositories { - if (USE_LOCAL_MAVEN) { mavenLocal() } + if (BUILD_NUMBER == "SNAPSHOT") { mavenLocal() } else { maven { url "http://proget.build.couchbase.com/maven2/cimaven" diff --git a/android/gradle.properties b/android/gradle.properties index d6ac4b8c..47acd4fe 100644 --- a/android/gradle.properties +++ b/android/gradle.properties @@ -27,3 +27,4 @@ android.useAndroidX=true android.enableJetifier=false android.disableAutomaticComponentCreation=true +kotlin.stdlib.default.dependency=false diff --git a/android/lib/build.gradle b/android/lib/build.gradle index eb5fdb2d..7b42a9a0 100644 --- a/android/lib/build.gradle +++ b/android/lib/build.gradle @@ -508,7 +508,7 @@ project.afterEvaluate { artifactId CBL_ARTIFACT_ID version BUILD_VERSION - artifact bundleReleaseAar + from components.release artifact sourcesJar artifact javadocJar @@ -517,18 +517,6 @@ project.afterEvaluate { def root = asNode() root.appendNode('description', CBL_DESCRIPTION) root.children().last() + pomConfig - - def dependenciesNode = root.appendNode('dependencies') - - // Include only configured dependencies - configurations.implementation.allDependencies.each { - if (DEPENDENCIES.contains(it.name)) { - def dep = dependenciesNode.appendNode('dependency') - dep.appendNode('groupId', it.group) - dep.appendNode('artifactId', it.name) - dep.appendNode('version', it.version) - } - } } } @@ -537,7 +525,7 @@ project.afterEvaluate { artifactId CBL_ARTIFACT_ID version BUILD_VERSION - artifact bundleDebugAar + from components.debug artifact sourcesJar artifact javadocJar @@ -546,18 +534,6 @@ project.afterEvaluate { def root = asNode() root.appendNode('description', CBL_DESCRIPTION) root.children().last() + pomConfig - - def dependenciesNode = root.appendNode('dependencies') - - // Include only configured dependencies - configurations.implementation.allDependencies.each { - if (DEPENDENCIES.contains(it.name)) { - def dep = dependenciesNode.appendNode('dependency') - dep.appendNode('groupId', it.group) - dep.appendNode('artifactId', it.name) - dep.appendNode('version', it.version) - } - } } } } diff --git a/java/gradle.properties b/java/gradle.properties index 2eb22c2c..8bba0857 100644 --- a/java/gradle.properties +++ b/java/gradle.properties @@ -19,3 +19,4 @@ org.gradle.jvmargs=-Xmx4608m # Required to publish to ProGet (see https://github.com/gradle/gradle/issues/11308) systemProp.org.gradle.internal.publish.checksums.insecure=true +kotlin.stdlib.default.dependency=false diff --git a/java/lib/build.gradle b/java/lib/build.gradle index 9b576800..7172316f 100644 --- a/java/lib/build.gradle +++ b/java/lib/build.gradle @@ -612,7 +612,7 @@ publishing { artifactId "${JAR_ARTIFACT}${suffix}" version BUILD_VERSION - artifact jar + from components.java artifact sourcesJar artifact javadocJar @@ -644,20 +644,6 @@ publishing { connection = CBL_PROJECT_URL developerConnection = CBL_PROJECT_URL } - - withXml { - def dependenciesNode = asNode().appendNode('dependencies') - - // Include only configured dependencies - configurations.implementation.allDependencies.each { - if (DEPENDENCIES.contains(it.name)) { - def dep = dependenciesNode.appendNode('dependency') - dep.appendNode('groupId', it.group) - dep.appendNode('artifactId', it.name) - dep.appendNode('version', it.version) - } - } - } } } } From d3b1f4e187b3b4cfe2faf373e6f07164d8e2b758 Mon Sep 17 00:00:00 2001 From: Jeff Lockhart Date: Mon, 22 May 2023 11:07:36 -0600 Subject: [PATCH 2/6] Add Android variant to Java and Java variant to Android Publish as variant dependency in Gradle Module Metadata so consumers can identify the libraries as mutually exclusive platform variants --- android/lib/build.gradle | 47 ++++++++++++++++++++++++++++++++++++++-- java/lib/build.gradle | 37 +++++++++++++++++++++++++++++++ 2 files changed, 82 insertions(+), 2 deletions(-) diff --git a/android/lib/build.gradle b/android/lib/build.gradle index 7b42a9a0..e4e0f64f 100644 --- a/android/lib/build.gradle +++ b/android/lib/build.gradle @@ -17,6 +17,10 @@ // Please try to keep this build file as similar to the other family build files // as is possible. // + +import org.gradle.api.attributes.java.TargetJvmEnvironment +import org.jetbrains.kotlin.gradle.plugin.KotlinPlatformType + import java.time.Instant import java.util.regex.Pattern @@ -501,6 +505,47 @@ publishing { } project.afterEvaluate { + // Include Java variant definition in Gradle Module Metadata + def javaApiConfig = configurations.create("javaApi").tap { + canBeResolved = false + canBeConsumed = true + attributes { + attribute(TargetJvmEnvironment.TARGET_JVM_ENVIRONMENT_ATTRIBUTE, objects.named(TargetJvmEnvironment.class, TargetJvmEnvironment.STANDARD_JVM)) + attribute(KotlinPlatformType.attribute, KotlinPlatformType.jvm) + attribute(Usage.USAGE_ATTRIBUTE, objects.named(Usage.class, Usage.JAVA_API)) + } + } + + dependencies { + javaApi("com.couchbase.lite:couchbase-lite-java:$version") + } + + def javaRuntimeConfig = configurations.create("javaRuntime").tap { + extendsFrom(javaApiConfig) + canBeResolved = false + canBeConsumed = true + attributes { + attribute(TargetJvmEnvironment.TARGET_JVM_ENVIRONMENT_ATTRIBUTE, objects.named(TargetJvmEnvironment.class, TargetJvmEnvironment.STANDARD_JVM)) + attribute(KotlinPlatformType.attribute, KotlinPlatformType.jvm) + attribute(Usage.USAGE_ATTRIBUTE, objects.named(Usage.class, Usage.JAVA_RUNTIME)) + } + } + + // AdhocComponentWithVariants is wrapped by anonymous component class, find it with reflection + def adhocField = components.release.class.getDeclaredFields() + .find { it.getType() == AdhocComponentWithVariants } + adhocField.setAccessible(true) + AdhocComponentWithVariants adhocComponent = adhocField.get(components.release) + + adhocComponent.with { + addVariantsFromConfiguration(javaApiConfig) { + mapToMavenScope("compile") + } + addVariantsFromConfiguration(javaRuntimeConfig) { + mapToMavenScope("runtime") + } + } + publishing { publications { libRelease(MavenPublication) { @@ -512,7 +557,6 @@ project.afterEvaluate { artifact sourcesJar artifact javadocJar - // include dependencies pom.withXml { def root = asNode() root.appendNode('description', CBL_DESCRIPTION) @@ -529,7 +573,6 @@ project.afterEvaluate { artifact sourcesJar artifact javadocJar - // include dependencies pom.withXml { def root = asNode() root.appendNode('description', CBL_DESCRIPTION) diff --git a/java/lib/build.gradle b/java/lib/build.gradle index 7172316f..4258adbc 100644 --- a/java/lib/build.gradle +++ b/java/lib/build.gradle @@ -18,7 +18,9 @@ import com.github.spotbugs.snom.SpotBugsTask import org.apache.tools.ant.filters.ReplaceTokens +import org.gradle.api.attributes.java.TargetJvmEnvironment import org.gradle.internal.os.OperatingSystem +import org.jetbrains.kotlin.gradle.plugin.KotlinPlatformType import java.util.regex.Pattern @@ -603,6 +605,41 @@ project.afterEvaluate { tasks.withType(Zip) { duplicatesStrategy = DuplicatesStrategy.EXCLUDE } } +// Include Android variant definition in Gradle Module Metadata +def androidApiConfig = configurations.create("androidApi").tap { + canBeResolved = false + canBeConsumed = true + attributes { + attribute(TargetJvmEnvironment.TARGET_JVM_ENVIRONMENT_ATTRIBUTE, objects.named(TargetJvmEnvironment.class, TargetJvmEnvironment.ANDROID)) + attribute(KotlinPlatformType.attribute, KotlinPlatformType.androidJvm) + attribute(Usage.USAGE_ATTRIBUTE, objects.named(Usage.class, Usage.JAVA_API)) + } +} + +dependencies { + androidApi("com.couchbase.lite:couchbase-lite-android:$version") +} + +def androidRuntimeConfig = configurations.create("androidRuntime").tap { + extendsFrom(androidApiConfig) + canBeResolved = false + canBeConsumed = true + attributes { + attribute(TargetJvmEnvironment.TARGET_JVM_ENVIRONMENT_ATTRIBUTE, objects.named(TargetJvmEnvironment.class, TargetJvmEnvironment.ANDROID)) + attribute(KotlinPlatformType.attribute, KotlinPlatformType.androidJvm) + attribute(Usage.USAGE_ATTRIBUTE, objects.named(Usage.class, Usage.JAVA_RUNTIME)) + } +} + +(components.java as AdhocComponentWithVariants).with { + addVariantsFromConfiguration(androidApiConfig) { + mapToMavenScope("compile") + } + addVariantsFromConfiguration(androidRuntimeConfig) { + mapToMavenScope("runtime") + } +} + publishing { publications { couchbaseLiteJava(MavenPublication) { From 81bb4676f9b716a6884ccc4e58edb1456d7847db Mon Sep 17 00:00:00 2001 From: Jeff Lockhart Date: Mon, 22 May 2023 12:41:21 -0600 Subject: [PATCH 3/6] Filter out other platform variant as .pom dependency --- android-ktx/lib/build.gradle | 18 ++++++++++++++++++ android/lib/build.gradle | 20 ++++++++++++++++++++ java/lib/build.gradle | 13 +++++++++++++ 3 files changed, 51 insertions(+) diff --git a/android-ktx/lib/build.gradle b/android-ktx/lib/build.gradle index c640f9c2..e6587484 100644 --- a/android-ktx/lib/build.gradle +++ b/android-ktx/lib/build.gradle @@ -326,6 +326,15 @@ project.afterEvaluate { def root = asNode() root.appendNode('description', CBL_DESCRIPTION) root.children().last() + pomConfig + + def dependencies = root.dependencies.dependency + + // Include only configured dependencies + dependencies.each { + if (CBL_ANDROID_LIB != it.artifactId.last().value().last()) { + it.parent().remove(it) + } + } } } @@ -343,6 +352,15 @@ project.afterEvaluate { def root = asNode() root.appendNode('description', CBL_DESCRIPTION) root.children().last() + pomConfig + + def dependencies = root.dependencies.dependency + + // Include only configured dependencies + dependencies.each { + if (CBL_ANDROID_LIB != it.artifactId.last().value().last()) { + it.parent().remove(it) + } + } } } } diff --git a/android/lib/build.gradle b/android/lib/build.gradle index e4e0f64f..9e327ea9 100644 --- a/android/lib/build.gradle +++ b/android/lib/build.gradle @@ -540,9 +540,11 @@ project.afterEvaluate { adhocComponent.with { addVariantsFromConfiguration(javaApiConfig) { mapToMavenScope("compile") + mapToOptional() } addVariantsFromConfiguration(javaRuntimeConfig) { mapToMavenScope("runtime") + mapToOptional() } } @@ -561,6 +563,15 @@ project.afterEvaluate { def root = asNode() root.appendNode('description', CBL_DESCRIPTION) root.children().last() + pomConfig + + def dependencies = root.dependencies.dependency + + // Include only configured dependencies + dependencies.each { + if (!DEPENDENCIES.contains(it.artifactId.last().value().last())) { + it.parent().remove(it) + } + } } } @@ -577,6 +588,15 @@ project.afterEvaluate { def root = asNode() root.appendNode('description', CBL_DESCRIPTION) root.children().last() + pomConfig + + def dependencies = root.dependencies.dependency + + // Include only configured dependencies + dependencies.each { + if (!DEPENDENCIES.contains(it.artifactId.last().value().last())) { + it.parent().remove(it) + } + } } } } diff --git a/java/lib/build.gradle b/java/lib/build.gradle index 4258adbc..a8653147 100644 --- a/java/lib/build.gradle +++ b/java/lib/build.gradle @@ -634,9 +634,11 @@ def androidRuntimeConfig = configurations.create("androidRuntime").tap { (components.java as AdhocComponentWithVariants).with { addVariantsFromConfiguration(androidApiConfig) { mapToMavenScope("compile") + mapToOptional() } addVariantsFromConfiguration(androidRuntimeConfig) { mapToMavenScope("runtime") + mapToOptional() } } @@ -681,6 +683,17 @@ publishing { connection = CBL_PROJECT_URL developerConnection = CBL_PROJECT_URL } + + withXml { + def dependencies = asNode().dependencies.dependency + + // Include only configured dependencies + dependencies.each { + if (!DEPENDENCIES.contains(it.artifactId.last().value())) { + it.parent().remove(it) + } + } + } } } } From 907a0a63006311de77a73d300a7953f198b6d6c1 Mon Sep 17 00:00:00 2001 From: Jeff Lockhart Date: Tue, 23 May 2023 14:22:27 -0600 Subject: [PATCH 4/6] Add comments --- android/lib/build.gradle | 3 +++ java/lib/build.gradle | 1 + 2 files changed, 4 insertions(+) diff --git a/android/lib/build.gradle b/android/lib/build.gradle index 9e327ea9..c622eb88 100644 --- a/android/lib/build.gradle +++ b/android/lib/build.gradle @@ -516,6 +516,7 @@ project.afterEvaluate { } } + // Add variant artifact as a dependencies, since it's in another module dependencies { javaApi("com.couchbase.lite:couchbase-lite-java:$version") } @@ -532,6 +533,8 @@ project.afterEvaluate { } // AdhocComponentWithVariants is wrapped by anonymous component class, find it with reflection + // can be replaced with (components.release as AdhocComponentWithVariants) + // with this fix: https://youtrack.jetbrains.com/issue/KT-58830 def adhocField = components.release.class.getDeclaredFields() .find { it.getType() == AdhocComponentWithVariants } adhocField.setAccessible(true) diff --git a/java/lib/build.gradle b/java/lib/build.gradle index a8653147..9ad44afd 100644 --- a/java/lib/build.gradle +++ b/java/lib/build.gradle @@ -616,6 +616,7 @@ def androidApiConfig = configurations.create("androidApi").tap { } } +// Add variant artifact as a dependencies, since it's in another module dependencies { androidApi("com.couchbase.lite:couchbase-lite-android:$version") } From 73196d13cc30d95e39afdca0b9a6b469d1cc5b99 Mon Sep 17 00:00:00 2001 From: Jeff Lockhart Date: Tue, 23 May 2023 14:29:51 -0600 Subject: [PATCH 5/6] Add library category attributes to variants --- android/lib/build.gradle | 2 ++ java/lib/build.gradle | 2 ++ 2 files changed, 4 insertions(+) diff --git a/android/lib/build.gradle b/android/lib/build.gradle index c622eb88..b07790ac 100644 --- a/android/lib/build.gradle +++ b/android/lib/build.gradle @@ -510,6 +510,7 @@ project.afterEvaluate { canBeResolved = false canBeConsumed = true attributes { + attribute(Category.CATEGORY_ATTRIBUTE, objects.named(Category.class, Category.LIBRARY)) attribute(TargetJvmEnvironment.TARGET_JVM_ENVIRONMENT_ATTRIBUTE, objects.named(TargetJvmEnvironment.class, TargetJvmEnvironment.STANDARD_JVM)) attribute(KotlinPlatformType.attribute, KotlinPlatformType.jvm) attribute(Usage.USAGE_ATTRIBUTE, objects.named(Usage.class, Usage.JAVA_API)) @@ -526,6 +527,7 @@ project.afterEvaluate { canBeResolved = false canBeConsumed = true attributes { + attribute(Category.CATEGORY_ATTRIBUTE, objects.named(Category.class, Category.LIBRARY)) attribute(TargetJvmEnvironment.TARGET_JVM_ENVIRONMENT_ATTRIBUTE, objects.named(TargetJvmEnvironment.class, TargetJvmEnvironment.STANDARD_JVM)) attribute(KotlinPlatformType.attribute, KotlinPlatformType.jvm) attribute(Usage.USAGE_ATTRIBUTE, objects.named(Usage.class, Usage.JAVA_RUNTIME)) diff --git a/java/lib/build.gradle b/java/lib/build.gradle index 9ad44afd..0ffcd004 100644 --- a/java/lib/build.gradle +++ b/java/lib/build.gradle @@ -610,6 +610,7 @@ def androidApiConfig = configurations.create("androidApi").tap { canBeResolved = false canBeConsumed = true attributes { + attribute(Category.CATEGORY_ATTRIBUTE, objects.named(Category.class, Category.LIBRARY)) attribute(TargetJvmEnvironment.TARGET_JVM_ENVIRONMENT_ATTRIBUTE, objects.named(TargetJvmEnvironment.class, TargetJvmEnvironment.ANDROID)) attribute(KotlinPlatformType.attribute, KotlinPlatformType.androidJvm) attribute(Usage.USAGE_ATTRIBUTE, objects.named(Usage.class, Usage.JAVA_API)) @@ -626,6 +627,7 @@ def androidRuntimeConfig = configurations.create("androidRuntime").tap { canBeResolved = false canBeConsumed = true attributes { + attribute(Category.CATEGORY_ATTRIBUTE, objects.named(Category.class, Category.LIBRARY)) attribute(TargetJvmEnvironment.TARGET_JVM_ENVIRONMENT_ATTRIBUTE, objects.named(TargetJvmEnvironment.class, TargetJvmEnvironment.ANDROID)) attribute(KotlinPlatformType.attribute, KotlinPlatformType.androidJvm) attribute(Usage.USAGE_ATTRIBUTE, objects.named(Usage.class, Usage.JAVA_RUNTIME)) From b3c93c0c88c3cbc42b17bb9358d991345221a9de Mon Sep 17 00:00:00 2001 From: Jeff Lockhart Date: Tue, 27 Jun 2023 21:12:03 -0600 Subject: [PATCH 6/6] Revert removing USE_LOCAL_MAVEN --- android-ktx/lib/build.gradle | 5 ++++- android-ktx/test/build.gradle | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/android-ktx/lib/build.gradle b/android-ktx/lib/build.gradle index e6587484..8cee4160 100644 --- a/android-ktx/lib/build.gradle +++ b/android-ktx/lib/build.gradle @@ -78,6 +78,9 @@ def MAVEN_URL = (project.hasProperty("mavenUrl")) ? mavenUrl : "http://nowhere.v // ./gradlew -Pcoverage=true coverage def COVERAGE = project.hasProperty("coverage") +// Set true to use mavenLocal instead of Proget +def USE_LOCAL_MAVEN = project.hasProperty("useLocalMaven") + // ---------------------------------------------------------------- // Build @@ -166,7 +169,7 @@ android { } repositories { - if (BUILD_NUMBER == "SNAPSHOT") { mavenLocal() } + if (USE_LOCAL_MAVEN) { mavenLocal() } else { maven { url "http://proget.build.couchbase.com/maven2/cimaven" diff --git a/android-ktx/test/build.gradle b/android-ktx/test/build.gradle index bd80e9db..6085ff57 100644 --- a/android-ktx/test/build.gradle +++ b/android-ktx/test/build.gradle @@ -56,6 +56,9 @@ ext { // e.g., -PtestFilter='com.couchbase.lite.internal.utils.SlowTest,com.couchbase.lite.internal.utils.VerySlowTest' def TEST_FILTER = (!project.hasProperty("testFilter")) ? null : testFilter.replaceAll("\\s", "") +// Set true to use mavenLocal instead of Proget +def USE_LOCAL_MAVEN = project.hasProperty("useLocalMaven") + // ---------------------------------------------------------------- // Build @@ -121,7 +124,7 @@ android { } repositories { - if (BUILD_NUMBER == "SNAPSHOT") { mavenLocal() } + if (USE_LOCAL_MAVEN) { mavenLocal() } else { maven { url "http://proget.build.couchbase.com/maven2/cimaven"