diff --git a/kotlin-native/build.gradle b/kotlin-native/build.gradle index d3a40ee5a7b..6893de3fba1 100644 --- a/kotlin-native/build.gradle +++ b/kotlin-native/build.gradle @@ -536,11 +536,6 @@ task bundleRegular(type: (isWindows()) ? Zip : Tar) { exclude 'klib/cache/*/org.jetbrains.kotlin.native.platform.*/**' into archiveBaseName } - from(project.projectDir) { - include 'licenses/**' - exclude '**/xcode_license.pdf' - into archiveBaseName - } } task bundlePrebuilt(type: (isWindows()) ? Zip : Tar) { @@ -553,15 +548,21 @@ task bundlePrebuilt(type: (isWindows()) ? Zip : Tar) { exclude 'klib/testLibrary' into archiveBaseName } - from(project.projectDir) { +} + +void configurePackingLicensesToBundle(AbstractArchiveTask task, boolean containsPlatformLibraries) { + task.from(project.projectDir) { include 'licenses/**' - if (!isMac()) { + if (!containsPlatformLibraries || !isMac()) { exclude '**/xcode_license.pdf' } - into archiveBaseName + into task.archiveBaseName } } +configurePackingLicensesToBundle(bundleRegular, /* containsPlatformLibraries = */ false) +configurePackingLicensesToBundle(bundlePrebuilt, /* containsPlatformLibraries = */ true) + configure([bundleRegular, bundlePrebuilt]) { dependsOn("crossDist") dependsOn("crossDistStdlibCache")