@@ -24,7 +24,6 @@ plugins {
2424 id ' com.google.api-ads.java-conventions'
2525 id ' com.google.protobuf' version ' 0.8.15'
2626 id " com.github.hierynomus.license-report" version " 0.15.0"
27- id ' com.github.johnrengelman.shadow' version ' 6.1.0'
2827}
2928
3029description = ' Google Ads API client library for Java'
@@ -35,18 +34,6 @@ sourceSets {
3534 srcDir ' src/test/resources/protos/'
3635 }
3736 }
38- // Provides functional tests that can be bypassed (e.g. when running
39- // without an ads.properties file).
40- functionalTest {
41- java {
42- srcDir ' src/test/functional/java'
43- }
44- resources {
45- srcDir ' src/test/functional/resources'
46- }
47- compileClasspath + = sourceSets. main. output
48- runtimeClasspath + = sourceSets. main. output
49- }
5037}
5138sourceSets. test. java. srcDir new File (buildDir, ' generated/source/proto/test' )
5239
@@ -56,12 +43,6 @@ protobuf {
5643 }
5744}
5845
59- configurations {
60- shadeTest
61- functionalTestImplementation. extendsFrom testImplementation
62- functionalTestRuntimeOnly. extendsFrom testRuntimeOnly
63- }
64-
6546dependencies {
6647 implementation ' io.netty:netty-tcnative-boringssl-static:2.0.26.Final'
6748 implementation ' org.slf4j:slf4j-api:1.7.25'
@@ -76,14 +57,8 @@ dependencies {
7657 testImplementation ' com.google.truth:truth:0.27'
7758 implementation ' com.google.auto.value:auto-value-annotations:1.7.3'
7859 testImplementation ' com.google.auto.value:auto-value-annotations:1.7.3'
79- shadeTest ' junit:junit:4.13.1'
8060}
8161
82- task functionalTest (type : Test ) {
83- description = " Runs functional tests"
84- testClassesDirs = sourceSets. functionalTest. output. classesDirs
85- classpath = sourceSets. functionalTest. runtimeClasspath
86- }
8762
8863// --------------------- third_party directory generation ----------------------
8964
@@ -269,78 +244,12 @@ task copyThirdPartyBinaries(type: Copy) {
269244 into tasks. generateThirdPartyDirectory. thirdPartyDir
270245}
271246
272- // ------------------------------ Shadow jar -----------------------------------
273-
274- shadowJar {
275- description = " Generates a jar with dependencies"
276-
277- // Removes the default -all classifier.
278- archiveClassifier = ' '
279-
280- // Updates the META-INF/services directory with the services from dependencies
281- mergeServiceFiles()
282-
283- // Includes the license report with the shadow jar.
284- dependsOn ' generateLicenses'
285- from tasks. generateLicenses. outputs
286-
287- finalizedBy ' testShadowJar'
288- }
289-
290- task testShadowJar {
291- description = " Executes functional tests for shadow jar"
292-
293- dependsOn shadowJar
294- dependsOn functionalTestClasses
295-
296- doLast {
297- javaexec {
298- // Runs the JUnit main method.
299- mainClass = " org.junit.runner.JUnitCore"
300-
301- // Passes the class name of the test to run.
302- args " com.google.ads.googleads.lib.SmokeTest"
303-
304- // Uses a special configuration to run the smoke tests. Allows us to
305- // replace the google-ads dependency with the shaded artifact so we can
306- // test it. Otherwise we'd just run end up running the smoke tests on
307- // the normal jar twice.
308- classpath = project. configurations. shadeTest +
309- // Uses the compiler output directly, rather than getting the
310- // dependencies from the configuration (since this would include
311- // the artifact we're trying to ignore).
312- files(sourceSets. functionalTest. output. classesDirs. files,
313- shadowJar. outputs. files)
314-
315- // Allows the smoke tests to pass unless we're publishing to sonatype.
316- ignoreExitValue = ! gradle. taskGraph. hasTask(" publishMavenPublicationToSonatypeRepository" )
317- }
318- }
319- }
320-
321247publishing {
322248 publications {
323249 maven(MavenPublication ) { publication ->
324250 configurePom(publication,
325251 " Google Ads API client library for Java - main library" ,
326252 " Main library for the Google Ads API client library for Java" )
327253 }
328- shadow(MavenPublication ) { publication ->
329- project. shadow. component(publication)
330- // Publishes the javadoc + sources with the shadowjar.
331- configurations. javadocElements. artifacts. each {
332- artifact it
333- }
334- configurations. sourcesElements. artifacts. each {
335- artifact it
336- }
337-
338- groupId = ' com.google.api-ads'
339- artifactId = ' google-ads-shadowjar'
340-
341- configurePom(publication,
342- " Google Ads API client library for java - shadow jar" ,
343- " Provides a jar with all dependencies" )
344- }
345254 }
346255}
0 commit comments