Skip to content

Commit 8b022c2

Browse files
authored
Exclude projects defined in this repo from the third_party license report and JARs (#599)
1 parent 253e785 commit 8b022c2

1 file changed

Lines changed: 13 additions & 1 deletion

File tree

google-ads/build.gradle

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,13 @@ task generateLicenses(type: nl.javadude.gradle.plugins.license.DownloadLicenses)
108108
// Works around issue where the plugin looks at the deprecated 'compile'
109109
// configuration by default.
110110
dependencyConfiguration = 'runtimeClasspath'
111+
112+
// Excludes dependencies on subprojects. These should not be in the license
113+
// report since they are part of this library. The license-report plugin
114+
// will accept regexes here as well, but explicitly listing projects ensures
115+
// the exclusion is precise.
116+
excludeDependencies = rootProject.allprojects
117+
.collect { it.group + ':' + it.name + ':' + it.version }
111118
}
112119

113120
task verifyLicenses() {
@@ -253,7 +260,12 @@ task copyThirdPartySources(type: Copy) {
253260

254261
// Copies the third party binaries to the third_party folder.
255262
task copyThirdPartyBinaries(type: Copy) {
256-
from configurations.runtimeClasspath
263+
from configurations.runtimeClasspath {
264+
// Excludes JARs for the root project and its subprojects.
265+
exclude(
266+
rootProject.allprojects.collect { it.name + "-" + it.version + ".jar" }
267+
)
268+
}
257269
into tasks.generateThirdPartyDirectory.thirdPartyDir
258270
}
259271

0 commit comments

Comments
 (0)