Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
SableCC Gradle plugin
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Model registry
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
general
stups
SableCC Gradle plugin
Commits
684be05f
Commit
684be05f
authored
5 months ago
by
dgelessus
Browse files
Options
Downloads
Patches
Plain Diff
Move generated dat files instead of copying and then deleting
parent
68ad0a18
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/main/java/de/hhu/stups/sablecc/gradle/SableCCTask.java
+14
-11
14 additions, 11 deletions
src/main/java/de/hhu/stups/sablecc/gradle/SableCCTask.java
with
14 additions
and
11 deletions
src/main/java/de/hhu/stups/sablecc/gradle/SableCCTask.java
+
14
−
11
View file @
684be05f
...
@@ -127,16 +127,19 @@ public abstract class SableCCTask extends SourceTask {
...
@@ -127,16 +127,19 @@ public abstract class SableCCTask extends SourceTask {
});
});
// Move generated dat files from Java source directory to resources directory.
// Move generated dat files from Java source directory to resources directory.
this
.
getFs
().
copy
(
spec
->
{
ConfigurableFileTree
datFiles
=
this
.
objectFactory
.
fileTree
();
spec
.
from
(
destinationJavaPath
);
datFiles
.
from
(
destinationJavaPath
);
spec
.
into
(
destinationResourcesPath
);
datFiles
.
include
(
"**/*.dat"
);
spec
.
include
(
"**/*.dat"
);
for
(
File
datFile
:
datFiles
)
{
});
Path
sourcePath
=
datFile
.
toPath
();
this
.
getFs
().
delete
(
spec
->
{
assert
sourcePath
.
isAbsolute
();
ConfigurableFileTree
fileTree
=
this
.
objectFactory
.
fileTree
();
Path
relativePath
=
destinationJavaPath
.
relativize
(
sourcePath
);
fileTree
.
from
(
destinationJavaPath
);
Path
destinationPath
=
destinationResourcesPath
.
resolve
(
relativePath
);
fileTree
.
include
(
"**/*.dat"
);
assert
destinationPath
.
isAbsolute
();
spec
.
delete
(
fileTree
);
if
(
destinationPath
.
getParent
()
!=
null
)
{
});
Files
.
createDirectories
(
destinationPath
.
getParent
());
}
Files
.
move
(
sourcePath
,
destinationPath
);
}
}
}
}
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment