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

Fix build, update docu, cleanup.

parent 7191cd3e
No related branches found
No related tags found
No related merge requests found
Pipeline #13155 passed
[submodule "relast.preprocessor"]
path = relast.preprocessor
url = ../relast-preprocessor.git
branch = develop
......@@ -82,7 +82,6 @@ task relast(type: JavaExec) {
}
args = [
"../libs/relast.jar",
"${extractLocation}/RelAst.relast",
"${extractLocation}/mustache/Mustache.relast",
'./src/main/jastadd/Grammar2Uml.relast',
......
......@@ -24,7 +24,6 @@ public class Grammar2UmlMain {
}
public static Grammar2Uml createManualAST() {
System.setProperty("java.util.logging.manager", "org.apache.logging.log4j.jul.LogManager");
System.setProperty("mustache.debug", "true");
Grammar2Uml model = new Grammar2Uml();
Path path = Paths.get("grammar2uml.base", "src", "test", "resources", "Example.relast");
......
<?xml version="1.0" encoding="UTF-8"?>
<Configuration status="INFO">
<Appenders>
<Console name="Console" target="SYSTEM_OUT">
<PatternLayout pattern="%d{HH:mm:ss.SSS} [%t] %-5level %logger{36} - %msg%n"/>
</Console>
</Appenders>
<Loggers>
<Root level="info">
<AppenderRef ref="Console"/>
</Root>
</Loggers>
</Configuration>
\ No newline at end of file
File deleted
# Add grammar2uml to your project
To use `Grammar2uml`, add it as a dependency:
To use `Grammar2uml`, adjust your `build.gradle` as follows.
Set up the maven package source as repository:
```gradle
repositories {
mavenCentral()
maven {
name 'gitlab-maven'
url 'https://git-st.inf.tu-dresden.de/api/v4/groups/jastadd/-/packages/maven'
}
}
```
Add `Grammar2uml` as a dependency:
```
configurations {
grammar2umlClasspath
grammar2uml
}
dependencies {
grammar2umlClasspath group: 'de.tudresden.inf.st', name: 'grammar2uml', version: '0.2.1'
grammar2uml group: 'de.tudresden.inf.st', name: 'grammar2uml', version: '0.2.2'
}
```
Then, add a task to create your visualization:
Add a task to create your visualization:
```
task grammar2uml(type: JavaExec) {
main = 'de.tudresden.inf.st.jastadd.grammar2uml.compiler.Compiler'
classpath = configurations.grammar2umlClasspath
args([
'--verbose',
'--defaultFolders',
'src/main/jastadd/YourGrammar.relast'
])
group = 'Documentation'
classpath = configurations.grammar2uml
args '--output=YourOutput.png', '--defaultFolders'
args 'src/main/jastadd/YourGrammar.relast'
}
```
## Build from source
## Build from source (not recommended)
If you want to build `Grammar2Uml` from source, first build the jar from the [repository](https://git-st.inf.tu-dresden.de/jastadd/grammar2uml):
If you want to build `Grammar2Uml` from source, first build the fat-jar from the [repository](https://git-st.inf.tu-dresden.de/jastadd/grammar2uml).
The normal jar does not suffice, as it lacks the information on needed dependencies.
```bash
git clone https://git-st.inf.tu-dresden.de/jastadd/grammar2uml.git
cd grammar2uml
./gradlew jar
./gradlew fatJar
ls grammar2uml/build/libs/
```
Those JARs can then be copied to your project.
This jar can then be copied to your project.
```bash
cp grammar2uml/build/libs/grammar2uml-<version>.jar ${YourProject}/libs/grammar2uml.jar
cp grammar2uml/build/libs/grammar2uml-fatjar-<version>.jar ${YourProject}/libs/grammar2uml.jar
```
Finally, this JAR has to be integrated into your build process. In case [Gradle](https://gradle.org/) is used, the JAR file needs to be added as dependency using:
Finally, this jar has to be integrated into your build process. In case [Gradle](https://gradle.org/) is used, the jar file needs to be added as dependency using:
```groovy
dependencies {
grammar2umlClasspath fileTree(include: ['grammar2uml.jar'], dir: 'libs')
grammar2uml fileTree(include: ['grammar2uml.jar'], dir: 'libs')
}
```
The path to the JAR file may need to be changed according to your project structure.
The path to the jar file may need to be changed according to your project structure.
......@@ -4,8 +4,6 @@ grammar2umlVersionFileName = '../grammar2uml/src/main/resources/grammar2umlVersi
def get_version():
if os.environ.get('CI_COMMIT_BRANCH', 'unknown') == 'dev':
return 'dev'
with open(grammar2umlVersionFileName) as grammar2umlVersionFile:
versionFileContent = grammar2umlVersionFile.read()
return versionFileContent[versionFileContent.rindex('version=') + 8:].strip()
......
Subproject commit cee30f5c8a1b356118f5ed78302a1df64fe76897
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment