Skip to content
This repository was archived by the owner on Sep 26, 2023. It is now read-only.
Merged
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
10 changes: 7 additions & 3 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ buildscript {
dependencies {
classpath "net.ltgt.gradle:gradle-apt-plugin:0.10",
"com.github.jengelman.gradle.plugins:shadow:1.2.4",
"io.codearte.gradle.nexus:gradle-nexus-staging-plugin:0.8.0"
"io.codearte.gradle.nexus:gradle-nexus-staging-plugin:0.8.0",
"gradle.plugin.com.dorongold.plugins:task-tree:1.3.1"

classpath "gradle.plugin.com.github.sherter.google-java-format:google-java-format-gradle-plugin:0.6"
}
Expand All @@ -30,6 +31,8 @@ ext {
authVersion = '0.11.0'
// Project names not used for release
nonReleaseProjects = ['benchmark']
// Project names not using the default publication configuration
noDefaultPublications = ['benchmark', 'gax-bom']
libraryVendor = 'Google'
}

Expand Down Expand Up @@ -93,6 +96,7 @@ subprojects {
apply plugin: "net.ltgt.apt"
apply plugin: 'com.github.johnrengelman.shadow'
apply plugin: 'maven-publish'
apply plugin: 'com.dorongold.task-tree'

group = "com.google.api"

Expand Down Expand Up @@ -280,7 +284,7 @@ subprojects {
// ----------

afterEvaluate {
if (!nonReleaseProjects.contains(project.name)) {
if (!noDefaultPublications.contains(project.name)) {
publishing {
publications {
mavenJava(MavenPublication) {
Expand Down Expand Up @@ -338,7 +342,7 @@ subprojects {
}

signing {
if (!project.hasProperty('skip.signing') && !nonReleaseProjects.contains(project.name)) {
if (!project.hasProperty('skip.signing') && !noDefaultPublications.contains(project.name)) {
sign publishing.publications.mavenJava
}
}
Expand Down
101 changes: 101 additions & 0 deletions gax-bom/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@

buildscript {
repositories {
mavenLocal()
maven {
url 'https://plugins.gradle.org/m2/'
}
mavenCentral()
jcenter()
}
}

archivesBaseName = "gax-bom"

project.version = "1.33.1-SNAPSHOT" // {x-version-update:gax-bom:current}

ext {
mavenJavaDir = "$project.buildDir/publications/mavenJava"
mavenJavaBomOutputFile = file(mavenJavaDir + "/pom-default.xml")
}

// Copy our pom.xml to the location where a generated POM would go
task copyPom() {
doLast {
new File(mavenJavaDir).mkdirs()
copy {
from 'pom.xml'
into mavenJavaDir
rename 'pom.xml', 'pom-default.xml'
}
}
}

assemble.dependsOn copyPom

This comment was marked as spam.

// We want to use our own pom.xml instead of the generated one, so we disable
// the pom.xml generation and have the publish tasks depend on `copyPom` instead.
tasks.whenTaskAdded { task ->
if (task.name == 'generatePomFileForMavenJavaPublication') {
task.enabled = false
} else if (task.name == 'publishMavenJavaPublicationToMavenLocal') {
task.dependsOn copyPom
} else if (task.name == 'publishMavenJavaPublicationToMavenRepository') {
task.dependsOn copyPom
}
}

jar.enabled = false

// Remove the default jar archive which is added by the 'java' plugin.
// We could avoid this by not applying the 'java' plugin to all submodules of
// gax, but that would create a little bit of a mess, so we hack around it here.
configurations.archives.artifacts.with { archives ->
def artifacts = []
archives.each {
if (it.file =~ 'jar') {
// We can't just call `archives.remove(it)` here because it triggers
// a `ConcurrentModificationException`, so we add matching artifacts
// to another list, then remove those elements outside of this iteration.
artifacts.add(it)
}
}
artifacts.each {
archives.remove(it)
}
}

artifacts {
archives(mavenJavaBomOutputFile) {
builtBy copyPom
}
}

afterEvaluate {
// We can't use the `publishing` section from the main build.gradle because
// we don't want all the Java artifacts, and we want to use our own pom.xml
// instead of the generated one.
publishing {
publications {
mavenJava(MavenPublication) {
version = project.version
artifact mavenJavaBomOutputFile
}
}
repositories {
maven {
url 'https://oss.sonatype.org/service/local/staging/deploy/maven2/'
credentials {
username = project.hasProperty('ossrhUsername') ? project.getProperty('ossrhUsername') : null
password = project.hasProperty('ossrhPassword') ? project.getProperty('ossrhPassword') : null
}
}
}
}

signing {
if (!project.hasProperty('skip.signing')) {
sign publishing.publications.mavenJava
}
}
}
68 changes: 68 additions & 0 deletions gax-bom/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<modelVersion>4.0.0</modelVersion>
<groupId>com.google.api</groupId>
<artifactId>gax-bom</artifactId>
<version>1.33.1-SNAPSHOT</version><!-- {x-version-update:gax-bom:current} -->
<packaging>pom</packaging>
<name>GAX (Google Api eXtensions) for Java</name>
<description>Google Api eXtensions for Java</description>
<url>https://github.com/googleapis/gax-java</url>
<licenses>
<license>
<name>BSD</name>
<url>https://github.com/googleapis/gax-java/blob/master/LICENSE</url>
</license>
</licenses>
<developers>
<developer>
<id>GoogleAPIs</id>
<name>GoogleAPIs</name>
<email>googleapis@googlegroups.com</email>
<url>https://github.com/googleapis/gax-java</url>
<organization>Google, LLC</organization>
<organizationUrl>https://www.google.com</organizationUrl>
</developer>
</developers>
<scm>
<connection>scm:git:https://github.com/googleapis/gax-java.git</connection>
<url>https://github.com/googleapis/gax-java</url>
</scm>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>com.google.api</groupId>
<artifactId>gax</artifactId>
<version>1.33.1-SNAPSHOT</version><!-- {x-version-update:gax:current} -->
</dependency>
<dependency>
<groupId>com.google.api</groupId>
<artifactId>gax</artifactId>
<version>1.33.1-SNAPSHOT</version><!-- {x-version-update:gax:current} -->
<classifier>testlib</classifier>
</dependency>
<dependency>
<groupId>com.google.api</groupId>
<artifactId>gax-grpc</artifactId>
<version>1.33.1-SNAPSHOT</version><!-- {x-version-update:gax-grpc:current} -->
</dependency>
<dependency>
<groupId>com.google.api</groupId>
<artifactId>gax-grpc</artifactId>
<version>1.33.1-SNAPSHOT</version><!-- {x-version-update:gax-grpc:current} -->
<classifier>testlib</classifier>
</dependency>
<dependency>
<groupId>com.google.api</groupId>
<artifactId>gax-httpjson</artifactId>
<version>0.50.1-SNAPSHOT</version><!-- {x-version-update:gax-httpjson:current} -->
</dependency>
<dependency>
<groupId>com.google.api</groupId>
<artifactId>gax-httpjson</artifactId>
<version>0.50.1-SNAPSHOT</version><!-- {x-version-update:gax-httpjson:current} -->
<classifier>testlib</classifier>
</dependency>
</dependencies>
</dependencyManagement>
</project>
1 change: 1 addition & 0 deletions settings.gradle
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
include "gax"
include "gax-bom"
include "gax-grpc"
include "gax-httpjson"
include "benchmark"
1 change: 1 addition & 0 deletions versions.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
# module:released-version:current-version

gax:1.33.0:1.33.1-SNAPSHOT
gax-bom:1.33.0:1.33.1-SNAPSHOT
gax-grpc:1.33.0:1.33.1-SNAPSHOT
gax-httpjson:0.50.0:0.50.1-SNAPSHOT
benchmark:0.35.0:0.35.1-SNAPSHOT