Commit 428dfed3 authored by Christian Meyer's avatar Christian Meyer
Browse files

fixed adding temporary files to distribution

CreateFile.java: returns file instead of directory
    updated ZmtShortcutPlugin
parent a0871070
......@@ -41,7 +41,7 @@ public class ZmtShortcutPlugin implements Plugin<Project> {
doLast {
if (FileSystems.getDefault().supportedFileAttributeViews().contains("posix")) {
Files.setPosixFilePermissions(outputDir.toPath().resolve(resourceName), PosixFilePermissions.fromString('rwxr-xr-x'))
Files.setPosixFilePermissions(getOutputFile().toPath(), PosixFilePermissions.fromString('rwxr-xr-x'))
}
}
}
......
......@@ -9,12 +9,14 @@ import org.gradle.api.tasks.*;
public class CreateFile extends DefaultTask {
def resourceName
def clazz = CreateFile.class
@OutputDirectory
def outputDir = project.file("$project.buildDir/tmp/")
@TaskAction
public void createFile() {
outputDir.toPath().resolve(resourceName).append(clazz.getResourceAsStream(resourceName))
getOutputFile().append(clazz.getResourceAsStream(resourceName))
}
@OutputFile
public File getOutputFile() {
project.file("$project.buildDir/tmp/" + resourceName)
}
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment