Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
R
Relational RAGs Project
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
Project Templates
Relational RAGs Project
Commits
8005bed8
Commit
8005bed8
authored
2 years ago
by
René Schöne
Browse files
Options
Downloads
Patches
Plain Diff
update to best practices
- reorder build.gradle - shorten ci spec
parent
349be4f3
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
{{cookiecutter.repo_name}}/.gitlab-ci.yml
+3
-19
3 additions, 19 deletions
{{cookiecutter.repo_name}}/.gitlab-ci.yml
{{cookiecutter.repo_name}}/build.gradle
+72
-55
72 additions, 55 deletions
{{cookiecutter.repo_name}}/build.gradle
with
75 additions
and
74 deletions
{{cookiecutter.repo_name}}/.gitlab-ci.yml
+
3
−
19
View file @
8005bed8
...
...
@@ -11,32 +11,18 @@ cache:
stages
:
-
build
-
test
-
ragdoc
-
publish
build
:
image
:
openjdk:11
stage
:
build
before_script
:
# - apt-get update && apt-get -y install graphviz # uncomment if relast2uml is used
script
:
-
"
./gradlew
assemble
"
-
"
./gradlew
test
"
artifacts
:
paths
:
-
"
src/gen/java"
-
"
src/gen/jastadd"
test
:
image
:
openjdk:11
stage
:
test
needs
:
-
build
before_script
:
# - apt-get update && apt-get -y install graphviz # uncomment if relast2uml is used
script
:
-
"
./gradlew
test"
artifacts
:
reports
:
junit
:
"
build/test-results/test/TEST-*.xml"
...
...
@@ -54,8 +40,7 @@ diagram:
-
"
src/gen/resources/{{cookiecutter.project_short_name}}Grammar.png"
ragdoc_build
:
image
:
name
:
"
git-st.inf.tu-dresden.de:4567/jastadd/ragdoc-builder"
image
:
"
git-st.inf.tu-dresden.de:4567/jastadd/ragdoc-builder"
stage
:
ragdoc
needs
:
-
build
...
...
@@ -67,8 +52,7 @@ ragdoc_build:
-
"
data/"
ragdoc_view
:
image
:
name
:
"
git-st.inf.tu-dresden.de:4567/jastadd/ragdoc-view:relations"
image
:
"
git-st.inf.tu-dresden.de:4567/jastadd/ragdoc-view:relations"
stage
:
ragdoc
needs
:
-
ragdoc_build
...
...
This diff is collapsed.
Click to expand it.
{{cookiecutter.repo_name}}/build.gradle
+
72
−
55
View file @
8005bed8
// --- Plugin definitions ---
plugins
{
id
'com.github.ben-manes.versions'
version
'0.42.0'
id
'java'
...
...
@@ -7,17 +8,7 @@ plugins {
id
'org.jastadd'
version
"${jastaddgradle_version}"
}
group
'de.tudresden.inf.st'
ext
{
mainClassName
=
'de.tudresden.inf.st.{{cookiecutter.repo_name}}.Main'
}
// set the main class name for `gradle run`
application
.
mainClass
=
"${mainClassName}"
java
.
toolchain
.
languageVersion
=
JavaLanguageVersion
.
of
(
11
)
// --- Dependencies ---
repositories
{
mavenCentral
()
maven
{
...
...
@@ -32,10 +23,6 @@ configurations {
relast
}
File
genSrc
=
file
(
"src/gen/java"
)
idea
.
module
.
generatedSourceDirs
+=
genSrc
sourceSets
.
main
.
java
.
srcDir
genSrc
dependencies
{
// uncomment if dumpAst should be used; this requires graphviz in CI and on system
// implementation group: 'de.tudresden.inf.st', name: 'dumpAst', version: "${dumpAst_version}"
...
...
@@ -46,45 +33,10 @@ dependencies {
testRuntimeOnly
group:
'org.junit.jupiter'
,
name:
'junit-jupiter-engine'
,
version:
"${jupyter_version}"
}
def
versionFile
=
'src/main/resources/{{cookiecutter.repo_name}}Version.properties'
def
oldProps
=
new
Properties
()
try
{
file
(
versionFile
).
withInputStream
{
stream
->
oldProps
.
load
(
stream
)
}
version
=
oldProps
[
'version'
]
}
catch
(
e
)
{
// this happens, if either the properties file is not present, or cannot be read from
throw
new
GradleException
(
"File ${versionFile} not found or unreadable. Aborting."
,
e
)
}
task
printVersion
()
{
doLast
{
println
(
version
)
}
}
task
newVersion
()
{
doFirst
{
def
props
=
new
Properties
()
props
[
'version'
]
=
value
props
.
store
(
file
(
versionFile
).
newWriter
(),
null
)
}
}
test
{
testLogging
.
showStandardStreams
=
true
useJUnitPlatform
()
}
jar
{
manifest
{
attributes
'Main-Class'
:
'${mainClassName}'
}
from
{
configurations
.
runtimeClasspath
.
collect
{
return
(
it
.
isDirectory
()
?
it
:
zipTree
(
it
))
}
}
}
// --- Preprocessors ---
File
genSrc
=
file
(
"src/gen/java"
)
idea
.
module
.
generatedSourceDirs
+=
genSrc
sourceSets
.
main
.
java
.
srcDir
genSrc
def
relastFiles
=
[
'./src/main/jastadd/{{cookiecutter.project_short_name}}.relast'
]
def
grammarPrefix
=
'./src/gen/jastadd/{{cookiecutter.project_short_name}}'
...
...
@@ -126,6 +78,7 @@ task relastToJastAdd(type: JavaExec) {
outputs
.
files
file
(
"${grammarPrefix}.ast"
),
file
(
"${grammarPrefix}.jadd"
)
}
// --- JastAdd ---
jastadd
{
configureModuleBuild
()
modules
{
...
...
@@ -179,6 +132,69 @@ jastadd {
extraJastAddOptions
=
[
"--List=${jastAddListName}"
]
}
// --- Tests ---
test
{
testLogging
.
showStandardStreams
=
true
useJUnitPlatform
()
}
// --- Versioning and Publishing ---
group
'de.tudresden.inf.st'
java
.
toolchain
.
languageVersion
=
JavaLanguageVersion
.
of
(
11
)
ext
{
mainClassName
=
'de.tudresden.inf.st.{{cookiecutter.repo_name}}.Main'
}
jar
.
manifest
{
attributes
'Main-Class'
:
'${mainClassName}'
}
task
fatJar
(
type:
Jar
)
{
dependsOn
jar
group
=
"build"
archiveAppendix
=
"fatjar"
manifest
{
attributes
'Main-Class'
:
'${mainClassName}'
}
// include classes of this project
from
sourceSets
.
main
.
output
// include classes of dependencies
from
{
configurations
.
runtimeClasspath
.
collect
{
return
(
it
.
isDirectory
()
?
it
:
zipTree
(
it
))
}
}
}
def
versionFile
=
'src/main/resources/{{cookiecutter.repo_name}}Version.properties'
def
oldProps
=
new
Properties
()
try
{
file
(
versionFile
).
withInputStream
{
stream
->
oldProps
.
load
(
stream
)
}
version
=
oldProps
[
'version'
]
}
catch
(
e
)
{
// this happens, if either the properties file is not present, or cannot be read from
throw
new
GradleException
(
"File ${versionFile} not found or unreadable. Aborting."
,
e
)
}
task
printVersion
()
{
doLast
{
println
(
version
)
}
}
task
newVersion
()
{
doFirst
{
def
props
=
new
Properties
()
props
[
'version'
]
=
value
props
.
store
(
file
(
versionFile
).
newWriter
(),
null
)
}
}
// set the main class name for `gradle run`
application
.
mainClass
=
"${mainClassName}"
// publish gitlab project
publishing
{
...
...
@@ -211,8 +227,9 @@ publishing {
}
}
//
Workflow configuration for phases
//
--- Task order ---
clean
.
dependsOn
cleanGen
generateAst
.
dependsOn
relastToJastAdd
publish
.
dependsOn
jar
// --- Misc ---
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