[Bug] Fix gradle build on Windows failing from a recent change (#765)

A recent change as part of the commit c2e816ec introduced a bug where the build is failing on Windows. The change was made to include the NOTICE.txt file as read-only in the distributions. The code fails on Windows as it's not a POSIX-compliant. This commit adds a check on the current operating system.

Signed-off-by: Rabi Panda <adnapibar@gmail.com>
This commit is contained in:
Rabi Panda 2021-05-25 10:51:53 -07:00 committed by GitHub
parent 9a654aa667
commit b6ca8e6db4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 1 deletions

View File

@ -152,8 +152,10 @@ class NoticeTask extends DefaultTask {
}
}
outputFile.setText(output.toString(), 'UTF-8')
if (OS.current() != OS.WINDOWS) {
Files.setPosixFilePermissions(outputFile.toPath(), PosixFilePermissions.fromString("rw-r--r--"))
}
}
@InputFiles
@Optional