From 0c8f3af16befa4a0849970b3e185e16f6bb4f83a Mon Sep 17 00:00:00 2001 From: Esta Nagy Date: Sat, 13 Apr 2024 23:48:34 +0200 Subject: [PATCH] Include legal files (#382) - Adds manually generated DEPENDENCIES file - Includes LICENSE in META-INF - Includes DEPENDENCIES in META-INF {patch} Signed-off-by: Esta Nagy --- DEPENDENCIES | 11 +++++++++++ build.gradle | 31 +++++++++++++++++++++++++------ 2 files changed, 36 insertions(+), 6 deletions(-) create mode 100644 DEPENDENCIES diff --git a/DEPENDENCIES b/DEPENDENCIES new file mode 100644 index 0000000..5c73bb5 --- /dev/null +++ b/DEPENDENCIES @@ -0,0 +1,11 @@ +maven/mavencentral/io.micrometer/micrometer-commons/1.12.5, Apache-2.0 AND (Apache-2.0 AND MIT), approved, #11679 +maven/mavencentral/io.micrometer/micrometer-observation/1.12.5, Apache-2.0, approved, #11680 +maven/mavencentral/org.apache.commons/commons-collections4/4.4, Apache-2.0, approved, clearlydefined +maven/mavencentral/org.slf4j/slf4j-api/2.0.13, MIT, approved, #5915 +maven/mavencentral/org.springframework/spring-aop/6.1.6, Apache-2.0, approved, #11755 +maven/mavencentral/org.springframework/spring-beans/6.1.6, Apache-2.0, approved, #11754 +maven/mavencentral/org.springframework/spring-context-support/6.1.6, Apache-2.0, approved, #13496 +maven/mavencentral/org.springframework/spring-context/6.1.6, Apache-2.0, approved, #11753 +maven/mavencentral/org.springframework/spring-core/6.1.6, Apache-2.0 AND BSD-3-Clause, approved, #11750 +maven/mavencentral/org.springframework/spring-expression/6.1.6, Apache-2.0, approved, #11747 +maven/mavencentral/org.springframework/spring-jcl/6.1.6, Apache-2.0, approved, #11749 diff --git a/build.gradle b/build.gradle index e35c88c..3633296 100644 --- a/build.gradle +++ b/build.gradle @@ -90,13 +90,30 @@ dependencies { testImplementation libs.logback.classic } +tasks.register('copyLicense', Copy.class) { + from file("${projectDir}/LICENSE") + into layout.buildDirectory.dir("resources/main/META-INF").get().asFile +} +tasks.register('copyDependencies', Copy.class) { + from file("${projectDir}/DEPENDENCIES") + into layout.buildDirectory.dir("resources/main/META-INF").get().asFile +} +tasks.javadoc.dependsOn(tasks.copyLicense) +tasks.javadoc.dependsOn(tasks.copyDependencies) +tasks.compileTestJava.dependsOn(tasks.copyLicense) +tasks.compileTestJava.dependsOn(tasks.copyDependencies) +tasks.checkstyleMain.dependsOn(tasks.copyLicense) +tasks.checkstyleMain.dependsOn(tasks.copyDependencies) +tasks.processResources.finalizedBy(tasks.copyLicense) +tasks.processResources.finalizedBy(tasks.copyDependencies) + jacocoTestReport { reports { xml.required.set(true) - xml.outputLocation.set(file("$buildDir/reports/jacoco/report.xml")) + xml.outputLocation.set(layout.buildDirectory.file("reports/jacoco/report.xml").get().asFile) csv.required.set(false) html.required.set(true) - html.outputLocation.set(file("$buildDir/reports/jacoco/html")) + html.outputLocation.set(layout.buildDirectory.dir("reports/jacoco/html").get().asFile) } } @@ -112,8 +129,8 @@ jacoco { } jacocoTestCoverageVerification { - inputs.file(file("${buildDir}/reports/jacoco/report.xml") as String) - outputs.file(file("${buildDir}/reports/jacoco/jacocoTestCoverageVerification") as String) + inputs.file(layout.buildDirectory.file("reports/jacoco/report.xml").get().asFile) + outputs.file(layout.buildDirectory.file("reports/jacoco/jacocoTestCoverageVerification").get().asFile) violationRules { rule { @@ -149,13 +166,13 @@ jacocoTestCoverageVerification { } } doLast { - file("${buildDir}/reports/jacoco/jacocoTestCoverageVerification").write("Passed") + layout.buildDirectory.file("reports/jacoco/jacocoTestCoverageVerification").get().asFile.write("Passed") } } jar.dependsOn check tasks.withType(Checkstyle).configureEach { - configProperties = [base_dir: rootDir.toString(), cache_file: file("${buildDir}/checkstyle/cacheFile")] + configProperties = [base_dir: rootDir.toString(), cache_file: layout.buildDirectory.file("checkstyle/cacheFile").get().asFile] reports { xml.required.set(false) html.required.set(true) @@ -222,6 +239,8 @@ publishing { } } + + //Disable metadata publishing and rely on Maven only tasks.withType(GenerateModuleMetadata).configureEach { enabled = false