11import groovy.io.FileType
22
3- buildscript {
4- repositories {
5- mavenLocal()
6- maven {
7- url ' https://plugins.gradle.org/m2/'
8- }
9- mavenCentral()
10- jcenter()
11- }
12- dependencies {
13- classpath " net.ltgt.gradle:gradle-apt-plugin:0.21" ,
14- " com.github.jengelman.gradle.plugins:shadow:6.1.0" ,
15- " io.github.gradle-nexus:publish-plugin:1.1.0" ,
16- " gradle.plugin.com.dorongold.plugins:task-tree:1.5"
17-
18- classpath " gradle.plugin.com.github.sherter.google-java-format:google-java-format-gradle-plugin:0.8"
19- }
3+ plugins {
4+ id ' java'
5+ id ' io.github.gradle-nexus.publish-plugin' version ' 1.1.0'
6+
7+ id ' com.dorongold.task-tree' version ' 2.1.0' apply false
8+ id ' com.github.johnrengelman.shadow' version ' 6.1.0' apply false
9+ id ' com.github.sherter.google-java-format' version ' 0.8' apply false
10+ id ' net.ltgt.apt' version ' 0.21' apply false
2011}
2112
22- apply plugin : ' java'
23- apply plugin : ' com.github.sherter.google-java-format'
24- apply plugin : ' io.github.gradle-nexus.publish-plugin'
25-
2613// TODO: Populate this from dependencies.properties version property (for proper Gradle-Bazel sync)
2714project. version = " 2.5.4-SNAPSHOT" // {x-version-update:gax:current}
2815
@@ -34,20 +21,10 @@ ext {
3421 libraryVendor = ' Google'
3522}
3623
37- googleJavaFormat {
38- exclude ' .apt_generated/**'
39- exclude ' bin/**'
40- exclude ' build/**'
41- exclude ' bazel*/**'
42- }
43-
44- // google-java-format-gradle-plugin:0.8 does not work with Java 1.7.
45- verifyGoogleJavaFormat. onlyIf { JavaVersion . current(). isJava8Compatible() }
46-
4724if (project. hasProperty(' ossrhUsername' ) && project. hasProperty(' ossrhPassword' ) &&
4825 ! nonReleaseProjects. contains(project. name)) {
4926 nexusPublishing {
50- packageGroup = " com.google.api"
27+ packageGroup = ' com.google.api'
5128 repositories {
5229 sonatype { // or custom repository name
5330 nexusUrl. set(uri(' https://google.oss.sonatype.org/service/local/' ))
@@ -59,16 +36,34 @@ if (project.hasProperty('ossrhUsername') && project.hasProperty('ossrhPassword')
5936 }
6037}
6138
62- allprojects {
63- repositories {
64- mavenCentral() // for google-java-format's dependency
65- }
39+ subprojects {
40+ apply plugin : ' java'
41+ apply plugin : ' eclipse'
42+ apply plugin : ' idea'
43+ apply plugin : ' jacoco'
44+ apply plugin : ' maven-publish'
45+ apply plugin : ' signing'
46+
47+ apply plugin : ' com.dorongold.task-tree'
48+ apply plugin : ' com.github.johnrengelman.shadow'
49+ apply plugin : ' com.github.sherter.google-java-format'
50+ apply plugin : ' net.ltgt.apt'
51+
52+ group = ' com.google.api'
53+
54+ sourceCompatibility = 1.8
55+ targetCompatibility = 1.8
6656
6757 // Formatting tasks
6858 // ================
69- apply plugin : ' com.github.sherter.google-java-format'
59+ googleJavaFormat {
60+ exclude ' .apt_generated/**'
61+ exclude ' bin/**'
62+ exclude ' build/**'
63+ exclude ' bazel*/**'
64+ }
65+
7066 test. dependsOn verifyGoogleJavaFormat
71- verifyGoogleJavaFormat. onlyIf { JavaVersion . current(). isJava8Compatible() }
7267
7368 task verifyLicense {
7469 doLast {
@@ -95,24 +90,6 @@ allprojects {
9590 options. compilerArgs << " -Xlint:unchecked" << " -Xlint:deprecation"
9691 }
9792 }
98- }
99-
100- subprojects {
101- apply plugin : ' java'
102- apply plugin : ' eclipse'
103- apply plugin : ' maven'
104- apply plugin : ' idea'
105- apply plugin : ' jacoco'
106- apply plugin : ' signing'
107- apply plugin : " net.ltgt.apt"
108- apply plugin : ' com.github.johnrengelman.shadow'
109- apply plugin : ' maven-publish'
110- apply plugin : ' com.dorongold.task-tree'
111-
112- group = " com.google.api"
113-
114- sourceCompatibility = 1.8
115- targetCompatibility = 1.8
11693
11794 // Dependencies
11895 // ------------
@@ -177,14 +154,6 @@ subprojects {
177154 exclude(' **/*Test.java' )
178155 }
179156
180- // JavaDocV1 html
181- // -------
182-
183- task javadocJar(type : Jar ) {
184- archiveClassifier = ' javadoc'
185- from javadoc
186- }
187-
188157 javadoc. options {
189158 encoding = ' UTF-8'
190159 links ' https://docs.oracle.com/javase/7/docs/api/'
@@ -197,24 +166,18 @@ subprojects {
197166 }
198167 }
199168
200- // JavaDocV3 - docFX
169+ // JavaDocV1 html
201170 // -------
202-
203- task javadocJarV3(type : Jar ) {
171+ task javadocJar(type : Jar ) {
204172 archiveClassifier = ' javadoc'
205173 from javadoc
206174 }
207175
208- javadoc. options {
209- encoding = ' UTF-8'
210- links ' https://docs.oracle.com/javase/7/docs/api/'
211-
212- if (JavaVersion . current(). isJava8Compatible()) {
213- addStringOption(' Xdoclint:all,-missing' , ' -quiet' )
214- }
215- if (JavaVersion . current(). isJava11Compatible()) {
216- addStringOption(' -release' , ' 7' )
217- }
176+ // JavaDocV3 - docFX
177+ // -------
178+ task javadocJarV3(type : Jar ) {
179+ archiveClassifier = ' javadoc'
180+ from javadoc
218181 }
219182
220183 // Test jar
@@ -370,8 +333,8 @@ subprojects {
370333 maven {
371334 url ' https://google.oss.sonatype.org/service/local/staging/deploy/maven2/'
372335 credentials {
373- username = project. hasProperty (' ossrhUsername' ) ? project . getProperty( ' ossrhUsername ' ) : null
374- password = project. hasProperty (' ossrhPassword' ) ? project . getProperty( ' ossrhPassword ' ) : null
336+ username = project. findProperty (' ossrhUsername' )
337+ password = project. findProperty (' ossrhPassword' )
375338 }
376339 }
377340 }
@@ -405,6 +368,11 @@ subprojects {
405368 }
406369}
407370
371+ javadoc. options {
372+ encoding = ' UTF-8'
373+ links ' https://docs.oracle.com/javase/7/docs/api/'
374+ }
375+
408376// JavaDocV1 html
409377// -------
410378task javadocCombined (type : Javadoc ) {
@@ -413,16 +381,6 @@ task javadocCombined(type: Javadoc) {
413381 destinationDir = new File (projectDir, ' tmp_docs' )
414382}
415383
416- javadoc. options {
417- encoding = ' UTF-8'
418- links ' https://docs.oracle.com/javase/7/docs/api/'
419- }
420-
421- clean {
422- delete ' tmp_gh-pages/'
423- delete ' tmp_docs/'
424- }
425-
426384// JavaDocV3 docFX
427385// -------
428386task javadocCombinedV3 (type : Javadoc ) {
0 commit comments