Skip to content

Commit

Permalink
Create license reports for all modules
Browse files Browse the repository at this point in the history
  • Loading branch information
vogti committed Dec 27, 2023
1 parent 2453735 commit 870849d
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 8 deletions.
34 changes: 32 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,13 @@ buildscript {
classpath group: "io.freefair.gradle", name: "lombok-plugin", version: lombok_version
classpath group: "com.adarshr", name: "gradle-test-logger-plugin", version: gradle_test_logger_version
classpath group: "org.reflections", name: "reflections", version: reflections_version
classpath group: "com.jaredsburrows", name: "gradle-license-plugin", version: license_report_version
}
}


plugins {
id "org.jetbrains.kotlin.jvm" version "1.6.21"
id 'java'
id "org.jetbrains.gradle.plugin.idea-ext" version "1.1.7"
}

Expand Down Expand Up @@ -48,6 +49,7 @@ allprojects {
apply plugin: "java-library"
apply plugin: "io.freefair.lombok"
apply plugin: "com.adarshr.test-logger"
apply plugin: "com.jaredsburrows.license"

compileJava.options.encoding = "UTF-8"
compileTestJava.options.encoding = "UTF-8"
Expand All @@ -59,7 +61,6 @@ allprojects {
}
}


tasks.withType(JavaCompile).configureEach {
options.encoding = "UTF-8"
}
Expand Down Expand Up @@ -141,6 +142,13 @@ allprojects {
testRuntimeOnly(group: 'org.junit.jupiter', name: 'junit-jupiter-engine', version: junit_jupiter_version)
}

licenseReport {
generateJsonReport = true
generateCsvReport = false
generateHtmlReport = false
generateTextReport = false
}

idea {
module {
downloadJavadoc = true
Expand All @@ -157,6 +165,28 @@ allprojects {

}

task gatherLicenseReports(type: Copy) {
// Define the destination directory for the reports
def destinationDir = "${rootProject.buildDir}/reports/licenses"

// Go through each subproject
subprojects.each { subproject ->
from("${subproject.buildDir}/reports/licenses") {
include 'licenseReport.json'
// Rename the report file to include the module name
rename { String fileName ->
"${subproject.name}-$fileName"
}
}
}

// Set the destination for the copied files
into destinationDir
}
gradle.projectsEvaluated { // Make sure the task runs after all projects are evaluated
gatherLicenseReports.dependsOn subprojects*.tasks*.findByName('licenseReport')
}

// plugin location
ext.pluginsDir = rootProject.buildDir.path + '/plugins'

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -253,6 +253,7 @@ public File registerNewFolder( String folder ) {
return registerNewFolder( this.home, folder );
}


public File registerNewGlobalFolder( String testBackup ) {
return registerNewFolder( this.root, testBackup );
}
Expand All @@ -267,7 +268,4 @@ public File getRootPath() {
return home;
}




}
2 changes: 0 additions & 2 deletions dbms/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ buildscript {
}
dependencies {
classpath group: "app.cash.licensee", name: "licensee-gradle-plugin", version: licensee_version
classpath group: "com.jaredsburrows", name: "gradle-license-plugin", version: license_report_version
}
}

Expand All @@ -24,7 +23,6 @@ run {
}

apply plugin: "app.cash.licensee"
apply plugin: "com.jaredsburrows.license"

group "org.polypheny"

Expand Down
5 changes: 4 additions & 1 deletion plugins/cottontail-adapter/build.gradle
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
plugins {
id "org.jetbrains.kotlin.jvm" version "1.7.22"
}

group "org.polypheny"

apply plugin: "kotlin"
Expand Down Expand Up @@ -84,7 +88,6 @@ jar {
attributes "Version": "$project.version"
}
dependsOn(":plugins:cottontail-adapter:compileTestKotlin")

}
java {
withJavadocJar()
Expand Down

0 comments on commit 870849d

Please sign in to comment.