diff --git a/buildSrc/src/main/java/Dependencies.kt b/buildSrc/src/main/java/Dependencies.kt index f30f5c691..a9aaf0e88 100644 --- a/buildSrc/src/main/java/Dependencies.kt +++ b/buildSrc/src/main/java/Dependencies.kt @@ -56,6 +56,7 @@ object Deps { const val tools_androidgradle = "com.android.tools.build:gradle:${Versions.android_gradle_plugin}" const val tools_kotlingradle = "org.jetbrains.kotlin:kotlin-gradle-plugin:${Versions.kotlin}" const val kotlin_stdlib = "org.jetbrains.kotlin:kotlin-stdlib-jdk7:${Versions.kotlin}" + const val kotlin_stdlib_jdk8 = "org.jetbrains.kotlin:kotlin-stdlib-jdk8:${Versions.kotlin}" const val kotlin_reflect = "org.jetbrains.kotlin:kotlin-reflect:${Versions.kotlin}" const val kotlin_coroutines = "org.jetbrains.kotlinx:kotlinx-coroutines-core:${Versions.coroutines}" const val kotlin_coroutines_test = "org.jetbrains.kotlinx:kotlinx-coroutines-test:${Versions.coroutines}" diff --git a/mozilla-detekt-rules/build.gradle b/mozilla-detekt-rules/build.gradle index 9b7bdf731..3b046618b 100644 --- a/mozilla-detekt-rules/build.gradle +++ b/mozilla-detekt-rules/build.gradle @@ -3,9 +3,13 @@ apply plugin: 'kotlin' dependencies { compileOnly Deps.detektApi + // I didn't look thoroughly enough to really know what's going on here but I think + // the detekt API uses jdk8 so if we provide jdk7, the dependency collision system + // doesn't work and there are duplicate APIs with different versions in the output. + implementation Deps.kotlin_stdlib_jdk8 + testImplementation Deps.detektApi testImplementation Deps.detektTest - implementation Deps.kotlin_stdlib testImplementation Deps.junitApi testImplementation Deps.junitParams testRuntimeOnly Deps.junitEngine diff --git a/mozilla-lint-rules/build.gradle b/mozilla-lint-rules/build.gradle index 29587123e..f1676dae9 100644 --- a/mozilla-lint-rules/build.gradle +++ b/mozilla-lint-rules/build.gradle @@ -9,19 +9,22 @@ targetCompatibility = JavaVersion.VERSION_1_8 sourceCompatibility = JavaVersion.VERSION_1_8 dependencies { - compileOnly Deps.kotlin_stdlib - compileOnly "org.jetbrains.kotlin:kotlin-stdlib-jdk8:${Versions.kotlin}" + // I didn't look thoroughly enough to really know what's going on here but I think + // the lint API uses jdk8 so if we provide jdk7, the dependency collision system + // doesn't work and there are duplicate APIs with different versions in the output. + // + // The prepareLintJar task fails with "Found more than one jar in the 'lintChecks' configuration" + // if we include the stdlib (with implementation) so we have to do compileOnly + testImplementation. + compileOnly Deps.kotlin_stdlib_jdk8 compileOnly Deps.kotlin_reflect + testImplementation Deps.kotlin_stdlib_jdk8 + testImplementation Deps.kotlin_reflect compileOnly "com.android.tools.lint:lint-api:${Versions.android_lint_api}" compileOnly "com.android.tools.lint:lint-checks:${Versions.android_lint_api}" - testImplementation Deps.kotlin_stdlib - testImplementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:${Versions.kotlin}" - testImplementation Deps.kotlin_reflect testImplementation "com.android.tools.lint:lint:${Versions.android_lint_api}" testImplementation "com.android.tools.lint:lint-tests:${Versions.android_lint_api}" - testImplementation Deps.junitApi } jar {