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

Add doc for packaged version, use version from repo in doc, link to minimal example repo.

parent 66ddeeae
No related branches found
No related tags found
No related merge requests found
Pipeline #8594 passed
# Adding `RagConnect` to your project
If you want to use `RagConnect`, either use the latest [pre-build versio](#use-packaged-version) or clone the repository and [build it yourself](#build-from-source).
## Use packaged version
Check the [package overview page](https://git-st.inf.tu-dresden.de/jastadd/ragconnect/-/packages) to find the latest version.
To use it, three steps are needed. First add this GitLab as a repository in your `build.gradle`:
```
repositories {
maven {
name "gitlab-maven"
url "https://gitlab.example.com/api/v4/groups/jastadd/-/packages/maven"
}
}
```
Next, add `RagConnect` as a dependency:
```
configurations {
ragconnectClasspath
}
dependencies {
ragconnectClasspath group: 'de.tudresden.inf.st', name: 'ragconnect.base', version: '0.2.3'
}
```
Finally, add a task to compile your specification:
```
task ragConnect(type: JavaExec) {
group = 'Build'
main = 'org.jastadd.ragconnect.compiler.Compiler'
classpath = configurations.ragconnectClasspath
args([
'--verbose',
'--o=src/gen/jastadd',
'src/main/jastadd/GoalModel.relast',
'src/main/jastadd/GoalModel.connect',
'--rootNode=GoalModel'
])
}
```
You might need to add another task for [compiling relast specifications](#compiling-relast-specifications).
## Build from source
If you want to use `RagConnect`, the currently suggested way is to first build the jar from the [RagConnect repository](https://git-st.inf.tu-dresden.de/jastadd/ragconnect):
```bash
......@@ -34,7 +85,11 @@ task ragConnect(type: JavaExec) {
}
```
This is typically accompanied with a task to invoke the [RelAst compiler](http://relational-rags.eu/) and the [JastAdd gradle plugin](https://plugins.gradle.org/plugin/org.jastadd). The additional arguments `--useJastAddNames`, `--listClass`, `--jastAddList` and `--resolverHelper` to relast are not required. Please see the user manual of the RelAst compiler for more information.
You might need to add another task for [compiling relast specifications](#compiling-relast-specifications).
## Compiling RelAst specifications
The task to compile `RagConnect` specifications is typically accompanied with a task to invoke the [RelAst compiler](http://relational-rags.eu/) and the [JastAdd gradle plugin](https://plugins.gradle.org/plugin/org.jastadd). The additional arguments `--useJastAddNames`, `--listClass`, `--jastAddList` and `--resolverHelper` to relast are not required. Please see the user manual of the RelAst compiler for more information.
```groovy
task relastToJastAdd(type: JavaExec) {
......@@ -57,7 +112,7 @@ jastadd {
}
```
One also has to specifiy the dependencies to get correct ordering of tasks.
One also has to specify the dependencies to get correct ordering of tasks.
```groovy
generateAst.dependsOn relastToJastAdd
......
......@@ -23,7 +23,11 @@ copyright = '2020, René Schöne, Johannes Mey'
author = 'René Schöne, Johannes Mey'
# The full version, including alpha/beta/rc tags
release = version = '0.2.3'
ragconnectVersionFileName = '../ragconnect.base/src/main/resources/ragConnectVersion.properties'
with open(ragconnectVersionFileName) as ragconnectVersionFile:
versionFileContent = ragconnectVersionFile.read()
release = version = versionFileContent[versionFileContent.rindex('version=') + 8:].strip()
print('Version: ' + version)
# -- General configuration ---------------------------------------------------
......
# Using `RagConnect` -- an example
The full example is available at <https://git-st.inf.tu-dresden.de/jastadd/ragconnect-minimal>.
## Preparation
The following examples are inspired by the real test case [read1write2](https://git-st.inf.tu-dresden.de/jastadd/ragconnect-tests/-/tree/master/ragconnect.tests/src/test/01-input/read1write2)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment