Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
ecomod
zmt-build
Commits
428dfed3
Commit
428dfed3
authored
Oct 26, 2016
by
Christian Meyer
Browse files
fixed adding temporary files to distribution
CreateFile.java: returns file instead of directory updated ZmtShortcutPlugin
parent
a0871070
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/main/groovy/de/zmt/gradle/ZmtShortcutPlugin.groovy
View file @
428dfed3
...
...
@@ -41,7 +41,7 @@ public class ZmtShortcutPlugin implements Plugin<Project> {
doLast
{
if
(
FileSystems
.
getDefault
().
supportedFileAttributeViews
().
contains
(
"posix"
))
{
Files
.
setPosixFilePermissions
(
o
utput
Dir
.
toPath
()
.
resolve
(
resourceName
)
,
PosixFilePermissions
.
fromString
(
'rwxr-xr-x'
))
Files
.
setPosixFilePermissions
(
getO
utput
File
()
.
toPath
(),
PosixFilePermissions
.
fromString
(
'rwxr-xr-x'
))
}
}
}
...
...
src/main/groovy/de/zmt/gradle/task/CreateFile.groovy
View file @
428dfed3
...
...
@@ -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
)
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment