Skip to content
This repository has been archived by the owner on Nov 8, 2023. It is now read-only.

Commit

Permalink
Add a workaround for work manager pom files
Browse files Browse the repository at this point in the history
To work around the bug gradle/gradle#3170
add explicit mention of dependency type @aar for android library dependencies.
This will mean that now pom files will now have correct <type>aar</type>

Comparison of old vs new:
https://paste.googleplex.com/6020163941957632

Test: ./gradlew createArchive and verify pom file dependencies now have type tag
Change-Id: Ia30454a4fba985865ea9b64622e3ba4c3ff67a3d
  • Loading branch information
liutikas committed Aug 15, 2018
1 parent be336de commit c6accd9
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ const val DEXMAKER_MOCKITO = "com.linkedin.dexmaker:dexmaker-mockito:2.19.0"
const val ESPRESSO_CONTRIB = "androidx.test.espresso:espresso-contrib:3.1.0-alpha3"
const val ESPRESSO_CORE = "androidx.test.espresso:espresso-core:3.1.0-alpha3"
const val FINDBUGS = "com.google.code.findbugs:jsr305:2.0.1"
const val FIREBASE_JOBDISPATCHER = "com.firebase:firebase-jobdispatcher:0.8.5"
const val FIREBASE_JOBDISPATCHER = "com.firebase:firebase-jobdispatcher:0.8.5@aar"
const val GOOGLE_COMPILE_TESTING = "com.google.testing.compile:compile-testing:0.11"
const val GSON = "com.google.code.gson:gson:2.8.0"
const val GUAVA = "com.google.guava:guava:23.5-jre"
Expand All @@ -42,7 +42,7 @@ const val KOTLIN_METADATA = "me.eugeniomarletti.kotlin.metadata:kotlin-metadata:
const val MOCKITO_CORE = "org.mockito:mockito-core:2.19.0"
const val MULTIDEX = "androidx.multidex:multidex:2.0.0"
const val NULLAWAY = "com.uber.nullaway:nullaway:0.3.7"
const val PLAY_SERVICES = "com.google.android.gms:play-services-base:11.6.0"
const val PLAY_SERVICES = "com.google.android.gms:play-services-base:11.6.0@aar"
const val REACTIVE_STREAMS = "org.reactivestreams:reactive-streams:1.0.0"
const val RX_JAVA = "io.reactivex.rxjava2:rxjava:2.0.6"
const val TEST_RUNNER = "androidx.test:runner:1.1.0-alpha3"
Expand Down
13 changes: 7 additions & 6 deletions work/workmanager-firebase/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -44,15 +44,16 @@ android {
}

dependencies {

// @aar and { transitive = true } are needed as a workaround for
// https://github.com/gradle/gradle/issues/3170
implementation(project(":work:work-runtime"))
implementation(PLAY_SERVICES, libs.support_exclude_config)
implementation(FIREBASE_JOBDISPATCHER, libs.support_exclude_config)
implementation(PLAY_SERVICES) { transitive = true }
implementation(FIREBASE_JOBDISPATCHER) { transitive = true }
// Temporary workaround to the fact that FIREBASE_JOBDISPATCHER imports v4 of 25.0.0, but we
// pull in 26.1.0 on some of the dependencies of v4, but not support-media-compat.
implementation("com.android.support:support-v4:26.1.0", libs.support_exclude_config)
implementation "android.arch.persistence.room:runtime:1.0.0"
annotationProcessor "android.arch.persistence.room:compiler:1.0.0"
implementation("com.android.support:support-v4:26.1.0@aar") { transitive = true }
implementation("android.arch.persistence.room:runtime:1.0.0@aar") { transitive = true }
annotationProcessor("android.arch.persistence.room:compiler:1.0.0")

androidTestImplementation(project(":work:work-runtime"))
androidTestImplementation(TEST_RUNNER)
Expand Down
8 changes: 5 additions & 3 deletions work/workmanager-test/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,11 @@ plugins {
}

dependencies {
implementation project(':work:work-runtime')
implementation "android.arch.lifecycle:livedata-core:1.1.0"
implementation "android.arch.persistence.room:runtime:1.0.0"
// @aar and { transitive = true } are needed as a workaround for
// https://github.com/gradle/gradle/issues/3170
implementation(project(':work:work-runtime'))
implementation("android.arch.lifecycle:livedata-core:1.1.0@aar") { transitive = true }
implementation("android.arch.persistence.room:runtime:1.0.0@aar") { transitive = true }
annotationProcessor "android.arch.persistence.room:compiler:1.0.0"

androidTestImplementation "android.arch.core:core-testing:1.1.0"
Expand Down
12 changes: 7 additions & 5 deletions work/workmanager/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,13 @@ android {
}

dependencies {
api "android.arch.lifecycle:extensions:1.1.0"
implementation "android.arch.persistence.room:runtime:1.1.1-rc1"
annotationProcessor "android.arch.persistence.room:compiler:1.1.1-rc1"
androidTestImplementation "android.arch.core:core-testing:1.1.0"
androidTestImplementation "android.arch.persistence.room:testing:1.1.1-rc1"
// @aar and { transitive = true } are needed as a workaround for
// https://github.com/gradle/gradle/issues/3170
api("android.arch.lifecycle:extensions:1.1.0@aar") { transitive = true }
implementation("android.arch.persistence.room:runtime:1.1.1-rc1@aar") { transitive = true }
annotationProcessor("android.arch.persistence.room:compiler:1.1.1-rc1")
androidTestImplementation("android.arch.core:core-testing:1.1.0")
androidTestImplementation("android.arch.persistence.room:testing:1.1.1-rc1")
androidTestImplementation(TEST_RUNNER)
androidTestImplementation(ESPRESSO_CORE)
androidTestImplementation(MOCKITO_CORE, libs.exclude_bytebuddy) // DexMaker has its own MockMaker
Expand Down

0 comments on commit c6accd9

Please sign in to comment.