forked from grpc/grpc-java
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Apply maven-publish plugin explicitly when needed
- Loading branch information
Showing
22 changed files
with
130 additions
and
83 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,6 @@ | ||
plugins { | ||
id "maven-publish" | ||
|
||
id "com.github.kt3k.coveralls" | ||
} | ||
|
||
|
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,4 +1,6 @@ | ||
plugins { | ||
id "maven-publish" | ||
|
||
id "com.github.johnrengelman.shadow" | ||
id "com.google.protobuf" | ||
} | ||
|
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,4 +1,6 @@ | ||
plugins { | ||
id "maven-publish" | ||
|
||
id "me.champeau.gradle.jmh" | ||
} | ||
|
||
|
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,3 +1,7 @@ | ||
plugins { | ||
id "maven-publish" | ||
} | ||
|
||
description = "gRPC: Auth" | ||
dependencies { | ||
compile project(':grpc-api'), | ||
|
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,5 +1,6 @@ | ||
plugins { | ||
id "application" | ||
id "maven-publish" | ||
|
||
id "com.google.protobuf" | ||
id "me.champeau.gradle.jmh" | ||
|
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,3 +1,7 @@ | ||
plugins { | ||
id "maven-publish" | ||
} | ||
|
||
description = 'gRPC: BOM' | ||
|
||
publishing { | ||
|
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 |
---|---|---|
|
@@ -11,7 +11,6 @@ subprojects { | |
apply plugin: "checkstyle" | ||
apply plugin: "java" | ||
apply plugin: "maven" | ||
apply plugin: "maven-publish" | ||
apply plugin: "idea" | ||
apply plugin: "signing" | ||
apply plugin: "jacoco" | ||
|
@@ -305,109 +304,107 @@ subprojects { | |
} | ||
} | ||
|
||
task javadocJar(type: Jar) { | ||
classifier = 'javadoc' | ||
from javadoc | ||
} | ||
|
||
task sourcesJar(type: Jar) { | ||
classifier = 'sources' | ||
from sourceSets.main.allSource | ||
} | ||
|
||
publishing { | ||
publications { | ||
// do not use mavenJava, as java plugin will modify it via "magic" | ||
maven(MavenPublication) { | ||
if (project.name != 'grpc-netty-shaded') { | ||
from components.java | ||
} | ||
plugins.withId("maven-publish") { | ||
task javadocJar(type: Jar) { | ||
classifier = 'javadoc' | ||
from javadoc | ||
} | ||
|
||
artifact javadocJar | ||
artifact sourcesJar | ||
task sourcesJar(type: Jar) { | ||
classifier = 'sources' | ||
from sourceSets.main.allSource | ||
} | ||
|
||
pom { | ||
name = project.group + ":" + project.name | ||
url = 'https://github.com/grpc/grpc-java' | ||
afterEvaluate { | ||
// description is not available until evaluated. | ||
description = project.description | ||
publishing { | ||
publications { | ||
// do not use mavenJava, as java plugin will modify it via "magic" | ||
maven(MavenPublication) { | ||
if (project.name != 'grpc-netty-shaded') { | ||
from components.java | ||
} | ||
|
||
scm { | ||
connection = 'scm:git:https://github.com/grpc/grpc-java.git' | ||
developerConnection = 'scm:git:[email protected]:grpc/grpc-java.git' | ||
artifact javadocJar | ||
artifact sourcesJar | ||
|
||
pom { | ||
name = project.group + ":" + project.name | ||
url = 'https://github.com/grpc/grpc-java' | ||
} | ||
afterEvaluate { | ||
// description is not available until evaluated. | ||
description = project.description | ||
} | ||
|
||
licenses { | ||
license { | ||
name = 'Apache 2.0' | ||
url = 'https://opensource.org/licenses/Apache-2.0' | ||
scm { | ||
connection = 'scm:git:https://github.com/grpc/grpc-java.git' | ||
developerConnection = 'scm:git:[email protected]:grpc/grpc-java.git' | ||
url = 'https://github.com/grpc/grpc-java' | ||
} | ||
} | ||
|
||
developers { | ||
developer { | ||
id = "grpc.io" | ||
name = "gRPC Contributors" | ||
email = "[email protected]" | ||
url = "https://grpc.io/" | ||
organization = "gRPC Authors" | ||
organizationUrl = "https://www.google.com" | ||
licenses { | ||
license { | ||
name = 'Apache 2.0' | ||
url = 'https://opensource.org/licenses/Apache-2.0' | ||
} | ||
} | ||
} | ||
|
||
withXml { | ||
if (!(project.name in | ||
[ | ||
"grpc-stub", | ||
"grpc-protobuf", | ||
"grpc-protobuf-lite", | ||
])) { | ||
asNode().dependencies.'*'.findAll() { dep -> | ||
dep.artifactId.text() in ['grpc-api', 'grpc-core'] | ||
}.each() { core -> | ||
core.version*.value = "[" + core.version.text() + "]" | ||
developers { | ||
developer { | ||
id = "grpc.io" | ||
name = "gRPC Contributors" | ||
email = "[email protected]" | ||
url = "https://grpc.io/" | ||
organization = "gRPC Authors" | ||
organizationUrl = "https://www.google.com" | ||
} | ||
} | ||
|
||
withXml { | ||
if (!(project.name in | ||
[ | ||
"grpc-stub", | ||
"grpc-protobuf", | ||
"grpc-protobuf-lite", | ||
])) { | ||
asNode().dependencies.'*'.findAll() { dep -> | ||
dep.artifactId.text() in ['grpc-api', 'grpc-core'] | ||
}.each() { core -> | ||
core.version*.value = "[" + core.version.text() + "]" | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
repositories { | ||
maven { | ||
if (rootProject.hasProperty('repositoryDir')) { | ||
url = new File(rootProject.repositoryDir).toURI() | ||
} else { | ||
String stagingUrl | ||
if (rootProject.hasProperty('repositoryId')) { | ||
stagingUrl = 'https://oss.sonatype.org/service/local/staging/deployByRepositoryId/' + | ||
rootProject.repositoryId | ||
repositories { | ||
maven { | ||
if (rootProject.hasProperty('repositoryDir')) { | ||
url = new File(rootProject.repositoryDir).toURI() | ||
} else { | ||
stagingUrl = 'https://oss.sonatype.org/service/local/staging/deploy/maven2/' | ||
} | ||
credentials { | ||
if (rootProject.hasProperty('ossrhUsername') && rootProject.hasProperty('ossrhPassword')) { | ||
username = rootProject.ossrhUsername | ||
password = rootProject.ossrhPassword | ||
String stagingUrl | ||
if (rootProject.hasProperty('repositoryId')) { | ||
stagingUrl = 'https://oss.sonatype.org/service/local/staging/deployByRepositoryId/' + | ||
rootProject.repositoryId | ||
} else { | ||
stagingUrl = 'https://oss.sonatype.org/service/local/staging/deploy/maven2/' | ||
} | ||
credentials { | ||
if (rootProject.hasProperty('ossrhUsername') && rootProject.hasProperty('ossrhPassword')) { | ||
username = rootProject.ossrhUsername | ||
password = rootProject.ossrhPassword | ||
} | ||
} | ||
def releaseUrl = stagingUrl | ||
def snapshotUrl = 'https://oss.sonatype.org/content/repositories/snapshots/' | ||
url = version.endsWith('SNAPSHOT') ? snapshotUrl : releaseUrl | ||
} | ||
def releaseUrl = stagingUrl | ||
def snapshotUrl = 'https://oss.sonatype.org/content/repositories/snapshots/' | ||
url = version.endsWith('SNAPSHOT') ? snapshotUrl : releaseUrl | ||
} | ||
} | ||
} | ||
} | ||
} | ||
|
||
signing { | ||
required false | ||
sign publishing.publications.maven | ||
} | ||
|
||
[publishMavenPublicationToMavenRepository, publishMavenPublicationToMavenLocal]*.onlyIf { | ||
!name.contains("grpc-gae-interop-testing") && !name.contains("grpc-xds") | ||
signing { | ||
required false | ||
sign publishing.publications.maven | ||
} | ||
} | ||
|
||
// At a test failure, log the stack trace to the console so that we don't | ||
|
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,5 +1,6 @@ | ||
plugins { | ||
id "cpp" | ||
id "maven-publish" | ||
|
||
id "com.google.protobuf" | ||
} | ||
|
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,4 +1,6 @@ | ||
plugins { | ||
id "maven-publish" | ||
|
||
id "me.champeau.gradle.jmh" | ||
} | ||
|
||
|
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,4 +1,6 @@ | ||
plugins { | ||
id "maven-publish" | ||
|
||
id "me.champeau.gradle.jmh" | ||
} | ||
|
||
|
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,4 +1,6 @@ | ||
plugins { | ||
id "maven-publish" | ||
|
||
id "com.google.protobuf" | ||
} | ||
|
||
|
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,5 +1,6 @@ | ||
plugins { | ||
id "application" | ||
id "maven-publish" | ||
|
||
id "com.google.protobuf" | ||
} | ||
|
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,4 +1,6 @@ | ||
plugins { | ||
id "maven-publish" | ||
|
||
id "me.champeau.gradle.jmh" | ||
} | ||
|
||
|
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,4 +1,6 @@ | ||
plugins { | ||
id "maven-publish" | ||
|
||
id "com.github.johnrengelman.shadow" | ||
} | ||
|
||
|
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,3 +1,7 @@ | ||
plugins { | ||
id "maven-publish" | ||
} | ||
|
||
description = "gRPC: OkHttp" | ||
|
||
dependencies { | ||
|
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,4 +1,6 @@ | ||
plugins { | ||
id "maven-publish" | ||
|
||
id "com.google.protobuf" | ||
} | ||
|
||
|
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,4 +1,6 @@ | ||
plugins { | ||
id "maven-publish" | ||
|
||
id "com.google.protobuf" | ||
} | ||
|
||
|
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,4 +1,6 @@ | ||
plugins { | ||
id "maven-publish" | ||
|
||
id "com.google.protobuf" | ||
} | ||
|
||
|
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,3 +1,7 @@ | ||
plugins { | ||
id "maven-publish" | ||
} | ||
|
||
description = "gRPC: Stub" | ||
dependencies { | ||
compile project(':grpc-api') | ||
|
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,4 +1,6 @@ | ||
plugins { | ||
id "maven-publish" | ||
|
||
id "com.google.protobuf" | ||
} | ||
|
||
|
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,3 +1,7 @@ | ||
plugins { | ||
id "maven-publish" | ||
} | ||
|
||
description = "gRPC: Testing" | ||
|
||
dependencies { | ||
|
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