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

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-24 11:15:06 -07:00 committed by GitHub
parent 4e8c92f2aa
commit 9c95cf424b
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') outputFile.setText(output.toString(), 'UTF-8')
if (OS.current() != OS.WINDOWS) {
Files.setPosixFilePermissions(outputFile.toPath(), PosixFilePermissions.fromString("rw-r--r--")) Files.setPosixFilePermissions(outputFile.toPath(), PosixFilePermissions.fromString("rw-r--r--"))
} }
}
@InputFiles @InputFiles
@Optional @Optional