@@ -22,7 +22,6 @@ import com.google.common.collect.Sets
2222
2323plugins {
2424 id ' com.google.api-ads.java-conventions'
25- id ' signing'
2625 id ' com.google.protobuf' version ' 0.8.15'
2726 id " com.github.hierynomus.license-report" version " 0.15.0"
2827 id ' com.github.johnrengelman.shadow' version ' 6.1.0'
@@ -311,52 +310,13 @@ task testShadowJar {
311310 }
312311}
313312
314- def configurePom (publication , nameToSet , descriptionToSet ) {
315- publication. pom {
316- name = nameToSet
317- description = descriptionToSet
318- url = ' https://github.com/googleads/google-ads-java'
319- licenses {
320- license {
321- name = ' The Apache License, Version 2.0'
322- url = ' http://www.apache.org/licenses/LICENSE-2.0.txt'
323- }
324- }
325- scm {
326- connection = ' scm:git:https://github.com/googleads/google-ads-java'
327- developerConnection = ' scm:git:https://github.com/googleads/google-ads-java'
328- url = ' https://github.com/googleads/google-ads-java'
329- }
330- developers {
331- developer {
332- id = ' josh'
333- name = ' Josh Radcliff'
334- email = ' jradcliff@users.noreply.github.com'
335- organization = ' Google'
336- organizationUrl = ' https://www.google.com'
337- }
338- developer {
339- id = ' nick'
340- name = ' Nick Birnie'
341- email = ' nwbirnie@users.noreply.github.com'
342- organization = ' Google'
343- organizationUrl = ' https://www.google.com'
344- }
345- developer {
346- id = ' devin'
347- name = ' Devin Chasanoff'
348- email = ' devchas@users.noreply.github.com'
349- organization = ' Google'
350- organizationUrl = ' https://www.google.com'
351- }
352- }
353- }
354- }
355-
356- final def sonatypeCredentialsConfig = file(System . properties[' user.home' ] + ' /.sonatype-creds' )
357-
358313publishing {
359314 publications {
315+ maven(MavenPublication ) { publication ->
316+ configurePom(publication,
317+ " Google Ads API client library for Java - main library" ,
318+ " Main library for the Google Ads API client library for Java" )
319+ }
360320 shadow(MavenPublication ) { publication ->
361321 project. shadow. component(publication)
362322 // Publishes the javadoc + sources with the shadowjar.
@@ -375,46 +335,4 @@ publishing {
375335 " Provides a jar with all dependencies" )
376336 }
377337 }
378-
379- repositories {
380- maven {
381- url ' https://oss.sonatype.org/service/local/staging/deploy/maven2'
382- name = " sonatype"
383-
384- if (sonatypeCredentialsConfig. exists()) {
385- def props = new Properties ()
386- sonatypeCredentialsConfig. withInputStream { props. load(it) }
387- credentials {
388- username props[' username' ]
389- password props[' password' ]
390- }
391- }
392- }
393- }
394- }
395-
396- signing {
397- sign publishing. publications. shadow
398- }
399-
400- // Disables signing tasks except on sonatype deploy. Avoids failing build for
401- // users without GPG configured.
402- gradle. taskGraph. whenReady {
403- if (gradle. taskGraph. allTasks
404- .findAll { it. name. matches(" publish.+ToSonatypeRepository" ) }
405- .isEmpty()) {
406- tasks. findByName(" signShadowPublication" ). enabled = false
407- }
408- }
409-
410- // Provide a helpful error message for missing sonatype credentials.
411- tasks. findAll {
412- if (it. name. matches(" publish.+ToSonatypeRepository" )) {
413- it. doFirst {
414- if (! sonatypeCredentialsConfig. exists()) {
415- throw new GradleException (" Unable to load Sonatype credentials from ${ sonatypeCredentialsConfig} ." )
416- }
417- }
418- }
419338}
420-
0 commit comments