diff --git a/pages/adding.md b/pages/adding.md index afd3ccb58fcf0c7ca71bc9e0d4ee188c15ff1df6..b8a51e83b7e342adda7bd11c33ce80c87ae94b8b 100644 --- a/pages/adding.md +++ b/pages/adding.md @@ -1,5 +1,56 @@ # 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 diff --git a/pages/conf.py b/pages/conf.py index c14f7c332cad507a05bcdfc997ff329753a19c91..d0848f910fe63a65ffdd6fe68a00269482a33823 100644 --- a/pages/conf.py +++ b/pages/conf.py @@ -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 --------------------------------------------------- diff --git a/pages/using.md b/pages/using.md index 8dfe19ee08a5a6b1e63e5344c05bef6e90e82481..a8fc0da6cf144ac4a6adaf118c3faffc814cdff5 100644 --- a/pages/using.md +++ b/pages/using.md @@ -1,5 +1,7 @@ # 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)