From 2354b061a9b05028a629dc8a61c4e69670f2da79 Mon Sep 17 00:00:00 2001 From: Craig Raw Date: Thu, 18 Apr 2024 09:29:11 +0200 Subject: [PATCH] add user write permissions to jvm legal files --- build.gradle | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/build.gradle b/build.gradle index 9d4adf87..ed23efd1 100644 --- a/build.gradle +++ b/build.gradle @@ -291,6 +291,18 @@ jlink { } } +tasks.jpackage.finalizedBy "addUserWritePermission" + +task addUserWritePermission(type: Exec) { + if(os.windows) { + commandLine 'icacls', "$buildDir\\jpackage\\Sparrow\\runtime\\legal\\*" + } else if(os.macOsX) { + commandLine 'chmod', '-R', 'u+w', "$buildDir/jpackage/Sparrow.app/Contents/runtime/Contents/Home/legal" + } else { + commandLine 'chmod', '-R', 'u+w', "$buildDir/jpackage/Sparrow/lib/runtime/legal" + } +} + task removeGroupWritePermission(type: Exec) { commandLine 'chmod', '-R', 'g-w', "$buildDir/jpackage/Sparrow" }