-
Notifications
You must be signed in to change notification settings - Fork 10.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Publish Gradle Module Metadata with Variants.
To be conservative, this commit does not removes most annotation artifacts from Gradle's runtime classpath, only j2objc-annotations. The other artifacts contain at least some annotations with RUNTIME visibility (IIRC). (Even this change could theoretically affect users who assume that they can read CLASS-retention annotations (of which j2objc-annotations has some) from bytecode and find them in the runtime classpath. But that seems unlikely, especially for j2objc annotations.) We may consider being more aggressive in the future. For now, this particular commit addresses #2824 for Gradle users just a tiny bit, and it helps with the problem that prompted #6567. Fixes #3683 RELNOTES=Added [Gradle Module Metadata](https://docs.gradle.org/current/userguide/publishing_gradle_module_metadata.html). If you use Gradle 6 or higher, Gradle can automatically intelligently resolve conflicts between `guava-android` and `guava-jre`, among [other benefits](#3683). PiperOrigin-RevId: 544108700
- Loading branch information
Showing
16 changed files
with
1,044 additions
and
2 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 |
---|---|---|
@@ -0,0 +1,10 @@ | ||
name: "Validate Gradle Wrapper" | ||
on: [push, pull_request] | ||
|
||
jobs: | ||
validation: | ||
name: "Validation" | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: gradle/wrapper-validation-action@v1 |
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
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 |
---|---|---|
@@ -0,0 +1,287 @@ | ||
{ | ||
"formatVersion": "1.1", | ||
"component": { | ||
"group": "${pom.groupId}", | ||
"module": "${pom.artifactId}", | ||
"version": "${pom.version}", | ||
"attributes": { | ||
"org.gradle.status": "${module.status}" | ||
} | ||
}, | ||
"createdBy": { | ||
"maven": { | ||
"version": "${maven.version}", | ||
"buildId": "${maven.build.version}" | ||
} | ||
}, | ||
"variants": [ | ||
{ | ||
"name": "${variant.jvmEnvironment}ApiElements", | ||
"attributes": { | ||
"org.gradle.category": "library", | ||
"org.gradle.dependency.bundling": "external", | ||
"org.gradle.jvm.version": "8", | ||
"org.gradle.jvm.environment": "${variant.jvmEnvironment}", | ||
"org.gradle.libraryelements": "jar", | ||
"org.gradle.usage": "java-api" | ||
}, | ||
"dependencies": [ | ||
{ | ||
"group": "com.google.guava", | ||
"module": "guava-parent", | ||
"version": { | ||
"requires": "${pom.version}" | ||
}, | ||
"attributes": { | ||
"org.gradle.category": "platform" | ||
} | ||
}, | ||
{ | ||
"group": "com.google.guava", | ||
"module": "failureaccess", | ||
"version": { | ||
"requires": "1.0.1" | ||
} | ||
}, | ||
{ | ||
"group": "com.google.code.findbugs", | ||
"module": "jsr305" | ||
}, | ||
{ | ||
"group": "org.checkerframework", | ||
"module": "checker-qual" | ||
}, | ||
{ | ||
"group": "com.google.errorprone", | ||
"module": "error_prone_annotations" | ||
}, | ||
{ | ||
"group": "com.google.j2objc", | ||
"module": "j2objc-annotations" | ||
} | ||
], | ||
"files": [ | ||
{ | ||
"name": "${project.build.finalName}.jar", | ||
"url": "${project.build.finalName}.jar" | ||
} | ||
], | ||
"capabilities": [ | ||
{ | ||
"group": "com.google.guava", | ||
"name": "guava", | ||
"version": "${pom.version}" | ||
}, | ||
{ | ||
"group": "com.google.collections", | ||
"name": "google-collections", | ||
"version": "${pom.version}" | ||
}, | ||
{ | ||
"group": "com.google.guava", | ||
"name": "listenablefuture", | ||
"version": "1.0" | ||
} | ||
] | ||
}, | ||
{ | ||
"name": "${variant.jvmEnvironment}RuntimeElements", | ||
"attributes": { | ||
"org.gradle.category": "library", | ||
"org.gradle.dependency.bundling": "external", | ||
"org.gradle.jvm.version": "8", | ||
"org.gradle.jvm.environment": "${variant.jvmEnvironment}", | ||
"org.gradle.libraryelements": "jar", | ||
"org.gradle.usage": "java-runtime" | ||
}, | ||
"dependencies": [ | ||
{ | ||
"group": "com.google.guava", | ||
"module": "guava-parent", | ||
"version": { | ||
"requires": "${pom.version}" | ||
}, | ||
"attributes": { | ||
"org.gradle.category": "platform" | ||
} | ||
}, | ||
{ | ||
"group": "com.google.guava", | ||
"module": "failureaccess", | ||
"version": { | ||
"requires": "1.0.1" | ||
} | ||
}, | ||
{ | ||
"group": "com.google.code.findbugs", | ||
"module": "jsr305" | ||
}, | ||
{ | ||
"group": "org.checkerframework", | ||
"module": "checker-qual" | ||
}, | ||
{ | ||
"group": "com.google.errorprone", | ||
"module": "error_prone_annotations" | ||
} | ||
], | ||
"files": [ | ||
{ | ||
"name": "${project.build.finalName}.jar", | ||
"url": "${project.build.finalName}.jar" | ||
} | ||
], | ||
"capabilities": [ | ||
{ | ||
"group": "com.google.guava", | ||
"name": "guava", | ||
"version": "${pom.version}" | ||
}, | ||
{ | ||
"group": "com.google.collections", | ||
"name": "google-collections", | ||
"version": "${pom.version}" | ||
}, | ||
{ | ||
"group": "com.google.guava", | ||
"name": "listenablefuture", | ||
"version": "1.0" | ||
} | ||
] | ||
}, | ||
{ | ||
"name": "${otherVariant.jvmEnvironment}ApiElements", | ||
"attributes": { | ||
"org.gradle.category": "library", | ||
"org.gradle.dependency.bundling": "external", | ||
"org.gradle.jvm.version": "8", | ||
"org.gradle.jvm.environment": "${otherVariant.jvmEnvironment}", | ||
"org.gradle.libraryelements": "jar", | ||
"org.gradle.usage": "java-api" | ||
}, | ||
"dependencies": [ | ||
{ | ||
"group": "com.google.guava", | ||
"module": "guava-parent", | ||
"version": { | ||
"requires": "${otherVariant.version}" | ||
}, | ||
"attributes": { | ||
"org.gradle.category": "platform" | ||
} | ||
}, | ||
{ | ||
"group": "com.google.guava", | ||
"module": "failureaccess", | ||
"version": { | ||
"requires": "1.0.1" | ||
} | ||
}, | ||
{ | ||
"group": "com.google.code.findbugs", | ||
"module": "jsr305" | ||
}, | ||
{ | ||
"group": "org.checkerframework", | ||
"module": "checker-qual" | ||
}, | ||
{ | ||
"group": "com.google.errorprone", | ||
"module": "error_prone_annotations" | ||
}, | ||
{ | ||
"group": "com.google.j2objc", | ||
"module": "j2objc-annotations" | ||
} | ||
], | ||
"files": [ | ||
{ | ||
"name": "${pom.artifactId}-${otherVariant.version}.jar", | ||
"url": "../${otherVariant.version}/${pom.artifactId}-${otherVariant.version}.jar" | ||
} | ||
], | ||
"capabilities": [ | ||
{ | ||
"group": "com.google.guava", | ||
"name": "guava", | ||
"version": "${pom.version}" | ||
}, | ||
{ | ||
"group": "com.google.collections", | ||
"name": "google-collections", | ||
"version": "${pom.version}" | ||
}, | ||
{ | ||
"group": "com.google.guava", | ||
"name": "listenablefuture", | ||
"version": "1.0" | ||
} | ||
] | ||
}, | ||
{ | ||
"name": "${otherVariant.jvmEnvironment}RuntimeElements", | ||
"attributes": { | ||
"org.gradle.category": "library", | ||
"org.gradle.dependency.bundling": "external", | ||
"org.gradle.jvm.version": "8", | ||
"org.gradle.jvm.environment": "${otherVariant.jvmEnvironment}", | ||
"org.gradle.libraryelements": "jar", | ||
"org.gradle.usage": "java-runtime" | ||
}, | ||
"dependencies": [ | ||
{ | ||
"group": "com.google.guava", | ||
"module": "guava-parent", | ||
"version": { | ||
"requires": "${otherVariant.version}" | ||
}, | ||
"attributes": { | ||
"org.gradle.category": "platform" | ||
} | ||
}, | ||
{ | ||
"group": "com.google.guava", | ||
"module": "failureaccess", | ||
"version": { | ||
"requires": "1.0.1" | ||
} | ||
}, | ||
{ | ||
"group": "com.google.code.findbugs", | ||
"module": "jsr305" | ||
}, | ||
{ | ||
"group": "org.checkerframework", | ||
"module": "checker-qual" | ||
}, | ||
{ | ||
"group": "com.google.errorprone", | ||
"module": "error_prone_annotations" | ||
} | ||
], | ||
"files": [ | ||
{ | ||
"name": "${pom.artifactId}-${otherVariant.version}.jar", | ||
"url": "../${otherVariant.version}/${pom.artifactId}-${otherVariant.version}.jar" | ||
} | ||
], | ||
"capabilities": [ | ||
{ | ||
"group": "com.google.guava", | ||
"name": "guava", | ||
"version": "${pom.version}" | ||
}, | ||
{ | ||
"group": "com.google.collections", | ||
"name": "google-collections", | ||
"version": "${pom.version}" | ||
}, | ||
{ | ||
"group": "com.google.guava", | ||
"name": "listenablefuture", | ||
"version": "1.0" | ||
} | ||
] | ||
} | ||
] | ||
} |
Oops, something went wrong.