Skip to content

Commit f9ddbdf

Browse files
authored
deps: update gradle-nexus-publish-plugin (googleapis#269)
* deps: update gradle-nexus-publish-plugin * chore: fix the units check * chore: pim Gradle version at 6.9.1
1 parent a737e25 commit f9ddbdf

6 files changed

Lines changed: 113 additions & 76 deletions

File tree

api-common-java/.github/workflows/ci.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ jobs:
2222
- name: Gradle Test
2323
run: ./gradlew test
2424
- name: Gradle Build
25-
run: ./gradlew build install
25+
run: ./gradlew build
2626
format:
2727
runs-on: ubuntu-latest
2828
steps:

api-common-java/build.gradle

Lines changed: 20 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -10,19 +10,18 @@ buildscript {
1010
}
1111
dependencies {
1212
classpath "gradle.plugin.com.github.sherter.google-java-format:google-java-format-gradle-plugin:0.9",
13-
"io.codearte.gradle.nexus:gradle-nexus-staging-plugin:0.30.0"
13+
"io.github.gradle-nexus:publish-plugin:1.1.0"
1414
}
1515
}
16-
1716
apply plugin: 'java'
18-
apply plugin: 'maven'
1917
apply plugin: 'eclipse'
2018
apply plugin: 'idea'
2119
apply plugin: 'jacoco'
2220
apply plugin: 'signing'
2321
apply plugin: 'maven-publish'
2422
apply plugin: 'com.github.sherter.google-java-format'
25-
apply plugin: 'io.codearte.nexus-staging'
23+
apply plugin: 'io.github.gradle-nexus.publish-plugin'
24+
2625

2726
group = "com.google.api"
2827
archivesBaseName = "api-common"
@@ -64,15 +63,15 @@ dependencies {
6463

6564
annotationProcessor libraries.auto_value
6665

67-
compile libraries.guava,
66+
implementation( libraries.guava,
6867
libraries.jsr305,
6968
libraries.javax_annotations,
70-
libraries.auto_value_annotations
69+
libraries.auto_value_annotations)
7170

7271
compileOnly libraries.error_prone_annotations
7372

74-
testCompile libraries.junit,
75-
libraries.truth
73+
testImplementation(libraries.junit,
74+
libraries.truth)
7675
}
7776

7877
clean.doFirst {
@@ -97,7 +96,9 @@ jar {
9796

9897
// Source jar
9998
// ----------
100-
99+
project.gradle.taskGraph.whenReady {
100+
println project.gradle.taskGraph.getAllTasks()
101+
}
101102
task sourcesJar(type: Jar, dependsOn: classes) {
102103
classifier = 'sources'
103104
from sourceSets.main.allSource
@@ -161,7 +162,7 @@ configurations {
161162

162163
dependencies {
163164
codeGeneration libraries.auto_value, libraries.jsr305
164-
compile libraries.jsr305, libraries.auto_value_annotations
165+
implementation(libraries.jsr305, libraries.auto_value_annotations)
165166
}
166167

167168
compileJava.classpath += configurations.codeGeneration
@@ -214,18 +215,22 @@ artifacts {
214215
}
215216

216217
signing {
217-
required { gradle.taskGraph.hasTask("uploadArchives") }
218+
required { gradle.taskGraph.hasTask("publishToSonatype") }
218219
if (project.hasProperty('signing.gnupg.executable')) {
219220
useGpgCmd()
220221
}
221222
sign configurations.archives
222223
}
223224

224225
if (project.hasProperty('ossrhUsername') && project.hasProperty('ossrhPassword')) {
225-
nexusStaging {
226-
username = ossrhUsername
227-
password = ossrhPassword
226+
nexusPublishing {
228227
packageGroup = "com.google.api"
228+
repositories {
229+
sonatype { //or custom repository name
230+
username = ossrhUsername
231+
password = ossrhPassword
232+
}
233+
}
229234
}
230235
}
231236

@@ -422,7 +427,7 @@ task stageRelease {
422427
exec {
423428
// We need to spawn a new gradle build process in order to upload appropriately
424429
// More details: http://stackoverflow.com/questions/31614735/gradle-uploadarchives-artificats-namespace-when-depending-on-a-plugin
425-
commandLine './gradlew', 'uploadArchives'
430+
commandLine './gradlew', 'publishToSonatype', 'closeAndReleaseSonatypeStagingRepository'
426431
}
427432
}
428433
}
10.8 KB
Binary file not shown.
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
#Tue Sep 20 10:02:51 PDT 2016
21
distributionBase=GRADLE_USER_HOME
32
distributionPath=wrapper/dists
3+
# pinning this at 6.9.1 because gradle-7.0 and above do not support the necessary groovy imports.
4+
distributionUrl=https\://services.gradle.org/distributions/gradle-6.9.1-bin.zip
45
zipStoreBase=GRADLE_USER_HOME
56
zipStorePath=wrapper/dists
6-
distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.3-all.zip

api-common-java/gradlew

Lines changed: 67 additions & 48 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

api-common-java/gradlew.bat

Lines changed: 23 additions & 10 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)