From 9e7b15316cfa3a891850e9de8039ac9dd0698eba Mon Sep 17 00:00:00 2001 From: Sergio del Amo Date: Wed, 17 Jul 2024 09:01:35 +0200 Subject: [PATCH] extract to gradle/dependency-licenses.gradle --- build.gradle | 56 +++---------------------------- gradle/dependency-licenses.gradle | 55 ++++++++++++++++++++++++++++++ 2 files changed, 60 insertions(+), 51 deletions(-) create mode 100644 gradle/dependency-licenses.gradle diff --git a/build.gradle b/build.gradle index 0bece6acd3e..5d6ab87884b 100644 --- a/build.gradle +++ b/build.gradle @@ -18,52 +18,9 @@ buildscript { import static groovyx.net.http.ContentType.* apply plugin: 'idea' -apply plugin: 'com.github.hierynomus.license-report' - -List licenseExclusions = [ - "org.grails.grails-bom", - "org.grails:grails-bootstrap", - "org.grails:grails-codecs", - "org.grails:grails-console", - "org.grails:grails-core", - "org.grails:grails-databinding", - "org.grails:grails-dependencies", - "org.grails:grails-docs", - "org.grails:grails-encoder", - "org.grails:grails-gradle-model", - "org.grails:grails-logging", - "org.grails:grails-plugin-codecs", - "org.grails:grails-plugin-controllers", - "org.grails:grails-plugin-databinding", - "org.grails:grails-plugin-datasource", - "org.grails:grails-plugin-domain-class", - "org.grails:grails-plugin-i18n", - "org.grails:grails-plugin-interceptors", - "org.grails:grails-plugin-mimetypes", - "org.grails:grails-plugin-rest", - "org.grails:grails-plugin-services", - "org.grails:grails-plugin-url-mappings", - "org.grails:grails-plugin-validation", - "org.grails:grails-spring", - "org.grails:grails-test", - "org.grails:grails-test-suite-base", - "org.grails:grails-test-suite-persistence", - "org.grails:grails-test-suite-uber", - "org.grails:grails-test-suite-web", - "org.grails:grails-web", - "org.grails:grails-web-boot", - "org.grails:grails-web-common", - "org.grails:grails-web-databinding", - "org.grails:grails-web-fileupload", - "org.grails:grails-web-mvc", - "org.grails:grails-web-url-mappings", -].collect { "${it}:${project.projectVersion}" as String} - -downloadLicenses { - includeProjectDependencies = true - dependencyConfiguration = 'runtimeClasspath' - excludeDependencies = licenseExclusions -} + + + ext { isJava8Compatible = org.gradle.api.JavaVersion.current().isJava8Compatible() @@ -337,6 +294,7 @@ allprojects { } apply from: "gradle/idea.gradle" +apply from: "gradle/dependency-licenses.gradle" tasks.withType(org.gradle.api.tasks.javadoc.Groovydoc) { configure { @@ -400,11 +358,6 @@ subprojects { project -> apply plugin: 'idea' apply plugin: 'project-report' apply plugin: 'com.github.hierynomus.license-report' - downloadLicenses { - includeProjectDependencies = true - dependencyConfiguration = 'runtimeClasspath' - excludeDependencies = licenseExclusions - } if (!isTestSuite) { @@ -667,6 +620,7 @@ apply { from 'gradle/docs.gradle' // tasks for building the documentation (e.g. user guide, javadocs) from 'gradle/assemble.gradle' // tasks for creating an installation or distribution from 'gradle/findbugs.gradle' + from 'gradle/dependency-licenses.gradle' } task buildscriptDependencies(type: org.gradle.api.tasks.diagnostics.DependencyReportTask) { diff --git a/gradle/dependency-licenses.gradle b/gradle/dependency-licenses.gradle new file mode 100644 index 00000000000..ba04d88cd63 --- /dev/null +++ b/gradle/dependency-licenses.gradle @@ -0,0 +1,55 @@ +buildscript { + repositories { + maven { url "https://plugins.gradle.org/m2/" } + } + dependencies { + + classpath("gradle.plugin.com.hierynomus.gradle.plugins:license-gradle-plugin:0.16.1") + } +} +apply plugin: 'com.github.hierynomus.license-report' + +List licenseExclusions = [ + "org.grails.grails-bom", + "org.grails:grails-bootstrap", + "org.grails:grails-codecs", + "org.grails:grails-console", + "org.grails:grails-core", + "org.grails:grails-databinding", + "org.grails:grails-dependencies", + "org.grails:grails-docs", + "org.grails:grails-encoder", + "org.grails:grails-gradle-model", + "org.grails:grails-logging", + "org.grails:grails-plugin-codecs", + "org.grails:grails-plugin-controllers", + "org.grails:grails-plugin-databinding", + "org.grails:grails-plugin-datasource", + "org.grails:grails-plugin-domain-class", + "org.grails:grails-plugin-i18n", + "org.grails:grails-plugin-interceptors", + "org.grails:grails-plugin-mimetypes", + "org.grails:grails-plugin-rest", + "org.grails:grails-plugin-services", + "org.grails:grails-plugin-url-mappings", + "org.grails:grails-plugin-validation", + "org.grails:grails-spring", + "org.grails:grails-test", + "org.grails:grails-test-suite-base", + "org.grails:grails-test-suite-persistence", + "org.grails:grails-test-suite-uber", + "org.grails:grails-test-suite-web", + "org.grails:grails-web", + "org.grails:grails-web-boot", + "org.grails:grails-web-common", + "org.grails:grails-web-databinding", + "org.grails:grails-web-fileupload", + "org.grails:grails-web-mvc", + "org.grails:grails-web-url-mappings", +].collect { "${it}:${project.projectVersion}" as String} + +downloadLicenses { + includeProjectDependencies = true + dependencyConfiguration = 'runtimeClasspath' + excludeDependencies = licenseExclusions +} \ No newline at end of file