From 2016816e3487047260c2177caac3a8176051a44b Mon Sep 17 00:00:00 2001 From: weisj Date: Sat, 13 Jun 2020 17:29:08 +0200 Subject: [PATCH] Ensure licenses are included in the jar. --- core/build.gradle.kts | 15 +++++++++++++++ licenses/{NOTICE.txt => INTELLIJ_NOTICE.txt} | 0 native-utils/build.gradle.kts | 5 ++++- 3 files changed, 19 insertions(+), 1 deletion(-) rename licenses/{NOTICE.txt => INTELLIJ_NOTICE.txt} (100%) diff --git a/core/build.gradle.kts b/core/build.gradle.kts index 409e3679..d0cc8151 100644 --- a/core/build.gradle.kts +++ b/core/build.gradle.kts @@ -1,3 +1,6 @@ +import com.github.vlsi.gradle.crlf.CrLfSpec +import com.github.vlsi.gradle.crlf.LineEndings + plugins { `java-library` id("com.github.vlsi.crlf") @@ -27,6 +30,18 @@ tasks.test { workingDir.mkdirs() } +tasks.jar { + CrLfSpec(LineEndings.LF).run { + into("META-INF") { + filteringCharset = "UTF-8" + textFrom("$rootDir/licenses/DARCULA_LICENSE.txt") + textFrom("$rootDir/licenses/INTELLIJ_LICENSE.txt") + textFrom("$rootDir/licenses/INTELLIJ_NOTICE.txt") + textFrom("$rootDir/licenses/PBJAR_LICENSE.txt") + } + } +} + val makeDocumentation by tasks.registering(JavaExec::class) { group = "Development" description = "Builds the documentation" diff --git a/licenses/NOTICE.txt b/licenses/INTELLIJ_NOTICE.txt similarity index 100% rename from licenses/NOTICE.txt rename to licenses/INTELLIJ_NOTICE.txt diff --git a/native-utils/build.gradle.kts b/native-utils/build.gradle.kts index 4314b20a..48c13fe4 100644 --- a/native-utils/build.gradle.kts +++ b/native-utils/build.gradle.kts @@ -1,9 +1,12 @@ +import com.github.vlsi.gradle.crlf.CrLfSpec +import com.github.vlsi.gradle.crlf.LineEndings + plugins { `java-library` } tasks.jar { - com.github.vlsi.gradle.crlf.CrLfSpec(com.github.vlsi.gradle.crlf.LineEndings.LF).run { + CrLfSpec(LineEndings.LF).run { into("META-INF") { filteringCharset = "UTF-8" textFrom("$rootDir/licenses/NATIVEUTIL_LICENSE.txt")