Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Publish Gradle Module Metadata with Variants. #6603

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,10 @@ jobs:
if: ${{ failure() }}
shell: bash
run: ./util/print_surefire_reports.sh
- name: 'Integration Test'
if: matrix.java == 11
shell: bash
run: util/gradle_integration_tests.sh

publish_snapshot:
name: 'Publish snapshot'
Expand Down
10 changes: 10 additions & 0 deletions .github/workflows/gradle-wrapper-validation.yml
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
45 changes: 45 additions & 0 deletions android/guava/pom.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<!-- do_not_remove: published-with-gradle-metadata -->
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>com.google.guava</groupId>
Expand Down Expand Up @@ -209,6 +210,50 @@
</execution>
</executions>
</plugin>
<plugin>
<artifactId>maven-resources-plugin</artifactId>
<executions>
<execution>
<id>gradle-module-metadata</id>
<phase>compile</phase>
<goals>
<goal>copy-resources</goal>
</goals>
<configuration>
<outputDirectory>target/publish</outputDirectory>
<resources>
<resource>
<directory>../../guava</directory>
<includes>
<include>module.json</include>
</includes>
<filtering>true</filtering>
</resource>
</resources>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId>
<executions>
<execution>
<id>attach-gradle-module-metadata</id>
<goals>
<goal>attach-artifact</goal>
</goals>
<configuration>
<artifacts>
<artifact>
<file>target/publish/module.json</file>
<type>module</type>
</artifact>
</artifacts>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
<profiles>
Expand Down
13 changes: 13 additions & 0 deletions android/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@
<project.build.outputTimestamp>1980-02-01T00:00:00Z</project.build.outputTimestamp>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<test.add.opens></test.add.opens>
<module.status>integration</module.status>
<variant.jvmEnvironment>android</variant.jvmEnvironment>
<otherVariant.version>HEAD-jre-SNAPSHOT</otherVariant.version>
<otherVariant.jvmEnvironment>standard-jvm</otherVariant.jvmEnvironment>
</properties>
<issueManagement>
<system>GitHub Issues</system>
Expand Down Expand Up @@ -262,6 +266,15 @@
<artifactId>maven-enforcer-plugin</artifactId>
<version>3.0.0-M3</version>
</plugin>
<plugin>
<artifactId>maven-resources-plugin</artifactId>
<version>3.3.1</version>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId>
<version>3.4.0</version>
</plugin>
</plugins>
</pluginManagement>
</build>
Expand Down
287 changes: 287 additions & 0 deletions guava/module.json
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"
}
]
}
]
}
Loading