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
bc4f5979
Commit
bc4f5979
authored
6 months ago
by
dgelessus
Browse files
Options
Downloads
Patches
Plain Diff
Allow passing extra arguments to SableCC
parent
684be05f
No related branches found
No related tags found
No related merge requests found
Pipeline
#149078
passed
6 months ago
Stage: test
Changes
2
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
README.md
+2
-0
2 additions, 0 deletions
README.md
src/main/java/de/hhu/stups/sablecc/gradle/SableCCTask.java
+13
-0
13 additions, 0 deletions
src/main/java/de/hhu/stups/sablecc/gradle/SableCCTask.java
with
15 additions
and
0 deletions
README.md
+
2
−
0
View file @
bc4f5979
...
@@ -50,6 +50,7 @@ You normally don't need to do this - all of these options have reasonable defaul
...
@@ -50,6 +50,7 @@ You normally don't need to do this - all of these options have reasonable defaul
tasks
.
named
(
"generateSableCCSource"
).
configure
{
tasks
.
named
(
"generateSableCCSource"
).
configure
{
sableCCClasspath
=
sourceSets
.
something
.
runtimeClasspath
sableCCClasspath
=
sourceSets
.
something
.
runtimeClasspath
maxHeapSize
=
"512M"
maxHeapSize
=
"512M"
arguments
=
[
"--no-inline"
]
// WARNING: The destination dirs will be DELETED every time the SableCC task runs!
// WARNING: The destination dirs will be DELETED every time the SableCC task runs!
destinationJavaDir
=
"my/custom/out/java"
destinationJavaDir
=
"my/custom/out/java"
destinationResourcesDir
=
"my/custom/out/resources"
destinationResourcesDir
=
"my/custom/out/resources"
...
@@ -62,6 +63,7 @@ tasks.named("generateSableCCSource").configure {
...
@@ -62,6 +63,7 @@ tasks.named("generateSableCCSource").configure {
## Version 1.2.0 (not released yet)
## Version 1.2.0 (not released yet)
*
Add ability to pass extra arguments to SableCC using the new
`arguments`
property of
`SableCCTask`
.
*
Fix deprecation warnings on Gradle 8.12 about accessing
`Project`
at execution time.
*
Fix deprecation warnings on Gradle 8.12 about accessing
`Project`
at execution time.
## Version 1.1.0
## Version 1.1.0
...
...
This diff is collapsed.
Click to expand it.
src/main/java/de/hhu/stups/sablecc/gradle/SableCCTask.java
+
13
−
0
View file @
bc4f5979
...
@@ -6,6 +6,7 @@ import java.nio.file.Files;
...
@@ -6,6 +6,7 @@ import java.nio.file.Files;
import
java.nio.file.Path
;
import
java.nio.file.Path
;
import
java.util.ArrayList
;
import
java.util.ArrayList
;
import
java.util.List
;
import
java.util.List
;
import
java.util.Objects
;
import
javax.inject.Inject
;
import
javax.inject.Inject
;
...
@@ -35,6 +36,7 @@ public abstract class SableCCTask extends SourceTask {
...
@@ -35,6 +36,7 @@ public abstract class SableCCTask extends SourceTask {
private
FileCollection
sableCCClasspath
;
private
FileCollection
sableCCClasspath
;
private
String
maxHeapSize
;
private
String
maxHeapSize
;
private
List
<
String
>
arguments
;
private
final
DirectoryProperty
destinationJavaDir
;
private
final
DirectoryProperty
destinationJavaDir
;
private
final
DirectoryProperty
destinationResourcesDir
;
private
final
DirectoryProperty
destinationResourcesDir
;
...
@@ -47,6 +49,7 @@ public abstract class SableCCTask extends SourceTask {
...
@@ -47,6 +49,7 @@ public abstract class SableCCTask extends SourceTask {
this
.
sableCCClasspath
=
null
;
this
.
sableCCClasspath
=
null
;
this
.
maxHeapSize
=
null
;
this
.
maxHeapSize
=
null
;
this
.
arguments
=
new
ArrayList
<>();
this
.
destinationJavaDir
=
objectFactory
.
directoryProperty
();
this
.
destinationJavaDir
=
objectFactory
.
directoryProperty
();
this
.
destinationResourcesDir
=
objectFactory
.
directoryProperty
();
this
.
destinationResourcesDir
=
objectFactory
.
directoryProperty
();
}
}
...
@@ -84,6 +87,15 @@ public abstract class SableCCTask extends SourceTask {
...
@@ -84,6 +87,15 @@ public abstract class SableCCTask extends SourceTask {
this
.
maxHeapSize
=
maxHeapSize
;
this
.
maxHeapSize
=
maxHeapSize
;
}
}
@Input
public
List
<
String
>
getArguments
()
{
return
this
.
arguments
;
}
public
void
setArguments
(
List
<
String
>
arguments
)
{
this
.
arguments
=
Objects
.
requireNonNull
(
arguments
,
"arguments"
);
}
@OutputDirectory
@OutputDirectory
public
Directory
getDestinationJavaDir
()
{
public
Directory
getDestinationJavaDir
()
{
return
this
.
destinationJavaDir
.
get
();
return
this
.
destinationJavaDir
.
get
();
...
@@ -120,6 +132,7 @@ public abstract class SableCCTask extends SourceTask {
...
@@ -120,6 +132,7 @@ public abstract class SableCCTask extends SourceTask {
List
<
String
>
args
=
new
ArrayList
<>();
List
<
String
>
args
=
new
ArrayList
<>();
args
.
add
(
"-d"
);
args
.
add
(
"-d"
);
args
.
add
(
destinationJavaPath
.
toString
());
args
.
add
(
destinationJavaPath
.
toString
());
args
.
addAll
(
this
.
getArguments
());
for
(
File
file
:
this
.
getSource
().
getFiles
())
{
for
(
File
file
:
this
.
getSource
().
getFiles
())
{
args
.
add
(
file
.
getPath
());
args
.
add
(
file
.
getPath
());
}
}
...
...
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