Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
A
Abstract Type Navigation
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
JastAdd
preprocessors
Abstract Type Navigation
Commits
07c72e4b
Commit
07c72e4b
authored
3 years ago
by
Johannes Mey
Browse files
Options
Downloads
Patches
Plain Diff
use preprocessor from package
parent
33ab006d
No related branches found
No related tags found
1 merge request
!2
Feature/package submodule
Pipeline
#12889
failed
3 years ago
Stage: build
Stage: test
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
build.gradle
+48
-20
48 additions, 20 deletions
build.gradle
gradle.properties
+2
-0
2 additions, 0 deletions
gradle.properties
src/test/resources/RelAstPreprocessor/config.yaml
+2
-2
2 additions, 2 deletions
src/test/resources/RelAstPreprocessor/config.yaml
with
52 additions
and
22 deletions
build.gradle
+
48
−
20
View file @
07c72e4b
...
...
@@ -14,11 +14,20 @@ application.mainClassName = "${mainClassName}"
repositories
{
mavenCentral
()
maven
{
name
'gitlab-maven'
url
'https://git-st.inf.tu-dresden.de/api/v4/groups/jastadd/-/packages/maven'
}
}
configurations
{
relast
}
dependencies
{
implementation
project
(
':relast.preprocessor'
)
testImplementation
testFixtures
(
project
(
":relast.preprocessor"
))
relast
group:
'org.jastadd'
,
name:
'relast'
,
version:
"${relast_version}"
implementation
group:
'org.jastadd'
,
name:
'relast-preprocessor'
,
version:
"${preprocessor_version}"
testImplementation
testFixtures
(
group:
'org.jastadd'
,
name:
'relast-preprocessor'
,
version:
"${preprocessor_version}"
)
}
project
.
version
=
"0.2.0"
...
...
@@ -35,20 +44,37 @@ test {
maxHeapSize
=
'1G'
}
task
extractJastAddSources
(
type:
Sync
)
{
dependsOn
configurations
.
runtimeClasspath
configurations
.
runtimeClasspath
.
asFileTree
.
filter
{
it
.
toString
().
endsWith
(
"relast-preprocessor-${preprocessor_version}.jar"
)
}.
collect
{
from
(
zipTree
(
it
))
{
include
"**/*.jrag"
include
"**/*.jadd"
include
"**/*.ast"
include
"**/*.relast"
include
"**/*.flex"
include
"**/*.parser"
}
}
includeEmptyDirs
false
into
file
(
"${project.buildDir}/tmp/jastadd-sources"
)
}
jar
{
manifest
{
attributes
"Main-Class"
:
"${mainClassName}"
}
from
{
configurations
.
runtimeClasspath
.
collect
{
return
(
it
.
exists
()
&&
(!
it
.
toString
().
contains
(
"/build/libs/"
)||
it
.
toString
().
contains
(
"-base-"
)))
?
(
it
.
isDirectory
()
?
it
:
zipTree
(
it
)
)
:
null
}
configurations
.
runtimeClasspath
.
collect
{
it
.
isDirectory
()
?
it
:
zipTree
(
it
)
}
}
}
// Input and output files for relast
def
relastInputFiles
=
[
"
relast.preprocessor/src/main/jastadd
/RelAst.relast"
,
"
relast.preprocessor/src/main/jastadd
/mustache/Mustache.relast"
"
${project.buildDir}/tmp/jastadd-sources
/RelAst.relast"
,
"
${project.buildDir}/tmp/jastadd-sources
/mustache/Mustache.relast"
]
def
relastOutputFiles
=
[
"src/gen/jastadd/RelAst.ast"
,
...
...
@@ -59,8 +85,11 @@ def relastOutputFiles = [
task
relast
(
type:
JavaExec
)
{
classpath
=
files
(
"relast.preprocessor/libs/relast.jar"
)
group
=
'Build'
classpath
=
configurations
.
relast
mainClass
=
'org.jastadd.relast.compiler.Compiler'
dependsOn
extractJastAddSources
doFirst
{
delete
relastOutputFiles
...
...
@@ -88,9 +117,9 @@ jastadd {
jastadd
{
basedir
"."
include
"
relast.preprocessor/src/main/jastadd
/**/*.ast"
include
"
relast.preprocessor/src/main/jastadd
/**/*.jadd"
include
"
relast.preprocessor/src/main/jastadd
/**/*.jrag"
include
"
build/tmp/jastadd-sources
/**/*.ast"
include
"
build/tmp/jastadd-sources
/**/*.jadd"
include
"
build/tmp/jastadd-sources
/**/*.jrag"
include
"src/main/jastadd/**/*.ast"
include
"src/main/jastadd/**/*.jadd"
include
"src/main/jastadd/**/*.jrag"
...
...
@@ -100,18 +129,18 @@ jastadd {
}
scanner
{
include
"
relast.preprocessor/src/main/jastadd
/scanner/Header.flex"
,
[-
4
]
include
"
relast.preprocessor/src/main/jastadd
/scanner/Preamble.flex"
,
[-
3
]
include
"
relast.preprocessor/src/main/jastadd
/scanner/Macros.flex"
,
[-
2
]
include
"
relast.preprocessor/src/main/jastadd
/scanner/RulesPreamble.flex"
,
[-
1
]
include
"
relast.preprocessor/src/main/jastadd
/scanner/Keywords.flex"
,
[
0
]
include
"
relast.preprocessor/src/main/jastadd
/scanner/Symbols.flex"
,
[
1
]
include
"
relast.preprocessor/src/main/jastadd
/scanner/RulesPostamble.flex"
,
[
2
]
include
"
build/tmp/jastadd-sources
/scanner/Header.flex"
,
[-
4
]
include
"
build/tmp/jastadd-sources
/scanner/Preamble.flex"
,
[-
3
]
include
"
build/tmp/jastadd-sources
/scanner/Macros.flex"
,
[-
2
]
include
"
build/tmp/jastadd-sources
/scanner/RulesPreamble.flex"
,
[-
1
]
include
"
build/tmp/jastadd-sources
/scanner/Keywords.flex"
,
[
0
]
include
"
build/tmp/jastadd-sources
/scanner/Symbols.flex"
,
[
1
]
include
"
build/tmp/jastadd-sources
/scanner/RulesPostamble.flex"
,
[
2
]
}
parser
{
include
"
relast.preprocessor/src/main/jastadd
/parser/Preamble.parser"
include
"
relast.preprocessor/src/main/jastadd
/parser/RelAst.parser"
include
"
build/tmp/jastadd-sources
/parser/Preamble.parser"
include
"
build/tmp/jastadd-sources
/parser/RelAst.parser"
}
}
}
...
...
@@ -142,5 +171,4 @@ jastadd {
}
clean
.
dependsOn
(
cleanGen
)
generateAst
.
dependsOn
(
relast
)
jar
.
dependsOn
(
"relast.preprocessor:jar"
)
// the jar is a fat jar that contains the jar of the preprocessor
generateAst
.
dependsOn
(
relast
,
extractJastAddSources
)
This diff is collapsed.
Click to expand it.
gradle.properties
0 → 100644
+
2
−
0
View file @
07c72e4b
relast_version
=
0.3.0-137
preprocessor_version
=
0.1.0-41
\ No newline at end of file
This diff is collapsed.
Click to expand it.
src/test/resources/RelAstPreprocessor/config.yaml
+
2
−
2
View file @
07c72e4b
-
name
:
"
RelAST
Preprocessor
Grammar
from
submodule
(null)"
in
:
"
../../../../
relast.preprocessor/src/main/jastadd
/"
in
:
"
../../../../
build/tmp/jastadd-sources
/"
args
:
-
"
--inputBaseDir=../../../../
relast.preprocessor/src/main/jastadd
/"
-
"
--inputBaseDir=../../../../
build/tmp/jastadd-sources
/"
-
"
--outputBaseDir=out"
-
"
--errorHandling=null"
-
"
RelAst.relast"
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