Skip to content
Snippets Groups Projects
Commit f2d414b8 authored by René Schöne's avatar René Schöne
Browse files

0.2.2

- updated relast.preprocessor
- use standardized build.gradle layout
- updated to the newest versions of maven dependencies
- removed buildSrc
- use plantuml maven package instead of jar
- added README.md
parent f42c6aaa
No related branches found
No related tags found
No related merge requests found
Pipeline #13146 failed
Showing
with 121 additions and 186 deletions
[submodule "relast.preprocessor"]
path = relast.preprocessor
url = ../relast-preprocessor.git
branch = master
branch = develop
# Grammar2uml
For documentation, please see <https://jastadd.pages.st.inf.tu-dresden.de/grammar2uml/>
plugins {
id 'com.github.ben-manes.versions'
id 'com.github.ben-manes.versions' version '0.42.0'
}
build/
.gradle/
plugins {
id 'groovy-gradle-plugin'
}
repositories {
gradlePluginPortal()
}
dependencies {
implementation 'com.github.ben-manes:gradle-versions-plugin:0.36.0'
}
plugins {
id 'grammar2uml.java-common-conventions'
id 'application'
}
plugins {
id 'java'
id 'idea'
id 'com.github.ben-manes.versions'
}
repositories {
mavenCentral()
}
dependencies {
testImplementation group: 'org.junit.jupiter', name: 'junit-jupiter-api', version: "${jupiter_version}"
testImplementation group: 'org.assertj', name: 'assertj-core', version: '3.18.1'
testRuntimeOnly group: 'org.junit.jupiter', name: 'junit-jupiter-engine', version: "${jupiter_version}"
}
tasks.named('test') {
useJUnitPlatform()
}
plugins {
id 'grammar2uml.java-common-conventions'
id 'java-library'
}
dependencies {
api group: 'net.sf.beaver', name: 'beaver-rt', version: '0.9.11'
}
File genSrc = file("src/gen/java")
sourceSets.main.java.srcDir genSrc
idea.module.generatedSourceDirs += genSrc
plugins {
id 'java'
id 'idea'
id 'com.github.ben-manes.versions'
id 'maven-publish'
}
repositories {
mavenCentral()
}
dependencies {
testImplementation group: 'org.junit.jupiter', name: 'junit-jupiter-api', version: "${jupiter_version}"
testImplementation group: 'org.assertj', name: 'assertj-core', version: '3.18.1'
testRuntimeOnly group: 'org.junit.jupiter', name: 'junit-jupiter-engine', version: "${jupiter_version}"
}
jar {
from {
configurations.runtimeClasspath.collect { it.isDirectory() ? it : zipTree(it) }
}
}
def versionFile = "src/main/resources/${project.getName()}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)
}
}
task setDevVersionForCI() {
doFirst {
def props = new Properties()
props['version'] = version + "-$System.env.CI_PIPELINE_IID"
props.store(file(versionFile).newWriter(), null)
}
}
//1158
publishing {
publications {
maven(MavenPublication) {
groupId = 'de.tudresden.inf.st'
// from components.java
artifact("build/libs/${project.getName()}-${project.getVersion()}.jar") {
extension 'jar'
}
}
}
repositories {
maven {
url "https://git-st.inf.tu-dresden.de/api/v4/projects/$System.env.CI_PROJECT_ID/packages/maven"
// Uncomment the following lines to publish manually (and comment out the other credentials section)
// credentials(HttpHeaderCredentials) {
// name = "Private-Token"
// value = gitLabPrivateToken // the variable resides in ~/.gradle/gradle.properties
// }
credentials(HttpHeaderCredentials) {
name = 'Job-Token'
value = System.getenv("CI_JOB_TOKEN")
}
authentication {
header(HttpHeaderAuthentication)
}
}
}
}
publish.dependsOn jar
log4j_version = 2.13.3
jupiter_version = 5.7.0
mustache_java_version = 0.9.7
// --- Buildscripts (must be at the top) ---
buildscript {
repositories.mavenLocal()
repositories.mavenCentral()
dependencies {
classpath group: 'org.jastadd', name: 'jastaddgradle', version: '1.13.3'
}
}
// --- Plugin definitions ---
plugins {
id 'grammar2uml.java-jastadd-conventions'
id 'grammar2uml.java-application-conventions'
id 'grammar2uml.java-publishing-conventions'
id 'com.github.ben-manes.versions'
id 'java'
id 'idea'
id 'application'
id 'java-library'
id 'maven-publish'
}
apply plugin: 'jastadd'
application.mainClassName = 'de.tudresden.inf.st.jastadd.grammar2uml.compiler.Compiler'
// --- Dependencies ---
repositories {
mavenCentral()
}
jar {
manifest {
attributes "Main-Class": application.mainClassName
}
manifest.attributes "Main-Class": "${mainClassName}"
}
dependencies {
implementation project(':relast.preprocessor')
implementation fileTree(include: ['plantuml.jar'], dir: '../libs')
implementation group: 'com.github.spullara.mustache.java', name: 'compiler', version: "${mustache_java_version}"
runtime group: 'org.jastadd', name: 'jastadd', version: '2.3.4'
implementation group: 'net.sourceforge.plantuml', name: 'plantuml', version: '1.2022.2'
api group: 'net.sf.beaver', name: 'beaver-rt', version: '0.9.11'
implementation group: 'com.github.spullara.mustache.java', name: 'compiler', version: '0.9.10'
// runtime group: 'org.jastadd', name: 'jastadd', version: '2.3.4'
testImplementation group: 'org.junit.jupiter', name: 'junit-jupiter-api', version: '5.8.2'
testRuntimeOnly group: 'org.junit.jupiter', name: 'junit-jupiter-engine', version: '5.8.2'
}
File preprocessorGrammar = file('../relast.preprocessor/src/main/jastadd/RelAst.relast')
File mustacheGrammar = file('../relast.preprocessor/src/main/jastadd/mustache/Mustache.relast')
File grammar2umlGrammar = file('./src/main/jastadd/Grammar2Uml.relast')
File intermediateGrammar = file('./src/main/jastadd/MustacheNodes.relast')
// --- Preprocessors ---
File genSrc = file("src/gen/java")
sourceSets.main.java.srcDir genSrc
idea.module.generatedSourceDirs += genSrc
task relast(type: JavaExec) {
group = 'Build'
main = "-jar"
doFirst {
delete "src/gen/jastadd/*.ast"
delete "src/gen/jastadd/Grammar2Uml.jadd"
delete "src/gen/jastadd/Grammar2UmlRefResolver.jadd"
delete "src/gen/jastadd/Grammar2UmlResolverStubs.jrag"
mkdir "src/gen/jastadd/"
}
args = [
"../libs/relast.jar",
preprocessorGrammar,
mustacheGrammar,
grammar2umlGrammar,
intermediateGrammar,
'../relast.preprocessor/src/main/jastadd/RelAst.relast',
'../relast.preprocessor/src/main/jastadd/mustache/Mustache.relast',
'./src/main/jastadd/Grammar2Uml.relast',
'./src/main/jastadd/MustacheNodes.relast',
"--listClass=java.util.ArrayList",
"--jastAddList=JastAddList",
"--useJastAddNames",
......@@ -60,18 +63,9 @@ task relast(type: JavaExec) {
"--resolverHelper",
"--grammarName=./src/gen/jastadd/Grammar2Uml"
]
inputs.files(file("../libs/relast.jar"),
preprocessorGrammar,
mustacheGrammar,
grammar2umlGrammar,
intermediateGrammar)
outputs.files(file("./src/gen/jastadd/Grammar2Uml.ast"),
file("./src/gen/jastadd/Grammar2Uml.jadd"),
file("./src/gen/jastadd/Grammar2UmlRefResolver.jadd"),
file('./src/gen/jastadd/Grammar2UmlResolverStubs.jrag'))
}
// --- JastAdd ---
jastadd {
configureModuleBuild()
modules {
......@@ -136,8 +130,88 @@ jastadd {
scanner.genDir = "src/gen/java/de/tudresden/inf/st/jastadd/grammar2uml/scanner"
parser.genDir = "src/gen/java/de/tudresden/inf/st/jastadd/grammar2uml/parser"
jastaddOptions = ["--lineColumnNumbers", "--List=JastAddList", "--safeLazy", "--visitCheck=true", "--rewrite=cnta", "--cache=all"]
// defalt options are: '--rewrite=cnta', '--safeLazy', '--visitCheck=false', '--cacheCycle=false'
extraJastAddOptions = ["--lineColumnNumbers", "--List=JastAddList", "--visitCheck=true"]
}
// --- Tests ---
test.useJUnitPlatform()
// --- Versioning and Publishing ---
ext {
mainClassName = 'de.tudresden.inf.st.jastadd.grammar2uml.compiler.Compiler'
}
application.mainClassName = "${mainClassName}"
task fatJar(type: Jar) {
dependsOn jar
group = "build"
archiveAppendix = "fatjar"
from {
configurations.runtimeClasspath.collect { it.isDirectory() ? it : zipTree(it) }
}
manifest {
attributes "Main-Class": "${mainClassName}"
}
}
def versionFile = 'src/main/resources/grammar2umlVersion.properties'
try {
def oldProps = new Properties()
file(versionFile).withInputStream { stream -> oldProps.load(stream) }
version = oldProps['version']
} catch (ignored) {
// 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.")
}
task newVersion() {
doFirst {
def props = new Properties()
props['version'] = value
props.store(file(versionFile).newWriter(), null)
}
}
task printVersion() {
doLast {
println(version)
}
}
task setDevVersionForCI() {
doFirst {
def props = new Properties()
props['version'] = version + "-$System.env.CI_PIPELINE_IID"
props.store(file(versionFile).newWriter(), null)
}
}
group = 'de.tudresden.inf.st'
publishing {
publications {
maven(MavenPublication) {
from components.java
}
}
repositories {
maven {
url "https://git-st.inf.tu-dresden.de/api/v4/projects/708/packages/maven"
credentials(HttpHeaderCredentials) {
name = 'Job-Token'
value = System.getenv("CI_JOB_TOKEN")
}
authentication {
header(HttpHeaderAuthentication)
}
}
}
}
// --- Task order ---
generateAst.dependsOn relast
jar.dependsOn ":relast.preprocessor:jar"
......@@ -14,8 +14,5 @@ aspect Navigation {
eq MGrammar2Uml.getChild().containedFile() = null;
// --- containedFileName ---
eq Grammar2Uml.getChild().containedFileName() = getFileName();
eq Program.getChild().containedFileName() = null;
eq Grammar.getChild().containedFileName() = null;
eq MGrammar2Uml.getChild().containedFileName() = null;
eq Grammar2Uml.containedFileName() = getFileName();
}
#Thu Feb 24 16:54:04 CET 2022
version=0.2.1
#Mon Mar 21 13:09:36 CET 2022
version=0.2.2
File deleted
Subproject commit 7959fd58f90538a7d8751855a61f69ba775bc82c
Subproject commit cee30f5c8a1b356118f5ed78302a1df64fe76897
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment