Skip to content
Snippets Groups Projects
Commit e4352939 authored by PagesBot's avatar PagesBot
Browse files

Deployed 6be7adf1 to 0.3.2 in public with MkDocs 1.2.2 and mike 1.1.2

parent aaf091eb
No related branches found
No related tags found
No related merge requests found
Showing
with 1399 additions and 0 deletions
<!DOCTYPE html>
<!--[if IE 8]><html class="no-js lt-ie9" lang="en" > <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js" lang="en" > <!--<![endif]-->
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="shortcut icon" href="/img/favicon.ico">
<title>RagConnect 0.3.2</title>
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Lato:400,700|Roboto+Slab:400,700|Inconsolata:400,700" />
<link rel="stylesheet" href="/css/theme.css" />
<link rel="stylesheet" href="/css/theme_extra.css" />
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/10.5.0/styles/github.min.css" />
<link href="/css/version-select.css" rel="stylesheet" />
<script src="/js/jquery-2.1.1.min.js" defer></script>
<script src="/js/modernizr-2.8.3.min.js" defer></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/10.5.0/highlight.min.js"></script>
<script>hljs.initHighlightingOnLoad();</script>
</head>
<body class="wy-body-for-nav" role="document">
<div class="wy-grid-for-nav">
<nav data-toggle="wy-nav-shift" class="wy-nav-side stickynav">
<div class="wy-side-scroll">
<div class="wy-side-nav-search">
<a href="/." class="icon icon-home"> RagConnect 0.3.2</a>
<div role="search">
<form id ="rtd-search-form" class="wy-form" action="//search.html" method="get">
<input type="text" name="q" placeholder="Search docs" title="Type search term here" />
</form>
</div>
</div>
<div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation">
<ul>
<li class="toctree-l1"><a class="reference internal" href="/using/">RagConnect by Example</a>
</li>
</ul>
<ul>
<li class="toctree-l1"><a class="reference internal" href="/use_cases/">Use Cases</a>
</li>
</ul>
<ul>
<li class="toctree-l1"><a class="reference internal" href="/adding/">Adding RagConnect to your project</a>
</li>
</ul>
<ul>
<li class="toctree-l1"><a class="reference internal" href="/compiler/">Compiler options</a>
</li>
</ul>
<ul>
<li class="toctree-l1"><a class="reference internal" href="/inner-workings/">Inner workings</a>
</li>
</ul>
<ul>
<li class="toctree-l1"><a class="reference internal" href="/extending/">Extending RagConnect</a>
</li>
</ul>
<ul>
<li class="toctree-l1"><a class="reference internal" href="/changelog/">Changelog</a>
</li>
</ul>
<ul>
<li class="toctree-l1"><a class="reference internal" href="/ragdoc/">API documentation</a>
</li>
</ul>
</div>
</div>
</nav>
<section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">
<nav class="wy-nav-top" role="navigation" aria-label="top navigation">
<i data-toggle="wy-nav-top" class="fa fa-bars"></i>
<a href="/.">RagConnect 0.3.2</a>
</nav>
<div class="wy-nav-content">
<div class="rst-content">
<div role="navigation" aria-label="breadcrumbs navigation">
<ul class="wy-breadcrumbs">
<li><a href="/.">Docs</a> &raquo;</li>
<li class="wy-breadcrumbs-aside">
</li>
</ul>
<hr/>
</div>
<div role="main">
<div class="section">
<h1 id="404-page-not-found">404</h1>
<p><strong>Page not found</strong></p>
</div>
</div>
<p>
<hr>
Built with <a href="https://www.mkdocs.org/">MkDocs</a> using a <a href="https://github.com/snide/sphinx_rtd_theme">theme</a> provided by <a href="https://readthedocs.org">Read the Docs</a>.
</p>
</div>
</div>
</section>
</div>
<div class="rst-versions" role="note" aria-label="versions">
<span class="rst-current-version" data-toggle="rst-current-version">
</span>
</div>
<script>var base_url = '/';</script>
<script src="/js/theme_extra.js" defer></script>
<script src="/js/theme.js" defer></script>
<script src="/search/main.js" defer></script>
<script src="/js/version-select.js" defer></script>
<script defer>
window.onload = function () {
SphinxRtdTheme.Navigation.enable(true);
};
</script>
</body>
</html>
<!DOCTYPE html>
<!--[if IE 8]><html class="no-js lt-ie9" lang="en" > <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js" lang="en" > <!--<![endif]-->
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="shortcut icon" href="../img/favicon.ico">
<title>Adding RagConnect to your project - RagConnect 0.3.2</title>
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Lato:400,700|Roboto+Slab:400,700|Inconsolata:400,700" />
<link rel="stylesheet" href="../css/theme.css" />
<link rel="stylesheet" href="../css/theme_extra.css" />
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/10.5.0/styles/github.min.css" />
<link href="../css/version-select.css" rel="stylesheet" />
<script>
// Current page data
var mkdocs_page_name = "Adding RagConnect to your project";
var mkdocs_page_input_path = "adding.md";
var mkdocs_page_url = null;
</script>
<script src="../js/jquery-2.1.1.min.js" defer></script>
<script src="../js/modernizr-2.8.3.min.js" defer></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/10.5.0/highlight.min.js"></script>
<script>hljs.initHighlightingOnLoad();</script>
</head>
<body class="wy-body-for-nav" role="document">
<div class="wy-grid-for-nav">
<nav data-toggle="wy-nav-shift" class="wy-nav-side stickynav">
<div class="wy-side-scroll">
<div class="wy-side-nav-search">
<a href=".." class="icon icon-home"> RagConnect 0.3.2</a>
<div role="search">
<form id ="rtd-search-form" class="wy-form" action="../search.html" method="get">
<input type="text" name="q" placeholder="Search docs" title="Type search term here" />
</form>
</div>
</div>
<div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation">
<ul>
<li class="toctree-l1"><a class="reference internal" href="../using/">RagConnect by Example</a>
</li>
</ul>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../use_cases/">Use Cases</a>
</li>
</ul>
<ul class="current">
<li class="toctree-l1 current"><a class="reference internal current" href="./">Adding RagConnect to your project</a>
<ul class="current">
<li class="toctree-l2"><a class="reference internal" href="#use-packaged-version">Use packaged version</a>
</li>
<li class="toctree-l2"><a class="reference internal" href="#build-from-source">Build from source</a>
</li>
</ul>
</li>
</ul>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../compiler/">Compiler options</a>
</li>
</ul>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../inner-workings/">Inner workings</a>
</li>
</ul>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../extending/">Extending RagConnect</a>
</li>
</ul>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../changelog/">Changelog</a>
</li>
</ul>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../ragdoc/">API documentation</a>
</li>
</ul>
</div>
</div>
</nav>
<section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">
<nav class="wy-nav-top" role="navigation" aria-label="top navigation">
<i data-toggle="wy-nav-top" class="fa fa-bars"></i>
<a href="..">RagConnect 0.3.2</a>
</nav>
<div class="wy-nav-content">
<div class="rst-content">
<div role="navigation" aria-label="breadcrumbs navigation">
<ul class="wy-breadcrumbs">
<li><a href="..">Docs</a> &raquo;</li>
<li>Adding RagConnect to your project</li>
<li class="wy-breadcrumbs-aside">
</li>
</ul>
<hr/>
</div>
<div role="main">
<div class="section">
<h1 id="adding-ragconnect-to-your-project">Adding <code>RagConnect</code> to your project<a class="headerlink" href="#adding-ragconnect-to-your-project" title="Permanent link"></a></h1>
<p>If you want to use <code>RagConnect</code>, either use the latest <a href="#use-packaged-version">pre-build version</a> or clone the repository and <a href="#build-from-source">build it yourself</a>.</p>
<h2 id="use-packaged-version">Use packaged version<a class="headerlink" href="#use-packaged-version" title="Permanent link"></a></h2>
<p>Check the <a href="https://git-st.inf.tu-dresden.de/jastadd/ragconnect/-/packages">package overview page</a> to find the latest version.</p>
<p>To use it, three steps are needed. First add this GitLab as a repository in your <code>build.gradle</code>:</p>
<pre><code>repositories {
maven {
name &quot;gitlab-maven&quot;
url &quot;https://git-st.inf.tu-dresden.de/api/v4/groups/jastadd/-/packages/maven&quot;
}
}
</code></pre>
<p>Next, add <code>RagConnect</code> as a dependency:</p>
<pre><code>configurations {
ragconnectClasspath
}
dependencies {
ragconnectClasspath group: 'de.tudresden.inf.st', name: 'ragconnect', version: '0.2.3'
}
</code></pre>
<p>Finally, add a task to compile your specification:</p>
<pre><code>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'
])
}
</code></pre>
<p>You might need to add another task for <a href="#compiling-relast-specifications">compiling relast specifications</a>.</p>
<h2 id="build-from-source">Build from source<a class="headerlink" href="#build-from-source" title="Permanent link"></a></h2>
<p>If you want to plan to extend <code>RagConnect</code>, the suggested way is to first build the jar from the <a href="https://git-st.inf.tu-dresden.de/jastadd/ragconnect">RagConnect repository</a> (if you only want to <em>use</em> it, consider using <a href="#use-packaged-version">the packaged version</a>).</p>
<pre><code class="language-bash">git clone https://git-st.inf.tu-dresden.de/jastadd/ragconnect.git
cd ragconnect
./gradlew jar
ls ragconnect.base/build/libs/
</code></pre>
<p>This <code>ragconnect-&lt;version&gt;.jar</code> can then be copied to your project.
Please note, that you can safely use <code>ragconnect.jar</code> as filename, because the version can always be printed using <code>java -jar path/to/ragconnect.jar --version</code>.</p>
<pre><code class="language-bash">cp ragconnect.base/build/libs/ragconnect-&lt;version&gt;.jar ../your-project/libs/ragconnect.jar
cd ../your-project/
</code></pre>
<p>Finally, this jar has to be integrated into your build process.
In case, <a href="https://gradle.org/">Gradle</a> is used, a task could look like the following (example taken from the <a href="https://git-st.inf.tu-dresden.de/jastadd/ros2rag">ros2rag use case</a>).
The path to the jar file may need to be changed according to your project structure.</p>
<pre><code class="language-groovy">task ragConnect(type: JavaExec) {
group = 'Build'
main = '-jar'
args([
'../libs/ragconnect.jar',
'--verbose',
'--o=src/gen/jastadd',
'src/main/jastadd/GoalModel.relast',
'src/main/jastadd/GoalModel.connect',
'--rootNode=GoalModel'
])
}
</code></pre>
<p>You might need to add another task for <a href="#compiling-relast-specifications">compiling relast specifications</a>.</p>
<h1 id="compiling-relast-specifications">Compiling RelAst specifications<a class="headerlink" href="#compiling-relast-specifications" title="Permanent link"></a></h1>
<p>The task to compile <code>RagConnect</code> specifications is typically accompanied by a task to invoke the <a href="http://relational-rags.eu/">RelAst compiler</a> and the <a href="https://plugins.gradle.org/plugin/org.jastadd">JastAdd gradle plugin</a>.
Currently, the parameter <code>--useJastAddNames</code> is <strong>required</strong>, and it may cause incompatibilities if not set.
The additional arguments <code>--listClass</code>, <code>--jastAddList</code> and <code>--resolverHelper</code> to relast are not required.
Please see the user manual of the RelAst compiler for more information.</p>
<pre><code class="language-groovy">task relastToJastAdd(type: JavaExec) {
group = 'Build'
main = &quot;-jar&quot;
args([&quot;../libs/relast.jar&quot;,
&quot;--grammarName=./src/gen/jastadd/model&quot;,
&quot;--useJastAddNames&quot;,
&quot;--listClass=java.util.ArrayList&quot;,
&quot;--jastAddList=JastAddList&quot;,
&quot;--resolverHelper&quot;,
&quot;--file&quot;,
&quot;src/gen/jastadd/GoalModel.relast&quot;,
&quot;src/gen/jastadd/RagConnect.relast&quot;])
}
jastadd {
...
}
</code></pre>
<p>One also has to specify the dependencies to get correct ordering of tasks.</p>
<pre><code class="language-groovy">generateAst.dependsOn relastToJastAdd
relastToJastAdd.dependsOn ragConnect
</code></pre>
</div>
</div>
<p>
<hr>
Built with <a href="https://www.mkdocs.org/">MkDocs</a> using a <a href="https://github.com/snide/sphinx_rtd_theme">theme</a> provided by <a href="https://readthedocs.org">Read the Docs</a>.
<small><br><i>Last updated <span class="git-revision-date-localized-plugin git-revision-date-localized-plugin-datetime">November 24, 2021 11:42:30</span></i></small>
</p>
</div>
</div>
</section>
</div>
<div class="rst-versions" role="note" aria-label="versions">
<span class="rst-current-version" data-toggle="rst-current-version">
<span><a href="../use_cases/" style="color: #fcfcfc">&laquo; Previous</a></span>
<span><a href="../compiler/" style="color: #fcfcfc">Next &raquo;</a></span>
</span>
</div>
<script>var base_url = '..';</script>
<script src="../js/theme_extra.js" defer></script>
<script src="../js/theme.js" defer></script>
<script src="../search/main.js" defer></script>
<script src="../js/version-select.js" defer></script>
<script defer>
window.onload = function () {
SphinxRtdTheme.Navigation.enable(true);
};
</script>
</body>
</html>
<!DOCTYPE html>
<!--[if IE 8]><html class="no-js lt-ie9" lang="en" > <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js" lang="en" > <!--<![endif]-->
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="shortcut icon" href="../img/favicon.ico">
<title>Changelog - RagConnect 0.3.2</title>
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Lato:400,700|Roboto+Slab:400,700|Inconsolata:400,700" />
<link rel="stylesheet" href="../css/theme.css" />
<link rel="stylesheet" href="../css/theme_extra.css" />
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/10.5.0/styles/github.min.css" />
<link href="../css/version-select.css" rel="stylesheet" />
<script>
// Current page data
var mkdocs_page_name = "Changelog";
var mkdocs_page_input_path = "changelog.md";
var mkdocs_page_url = null;
</script>
<script src="../js/jquery-2.1.1.min.js" defer></script>
<script src="../js/modernizr-2.8.3.min.js" defer></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/10.5.0/highlight.min.js"></script>
<script>hljs.initHighlightingOnLoad();</script>
</head>
<body class="wy-body-for-nav" role="document">
<div class="wy-grid-for-nav">
<nav data-toggle="wy-nav-shift" class="wy-nav-side stickynav">
<div class="wy-side-scroll">
<div class="wy-side-nav-search">
<a href=".." class="icon icon-home"> RagConnect 0.3.2</a>
<div role="search">
<form id ="rtd-search-form" class="wy-form" action="../search.html" method="get">
<input type="text" name="q" placeholder="Search docs" title="Type search term here" />
</form>
</div>
</div>
<div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation">
<ul>
<li class="toctree-l1"><a class="reference internal" href="../using/">RagConnect by Example</a>
</li>
</ul>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../use_cases/">Use Cases</a>
</li>
</ul>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../adding/">Adding RagConnect to your project</a>
</li>
</ul>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../compiler/">Compiler options</a>
</li>
</ul>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../inner-workings/">Inner workings</a>
</li>
</ul>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../extending/">Extending RagConnect</a>
</li>
</ul>
<ul class="current">
<li class="toctree-l1 current"><a class="reference internal current" href="./">Changelog</a>
<ul class="current">
<li class="toctree-l2"><a class="reference internal" href="#032">0.3.2</a>
</li>
<li class="toctree-l2"><a class="reference internal" href="#031">0.3.1</a>
</li>
<li class="toctree-l2"><a class="reference internal" href="#030">0.3.0</a>
</li>
<li class="toctree-l2"><a class="reference internal" href="#022">0.2.2</a>
</li>
<li class="toctree-l2"><a class="reference internal" href="#021">0.2.1</a>
</li>
<li class="toctree-l2"><a class="reference internal" href="#020">0.2.0</a>
</li>
</ul>
</li>
</ul>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../ragdoc/">API documentation</a>
</li>
</ul>
</div>
</div>
</nav>
<section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">
<nav class="wy-nav-top" role="navigation" aria-label="top navigation">
<i data-toggle="wy-nav-top" class="fa fa-bars"></i>
<a href="..">RagConnect 0.3.2</a>
</nav>
<div class="wy-nav-content">
<div class="rst-content">
<div role="navigation" aria-label="breadcrumbs navigation">
<ul class="wy-breadcrumbs">
<li><a href="..">Docs</a> &raquo;</li>
<li>Changelog</li>
<li class="wy-breadcrumbs-aside">
</li>
</ul>
<hr/>
</div>
<div role="main">
<div class="section">
<h1 id="changelog">Changelog<a class="headerlink" href="#changelog" title="Permanent link"></a></h1>
<h2 id="032">0.3.2<a class="headerlink" href="#032" title="Permanent link"></a></h2>
<ul>
<li>Allow connection endpoints for list nonterminals (<a href="https://git-st.inf.tu-dresden.de/jastadd/ragconnect/-/issues/21">#21</a>)</li>
<li>Ensure correct connect and disconnect functionality (<a href="https://git-st.inf.tu-dresden.de/jastadd/ragconnect/-/issues/31">#31</a>)</li>
<li>Enhance documentation (<a href="https://git-st.inf.tu-dresden.de/jastadd/ragconnect/-/issues/13">#13</a>, <a href="https://git-st.inf.tu-dresden.de/jastadd/ragconnect/-/issues/20">#20</a>, <a href="https://git-st.inf.tu-dresden.de/jastadd/ragconnect/-/issues/41">#41</a>)</li>
</ul>
<h2 id="031">0.3.1<a class="headerlink" href="#031" title="Permanent link"></a></h2>
<ul>
<li>Full support for incremental dependency tracking</li>
<li>Full support for subtree endpoint definitions (<a href="https://git-st.inf.tu-dresden.de/jastadd/ragconnect/-/issues/9">#9</a>)</li>
<li>Internal: Use updated gradle plugin for tests (<a href="https://git-st.inf.tu-dresden.de/jastadd/ragconnect/-/issues/18">#18</a>)</li>
<li>Bugfix <a href="https://git-st.inf.tu-dresden.de/jastadd/ragconnect/-/issues/22">#22</a>: Correct handling of malformed URIs passed when connecting an endpoint</li>
<li>Bugfix <a href="https://git-st.inf.tu-dresden.de/jastadd/ragconnect/-/issues/23">#23</a>: Correct handling of OptComponents as endpoints</li>
<li>Bugfix <a href="https://git-st.inf.tu-dresden.de/jastadd/ragconnect/-/issues/27">#27</a>: Correctly handle whitespaces in grammars</li>
</ul>
<h2 id="030">0.3.0<a class="headerlink" href="#030" title="Permanent link"></a></h2>
<ul>
<li>Added <a href="../ragdoc/">API documentation</a> to documentation</li>
<li>Add methods to <code>disconnect</code> an endpoint</li>
<li>Internal: PoC for incremental dependency tracking and subtree endpoint definitions (<a href="https://git-st.inf.tu-dresden.de/jastadd/ragconnect/-/issues/14">#14</a>)</li>
<li>Bugfix <a href="https://git-st.inf.tu-dresden.de/jastadd/ragconnect/-/issues/17">#17</a>: Added missing support for <code>boolean</code></li>
</ul>
<h2 id="022">0.2.2<a class="headerlink" href="#022" title="Permanent link"></a></h2>
<ul>
<li>Allow normal tokens to be used in send definitions</li>
</ul>
<h2 id="021">0.2.1<a class="headerlink" href="#021" title="Permanent link"></a></h2>
<ul>
<li>New communication protocol: REST</li>
<li>Selection of protocol when <code>connect</code> methods are called, by scheme of given URI</li>
<li>Development changes:<ul>
<li>Supported printing out YAML data used for mustache templates</li>
<li>Moved string constants to <code>MRagConnect</code> structure</li>
</ul>
</li>
</ul>
<h2 id="020">0.2.0<a class="headerlink" href="#020" title="Permanent link"></a></h2>
<ul>
<li>Version submitted in paper "A Connection from ROS to RAG-Based Models" (2020)</li>
<li>Supported communication protocols: MQTT</li>
</ul>
</div>
</div>
<p>
<hr>
Built with <a href="https://www.mkdocs.org/">MkDocs</a> using a <a href="https://github.com/snide/sphinx_rtd_theme">theme</a> provided by <a href="https://readthedocs.org">Read the Docs</a>.
<small><br><i>Last updated <span class="git-revision-date-localized-plugin git-revision-date-localized-plugin-datetime">November 24, 2021 11:42:30</span></i></small>
</p>
</div>
</div>
</section>
</div>
<div class="rst-versions" role="note" aria-label="versions">
<span class="rst-current-version" data-toggle="rst-current-version">
<span><a href="../extending/" style="color: #fcfcfc">&laquo; Previous</a></span>
<span><a href="../ragdoc/" style="color: #fcfcfc">Next &raquo;</a></span>
</span>
</div>
<script>var base_url = '..';</script>
<script src="../js/theme_extra.js" defer></script>
<script src="../js/theme.js" defer></script>
<script src="../search/main.js" defer></script>
<script src="../js/version-select.js" defer></script>
<script defer>
window.onload = function () {
SphinxRtdTheme.Navigation.enable(true);
};
</script>
</body>
</html>
<!DOCTYPE html>
<!--[if IE 8]><html class="no-js lt-ie9" lang="en" > <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js" lang="en" > <!--<![endif]-->
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="shortcut icon" href="../img/favicon.ico">
<title>Compiler options - RagConnect 0.3.2</title>
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Lato:400,700|Roboto+Slab:400,700|Inconsolata:400,700" />
<link rel="stylesheet" href="../css/theme.css" />
<link rel="stylesheet" href="../css/theme_extra.css" />
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/10.5.0/styles/github.min.css" />
<link href="../css/version-select.css" rel="stylesheet" />
<script>
// Current page data
var mkdocs_page_name = "Compiler options";
var mkdocs_page_input_path = "compiler.md";
var mkdocs_page_url = null;
</script>
<script src="../js/jquery-2.1.1.min.js" defer></script>
<script src="../js/modernizr-2.8.3.min.js" defer></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/10.5.0/highlight.min.js"></script>
<script>hljs.initHighlightingOnLoad();</script>
</head>
<body class="wy-body-for-nav" role="document">
<div class="wy-grid-for-nav">
<nav data-toggle="wy-nav-shift" class="wy-nav-side stickynav">
<div class="wy-side-scroll">
<div class="wy-side-nav-search">
<a href=".." class="icon icon-home"> RagConnect 0.3.2</a>
<div role="search">
<form id ="rtd-search-form" class="wy-form" action="../search.html" method="get">
<input type="text" name="q" placeholder="Search docs" title="Type search term here" />
</form>
</div>
</div>
<div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation">
<ul>
<li class="toctree-l1"><a class="reference internal" href="../using/">RagConnect by Example</a>
</li>
</ul>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../use_cases/">Use Cases</a>
</li>
</ul>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../adding/">Adding RagConnect to your project</a>
</li>
</ul>
<ul class="current">
<li class="toctree-l1 current"><a class="reference internal current" href="./">Compiler options</a>
<ul class="current">
</ul>
</li>
</ul>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../inner-workings/">Inner workings</a>
</li>
</ul>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../extending/">Extending RagConnect</a>
</li>
</ul>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../changelog/">Changelog</a>
</li>
</ul>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../ragdoc/">API documentation</a>
</li>
</ul>
</div>
</div>
</nav>
<section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">
<nav class="wy-nav-top" role="navigation" aria-label="top navigation">
<i data-toggle="wy-nav-top" class="fa fa-bars"></i>
<a href="..">RagConnect 0.3.2</a>
</nav>
<div class="wy-nav-content">
<div class="rst-content">
<div role="navigation" aria-label="breadcrumbs navigation">
<ul class="wy-breadcrumbs">
<li><a href="..">Docs</a> &raquo;</li>
<li>Compiler options</li>
<li class="wy-breadcrumbs-aside">
</li>
</ul>
<hr/>
</div>
<div role="main">
<div class="section">
<h1 id="compiler-options">Compiler options<a class="headerlink" href="#compiler-options" title="Permanent link"></a></h1>
<p>The compiler is JastAdd-compliant, i.e., it accepts all flags available for JastAdd, though there is no process how to chain pre-processors <em>yet</em>.
Additional options are as follows.</p>
<table>
<thead>
<tr>
<th>Name</th>
<th>Required (Default)</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>--rootNode</code></td>
<td>Yes</td>
<td>Root node in the base grammar.</td>
</tr>
<tr>
<td><code>--protocols</code></td>
<td>No (<code>mqtt</code>)</td>
<td>Protocols to enable, currently available: <code>mqtt, rest</code>.</td>
</tr>
<tr>
<td><code>--printYaml</code></td>
<td>No (false)</td>
<td>Print out YAML instead of generating files.</td>
</tr>
<tr>
<td><code>--verbose</code></td>
<td>No (false)</td>
<td>Print more messages while compiling.</td>
</tr>
<tr>
<td><code>--logReads</code></td>
<td>No (false)</td>
<td>Enable logging for every received message.</td>
</tr>
<tr>
<td><code>--logWrites</code></td>
<td>No (false)</td>
<td>Enable logging for every sent message.</td>
</tr>
<tr>
<td><code>--logIncremental</code></td>
<td>No (false)</td>
<td>Enable logging for observer in incremental dependency tracking.</td>
</tr>
<tr>
<td><code>--experimental-jastadd-329</code></td>
<td>No (false)</td>
<td>Use trace events <code>INC_FLUSH_START</code> and <code>INC_FLUSH_END</code> (<a href="https://bitbucket.org/jastadd/jastadd2/issues/329/add-event-for-completion-of-flush">JastAdd issue #329</a>), see <a href="/using#dependency-tracking-automatically-derived">section about automatic dependency tracking</a>.</td>
</tr>
<tr>
<td><code>--incremental</code></td>
<td>No (false)</td>
<td>Enables incremental dependency tracking (if <code>trace</code> is also set appropriately).</td>
</tr>
<tr>
<td><code>--trace[=flush]</code></td>
<td>No (false)</td>
<td>Enables incremental dependency tracking (if <code>incremental</code> is also set appropriately).</td>
</tr>
<tr>
<td><code>--version</code></td>
<td>No (false)</td>
<td>Print version info and exit (reused JastAdd option)</td>
</tr>
<tr>
<td><code>--o</code></td>
<td>No (<code>.</code>)</td>
<td>Output directory (reused JastAdd option)</td>
</tr>
</tbody>
</table>
<p>All files to be process have to be passed as arguments.
Their type is decided by the file extension (<code>ast</code> and <code>relast</code> for input grammars, <code>connect</code> and <code>ragconnect</code> for RagConnect definitions file).</p>
<h1 id="additional-software-dependencies">Additional software dependencies<a class="headerlink" href="#additional-software-dependencies" title="Permanent link"></a></h1>
<p>Using RagConnect itself does not introduce dependencies.
However, depending on the selected protocols and/or used features, additional dependencies are required when using the generated code.</p>
<h2 id="communication-protocol-characteristics">Communication protocol characteristics<a class="headerlink" href="#communication-protocol-characteristics" title="Permanent link"></a></h2>
<h3 id="mqtt">MQTT<a class="headerlink" href="#mqtt" title="Permanent link"></a></h3>
<ul>
<li>Protocol identifier: <code>mqtt</code></li>
<li>URI scheme: <code>mqtt://&lt;broker-host&gt;[:port]/&lt;topic&gt;</code></li>
<li>Default port: 1883</li>
<li>Type for mapping definitions: <code>byte[]</code></li>
<li>Required runtime dependencies:<ul>
<li><code>group: 'org.fusesource.mqtt-client', name: 'mqtt-client', version: '1.15'</code></li>
</ul>
</li>
<li>Additional remarks:<ul>
<li>First leading slash not included in topic.</li>
<li>Mqtt is selected by default, so this dependency therefore is required "by default".</li>
<li>Might work with other versions of <code>org.fusesource.mqtt-client.mqtt.client</code> as well.</li>
</ul>
</li>
</ul>
<h3 id="rest">REST<a class="headerlink" href="#rest" title="Permanent link"></a></h3>
<ul>
<li>Protocol identifier: <code>rest</code></li>
<li>URI scheme: <code>rest://localhost[:port]/&lt;path&gt;</code></li>
<li>Default port: 4567</li>
<li>Type for mapping definitions: <code>String</code></li>
<li>Required runtime dependencies:<ul>
<li><code>group: 'com.sparkjava', name: 'spark-core', version: '2.9.3'</code></li>
</ul>
</li>
<li>Additional remarks:<ul>
<li>Host is always <code>localhost</code>.</li>
<li>Might work with newer versions of <code>com.sparkjava.spark-core</code> as well.</li>
<li>For debugging, it is beneficial to include an implementation for <a href="http://www.slf4j.org/">SLF4J</a>.</li>
</ul>
</li>
</ul>
<h2 id="used-features">Used features<a class="headerlink" href="#used-features" title="Permanent link"></a></h2>
<h3 id="automatic-dependency-tracking">Automatic dependency tracking<a class="headerlink" href="#automatic-dependency-tracking" title="Permanent link"></a></h3>
<ul>
<li>Condition: When passing <code>--incremental</code> and <code>--trace=flush</code> to RagConnect</li>
<li>Required runtime dependencies: <em>none</em></li>
<li>Required options for RelAST compiler: <em>none</em></li>
<li>Required options for JastAdd:<ul>
<li><code>--incremental</code></li>
<li><code>--trace=flush</code></li>
</ul>
</li>
<li>Remarks:<ul>
<li>Other (additional) values passed to those two options must be equal (e.g., <code>--incremental=param</code> passed to RagConnect must be also passed to JastAdd)</li>
<li>Other values besides <code>flush</code> can be added to <code>--trace</code></li>
<li><a href="/using#dependency-tracking-automatically-derived">Feature description</a></li>
</ul>
</li>
</ul>
<h3 id="safer-automatic-dependency-tracking">(Safer) Automatic dependency tracking<a class="headerlink" href="#safer-automatic-dependency-tracking" title="Permanent link"></a></h3>
<ul>
<li>Condition: When passing <code>--experimental-jastadd-329</code> to RagConnect</li>
<li>Required runtime dependencies: <em>none</em></li>
<li>Required options for RelAST compiler: <em>none</em></li>
<li>Required options for JastAdd: <em>none</em></li>
<li>Remarks:<ul>
<li>JastAdd version has to support <code>INC_FLUSH_START</code> and <code>INC_FLUSH_END</code> (i.e., has <a href="https://bitbucket.org/jastadd/jastadd2/issues/329/add-event-for-completion-of-flush">issue #329</a> resolved)</li>
<li><a href="/using#dependency-tracking-automatically-derived">Feature description</a></li>
</ul>
</li>
</ul>
<h3 id="treelist-endpoints">Tree/List Endpoints<a class="headerlink" href="#treelist-endpoints" title="Permanent link"></a></h3>
<ul>
<li>Condition: When using <code>tree</code> or <code>list</code> endpoints along with default mappings</li>
<li>Required runtime dependencies:<ul>
<li><code>group: 'com.fasterxml.jackson.core', name: 'jackson-core', version: '2.12.1'</code></li>
<li><code>group: 'com.fasterxml.jackson.core', name: 'jackson-databind', version: '2.12.1'</code></li>
</ul>
</li>
<li>Required options for RelAST compiler:<ul>
<li><code>--serializer=jackson</code></li>
</ul>
</li>
<li>Required options for JastAdd: <em>none</em></li>
<li>Remarks:<ul>
<li><a href="/using#an-advanced-example">Feature description</a></li>
</ul>
</li>
</ul>
</div>
</div>
<p>
<hr>
Built with <a href="https://www.mkdocs.org/">MkDocs</a> using a <a href="https://github.com/snide/sphinx_rtd_theme">theme</a> provided by <a href="https://readthedocs.org">Read the Docs</a>.
<small><br><i>Last updated <span class="git-revision-date-localized-plugin git-revision-date-localized-plugin-datetime">November 24, 2021 11:42:30</span></i></small>
</p>
</div>
</div>
</section>
</div>
<div class="rst-versions" role="note" aria-label="versions">
<span class="rst-current-version" data-toggle="rst-current-version">
<span><a href="../adding/" style="color: #fcfcfc">&laquo; Previous</a></span>
<span><a href="../inner-workings/" style="color: #fcfcfc">Next &raquo;</a></span>
</span>
</div>
<script>var base_url = '..';</script>
<script src="../js/theme_extra.js" defer></script>
<script src="../js/theme.js" defer></script>
<script src="../search/main.js" defer></script>
<script src="../js/version-select.js" defer></script>
<script defer>
window.onload = function () {
SphinxRtdTheme.Navigation.enable(true);
};
</script>
</body>
</html>
This diff is collapsed.
/*
* Wrap inline code samples otherwise they shoot of the side and
* can't be read at all.
*
* https://github.com/mkdocs/mkdocs/issues/313
* https://github.com/mkdocs/mkdocs/issues/233
* https://github.com/mkdocs/mkdocs/issues/834
*/
.rst-content code {
white-space: pre-wrap;
word-wrap: break-word;
padding: 2px 5px;
}
/**
* Make code blocks display as blocks and give them the appropriate
* font size and padding.
*
* https://github.com/mkdocs/mkdocs/issues/855
* https://github.com/mkdocs/mkdocs/issues/834
* https://github.com/mkdocs/mkdocs/issues/233
*/
.rst-content pre code {
white-space: pre;
word-wrap: normal;
display: block;
padding: 12px;
font-size: 12px;
}
/**
* Fix code colors
*
* https://github.com/mkdocs/mkdocs/issues/2027
*/
.rst-content code {
color: #E74C3C;
}
.rst-content pre code {
color: #000;
background: #f8f8f8;
}
/*
* Fix link colors when the link text is inline code.
*
* https://github.com/mkdocs/mkdocs/issues/718
*/
a code {
color: #2980B9;
}
a:hover code {
color: #3091d1;
}
a:visited code {
color: #9B59B6;
}
/*
* The CSS classes from highlight.js seem to clash with the
* ReadTheDocs theme causing some code to be incorrectly made
* bold and italic.
*
* https://github.com/mkdocs/mkdocs/issues/411
*/
pre .cs, pre .c {
font-weight: inherit;
font-style: inherit;
}
/*
* Fix some issues with the theme and non-highlighted code
* samples. Without and highlighting styles attached the
* formatting is broken.
*
* https://github.com/mkdocs/mkdocs/issues/319
*/
.rst-content .no-highlight {
display: block;
padding: 0.5em;
color: #333;
}
/*
* Additions specific to the search functionality provided by MkDocs
*/
.search-results {
margin-top: 23px;
}
.search-results article {
border-top: 1px solid #E1E4E5;
padding-top: 24px;
}
.search-results article:first-child {
border-top: none;
}
form .search-query {
width: 100%;
border-radius: 50px;
padding: 6px 12px; /* csslint allow: box-model */
border-color: #D1D4D5;
}
/*
* Improve inline code blocks within admonitions.
*
* https://github.com/mkdocs/mkdocs/issues/656
*/
.rst-content .admonition code {
color: #404040;
border: 1px solid #c7c9cb;
border: 1px solid rgba(0, 0, 0, 0.2);
background: #f8fbfd;
background: rgba(255, 255, 255, 0.7);
}
/*
* Account for wide tables which go off the side.
* Override borders to avoid wierdness on narrow tables.
*
* https://github.com/mkdocs/mkdocs/issues/834
* https://github.com/mkdocs/mkdocs/pull/1034
*/
.rst-content .section .docutils {
width: 100%;
overflow: auto;
display: block;
border: none;
}
td, th {
border: 1px solid #e1e4e5 !important; /* csslint allow: important */
border-collapse: collapse;
}
/*
* Without the following amendments, the navigation in the theme will be
* slightly cut off. This is due to the fact that the .wy-nav-side has a
* padding-bottom of 2em, which must not necessarily align with the font-size of
* 90 % on the .rst-current-version container, combined with the padding of 12px
* above and below. These amendments fix this in two steps: First, make sure the
* .rst-current-version container has a fixed height of 40px, achieved using
* line-height, and then applying a padding-bottom of 40px to this container. In
* a second step, the items within that container are re-aligned using flexbox.
*
* https://github.com/mkdocs/mkdocs/issues/2012
*/
.wy-nav-side {
padding-bottom: 40px;
}
/*
* The second step of above amendment: Here we make sure the items are aligned
* correctly within the .rst-current-version container. Using flexbox, we
* achieve it in such a way that it will look like the following:
*
* [No repo_name]
* Next >> // On the first page
* << Previous Next >> // On all subsequent pages
*
* [With repo_name]
* <repo_name> Next >> // On the first page
* <repo_name> << Previous Next >> // On all subsequent pages
*
* https://github.com/mkdocs/mkdocs/issues/2012
*/
.rst-versions .rst-current-version {
padding: 0 12px;
display: flex;
font-size: initial;
justify-content: space-between;
align-items: center;
line-height: 40px;
}
/*
* Please note that this amendment also involves removing certain inline-styles
* from the file ./mkdocs/themes/readthedocs/versions.html.
*
* https://github.com/mkdocs/mkdocs/issues/2012
*/
.rst-current-version span {
flex: 1;
text-align: center;
}
#version-selector {
display: block;
margin: -10px auto 0.809em;
padding: 2px;
}
<!DOCTYPE html>
<!--[if IE 8]><html class="no-js lt-ie9" lang="en" > <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js" lang="en" > <!--<![endif]-->
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="shortcut icon" href="../img/favicon.ico">
<title>Extending RagConnect - RagConnect 0.3.2</title>
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Lato:400,700|Roboto+Slab:400,700|Inconsolata:400,700" />
<link rel="stylesheet" href="../css/theme.css" />
<link rel="stylesheet" href="../css/theme_extra.css" />
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/10.5.0/styles/github.min.css" />
<link href="../css/version-select.css" rel="stylesheet" />
<script>
// Current page data
var mkdocs_page_name = "Extending RagConnect";
var mkdocs_page_input_path = "extending.md";
var mkdocs_page_url = null;
</script>
<script src="../js/jquery-2.1.1.min.js" defer></script>
<script src="../js/modernizr-2.8.3.min.js" defer></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/10.5.0/highlight.min.js"></script>
<script>hljs.initHighlightingOnLoad();</script>
</head>
<body class="wy-body-for-nav" role="document">
<div class="wy-grid-for-nav">
<nav data-toggle="wy-nav-shift" class="wy-nav-side stickynav">
<div class="wy-side-scroll">
<div class="wy-side-nav-search">
<a href=".." class="icon icon-home"> RagConnect 0.3.2</a>
<div role="search">
<form id ="rtd-search-form" class="wy-form" action="../search.html" method="get">
<input type="text" name="q" placeholder="Search docs" title="Type search term here" />
</form>
</div>
</div>
<div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation">
<ul>
<li class="toctree-l1"><a class="reference internal" href="../using/">RagConnect by Example</a>
</li>
</ul>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../use_cases/">Use Cases</a>
</li>
</ul>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../adding/">Adding RagConnect to your project</a>
</li>
</ul>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../compiler/">Compiler options</a>
</li>
</ul>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../inner-workings/">Inner workings</a>
</li>
</ul>
<ul class="current">
<li class="toctree-l1 current"><a class="reference internal current" href="./">Extending RagConnect</a>
<ul class="current">
<li class="toctree-l2"><a class="reference internal" href="#writing-tests">Writing Tests</a>
<ul>
<li class="toctree-l3"><a class="reference internal" href="#specifications">Specifications</a>
</li>
<li class="toctree-l3"><a class="reference internal" href="#test-classes">Test Classes</a>
</li>
<li class="toctree-l3"><a class="reference internal" href="#buildgradle">build.gradle</a>
</li>
</ul>
</li>
</ul>
</li>
</ul>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../changelog/">Changelog</a>
</li>
</ul>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../ragdoc/">API documentation</a>
</li>
</ul>
</div>
</div>
</nav>
<section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">
<nav class="wy-nav-top" role="navigation" aria-label="top navigation">
<i data-toggle="wy-nav-top" class="fa fa-bars"></i>
<a href="..">RagConnect 0.3.2</a>
</nav>
<div class="wy-nav-content">
<div class="rst-content">
<div role="navigation" aria-label="breadcrumbs navigation">
<ul class="wy-breadcrumbs">
<li><a href="..">Docs</a> &raquo;</li>
<li>Extending RagConnect</li>
<li class="wy-breadcrumbs-aside">
</li>
</ul>
<hr/>
</div>
<div role="main">
<div class="section">
<h1 id="extending-ragconnect">Extending <code>RagConnect</code><a class="headerlink" href="#extending-ragconnect" title="Permanent link"></a></h1>
<p>To add a new communication protocol, the following locations have to be changed (replace <code>ABC</code> and <code>abc</code> with the name of the protocol):</p>
<p>Within <code>ragconnect.base/src/main/resources</code>:</p>
<ul>
<li>Add a new handler <code>ABCHandler</code>, if appropriate, similar to the existing handlers<ul>
<li>If further methods are needed for handler initialization, add a new template <code>abc.mustache</code> containing those procedures. Add <code>{{#usesABC}}{{&gt; abc}}{{/usesABC}}</code> at the top of <code>ragconnect.mustache</code> to use this template</li>
</ul>
</li>
<li>In <code>receiveDefinition.mustache</code> and <code>sendDefinition.mustache</code>: add a new case in the switch statement defining the logic to happen for both definitions. If the new protocol is close to a PUSH semantic, follow <code>mqtt</code>. If it is closer to PULL semantic, follow <code>rest</code>.</li>
</ul>
<p>Within <code>ragconnect.base/src/main/jastadd</code>:</p>
<ul>
<li>In <code>backend/Configuration</code>:<ul>
<li>Add a new static boolean flag <code>usesABC</code> to indicate whether the protocol is used</li>
</ul>
</li>
<li>In <code>backend/Generation</code>:<ul>
<li>Add new attributes for type <code>MRagConnect</code> for handler attribute and handler field, if needed</li>
<li>Add attributes for newly introduced references in changed mustache templates, if any</li>
<li>Add a newly constructed handler within the definition of <code>RagConnect.toMustache</code> with the needed fields (class name, construction snippet, handler attribute, handler field, the boolean flag you just added to Configuration)</li>
</ul>
</li>
<li>In <code>backend/MustacheNodesToYAML</code>:<ul>
<li>Add key-value-pair for <code>usesABC</code> (and handler, if any)</li>
<li>Add key-value-pairs for newly introduced referemces in changed mustache templates, if any</li>
</ul>
</li>
</ul>
<p>In <code>ragconnect.base/src/main/java/org/jastadd/ragconnect/compiler/Compiler.java</code>:</p>
<ul>
<li>Add a new choice for <code>--protocols</code> similar to the existing ones</li>
<li>Set the flag <code>usesABC</code> if the choice is given.</li>
<li>Add code to add the handler to the list <code>handlers</code> if the choice is given, i.e., if <code>ASTNode.usesABC</code></li>
</ul>
<p>Furthermore, new test cases are appreciated, see <a href="#writing-tests">below</a>.</p>
<h2 id="writing-tests">Writing Tests<a class="headerlink" href="#writing-tests" title="Permanent link"></a></h2>
<p>To add new tests, have a look at the module <code>ragconnect.tests</code>.
It has three parts:
1) In <code>src/test/01-input/*</code> are the <a href="#specifications">specifications</a> that are going to be compiled (in principle using the steps described in <a href="adding">the guide to add RagConnect</a>).
2) In <code>src/test/java</code>, the jUnit 5 <a href="#test-classes">test classes</a> are implemented. They mostly correspond 1-to-1 to a directory of the first part.
3) In <code>build.gradle</code> the <a href="#buildgradle">instructions how to compile</a> the specifications using the gradle plugin <a href="https://git-st.inf.tu-dresden.de/jastadd/testing">PreprocessorPlugin</a> (<code>org.jastadd.preprocessor:testing</code>).</p>
<h3 id="specifications">Specifications<a class="headerlink" href="#specifications" title="Permanent link"></a></h3>
<p>Every specification must have at least a <code>README.md</code> to describe the purpose of the test, a grammar <code>Test.relast</code>, and a RagConnect specification <code>Test.connect</code>.
Usually an aspect file <code>Test.jadd</code> is included.</p>
<h3 id="test-classes">Test Classes<a class="headerlink" href="#test-classes" title="Permanent link"></a></h3>
<p>Based on jUnit 5, the test classes testing some behaviour. If sending and/or receiving functionality is used, consider extending <code>AbstractMqttTest</code> in order to avoid duplicate code. In case of extending this class, please order the methods according to their lifecycle, i.e.:
- createModel
- setupReceiverAndConnect
- communicateSendInitialValue
- communicateOnlyUpdatedValue
- closeConnections</p>
<p>Within <code>AbstractMqttTest</code>, an <code>MqttHandler</code> named <code>publisher</code> is available to publish content.
Some convenience methods are provided in <code>TestUtils</code>, e.g., the <code>DefaultMappings</code>, and <code>mqttUri</code> to prepend <code>"mqtt://"</code> and the correct host for the mqtt broker (<code>localhost</code> or a CI-specific host).
All tests are required to run both locally, and within the CI.</p>
<h3 id="buildgradle">build.gradle<a class="headerlink" href="#buildgradle" title="Permanent link"></a></h3>
<p>Use the <a href="https://git-st.inf.tu-dresden.de/jastadd/testing">PreprocessorPlugin</a>, the build process can be written concisely in three parts per task:</p>
<pre><code class="language-groovy">task compileTreeAllowedTokens(type: RagConnectTest) {
ragconnect {
outputDir = file('src/test/02-after-ragconnect/treeAllowedTokens')
inputFiles = [file('src/test/01-input/treeAllowedTokens/Test.relast'),
file('src/test/01-input/treeAllowedTokens/Test.connect'),
file('src/test/01-input/treeAllowedTokens/TestDependencies.connect')]
rootNode = 'Root'
}
relast {
useJastAddNames = true
grammarName = 'src/test/03-after-relast/treeAllowedTokens/treeAllowedTokens'
serializer = 'jackson'
}
jastadd {
jastAddList = 'JastAddList'
packageName = 'treeAllowedTokens.ast'
inputFiles = [file('src/test/01-input/treeAllowedTokens/Test.jadd')]
}
}
</code></pre>
</div>
</div>
<p>
<hr>
Built with <a href="https://www.mkdocs.org/">MkDocs</a> using a <a href="https://github.com/snide/sphinx_rtd_theme">theme</a> provided by <a href="https://readthedocs.org">Read the Docs</a>.
<small><br><i>Last updated <span class="git-revision-date-localized-plugin git-revision-date-localized-plugin-datetime">April 14, 2021 07:35:24</span></i></small>
</p>
</div>
</div>
</section>
</div>
<div class="rst-versions" role="note" aria-label="versions">
<span class="rst-current-version" data-toggle="rst-current-version">
<span><a href="../inner-workings/" style="color: #fcfcfc">&laquo; Previous</a></span>
<span><a href="../changelog/" style="color: #fcfcfc">Next &raquo;</a></span>
</span>
</div>
<script>var base_url = '..';</script>
<script src="../js/theme_extra.js" defer></script>
<script src="../js/theme.js" defer></script>
<script src="../search/main.js" defer></script>
<script src="../js/version-select.js" defer></script>
<script defer>
window.onload = function () {
SphinxRtdTheme.Navigation.enable(true);
};
</script>
</body>
</html>
File added
File added
File added
File added
File added
File added
File added
File added
File added
File added
File added
File added
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment