-
Notifications
You must be signed in to change notification settings - Fork 752
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix listing of dependencies in Volley POM files. (#423)
We were depending directly on the .aar, which loses the dependency information from the build configuration itself. This caused android.annotations to (correctly) show up as a dependency. Since it is only needed for annotations (like `@Nullable`) that don't need to be retained at runtime, we can mark this as a compileOnly dependency, matching its former "provided" state, to prevent Volley users from needing it. However, this introduces a compiler warning in the tests, since @RestrictTo has RetentionPolicy.CLASS and is not present at compile time; since we apply -Werror to all compile tasks, this becomes a compiler error. For now, to keep the build as close as possible to the prior state, add the annotations as an implementation dependency to the tests; a proper fix is tracked in #424. The only resulting change to the POM files is that volley-cronet declares a dependency on volley. Note that volley-cronet doesn't declare a dependency on Cronet because there are two plausible choices for how to use Cronet - the version in GmsCore, or the standalone version. There's no great way to codify this dependency choice, so leave it unstated. Fixes #402
- Loading branch information
Showing
3 changed files
with
53 additions
and
60 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,17 @@ | ||
dependencies { | ||
implementation project(":core") | ||
implementation "androidx.annotation:annotation:1.0.1" | ||
compileOnly "androidx.annotation:annotation:1.0.1" | ||
compileOnly "org.chromium.net:cronet-embedded:76.3809.111" | ||
|
||
testImplementation project(":testing") | ||
testImplementation "org.chromium.net:cronet-embedded:76.3809.111" | ||
testImplementation "junit:junit:4.12" | ||
testImplementation "org.mockito:mockito-core:2.19.0" | ||
testImplementation "org.robolectric:robolectric:3.4.2" | ||
// TODO(#424): Fix this dependency at the library level. | ||
testImplementation "androidx.annotation:annotation:1.0.1" | ||
} | ||
|
||
publishing { | ||
publications { | ||
library(MavenPublication) { | ||
artifactId 'volley-cronet' | ||
pom { | ||
name = 'Volley Cronet' | ||
description = 'Cronet support for Volley.' | ||
} | ||
artifact "$buildDir/outputs/aar/cronet-release.aar" | ||
} | ||
} | ||
} | ||
project.ext.artifactId = 'volley-cronet' | ||
project.ext.pomName = 'Volley Cronet' | ||
project.ext.pomDescription = 'Cronet support for Volley.' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters