From 738513aaad82dc753904f34d053888ba47ce3fdb Mon Sep 17 00:00:00 2001 From: Silas Della Contrada Date: Sat, 27 Jul 2024 13:56:55 +0200 Subject: [PATCH] fix: invalid license target file names --- ffmpeg/build.gradle.kts | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/ffmpeg/build.gradle.kts b/ffmpeg/build.gradle.kts index 6f7a8ee..6bce075 100644 --- a/ffmpeg/build.gradle.kts +++ b/ffmpeg/build.gradle.kts @@ -49,6 +49,15 @@ val compileNative = if (deployNative) { } } else null +fun AbstractCopyTask.licenses() { + from(layout.projectDirectory.files("LICENSE.*", "COPYING.*", "COPYRIGHT.*", "Copyright.*")) { + rename { "ffmpeg-static-$it" } + } + from(rootProject.layout.projectDirectory.files("LICENSE", "THIRDPARTY_LICENSES")) { + rename { "ffmpeg-static-$it" } + } +} + val nativesJar = if (deployNative) { tasks.register("nativesJar") { // Required for configuration cache @@ -63,10 +72,7 @@ val nativesJar = if (deployNative) { } into("natives/$platform/") } - from(layout.projectDirectory.files("LICENSE.*", "COPYING.*", "COPYRIGHT.*", "Copyright.*")) - from(rootProject.layout.projectDirectory.file("LICENSE")) { - rename { "LICENSE.ffmpeg-static" } - } + licenses() } } else null @@ -78,12 +84,7 @@ val zipBuild = if (deployNative) { include("lib/**/*") include("share/**/*") } - from(layout.projectDirectory.files("LICENSE.*", "COPYING.*", "COPYRIGHT.*", "Copyright.*")) { - rename { "ffmpeg-static-$name" } - } - from(rootProject.layout.projectDirectory.files("LICENSE", "THIRDPARTY_LICENSES")) { - rename { "ffmpeg-static-$name" } - } + licenses() } } else null