From 91abd0b04320a9c9d932df195aca38c1cacfcc5a Mon Sep 17 00:00:00 2001 From: Trygve Laugstøl Date: Wed, 3 Feb 2021 16:08:50 +0100 Subject: Moving TemplateEngine to shared API. --- .run/ninja.run.xml | 18 ++++++++++++++ module/acme-planner/classpath.txt | 1 + module/acme/classpath.txt | 1 + module/ri-base/classpath.txt | 1 + module/ri-base/pom.xml | 29 +++------------------- .../io/trygvis/rules/engine/TemplateEngine.java | 10 -------- module/ri-engine/classpath.txt | 6 +++++ module/ri-engine/pom.xml | 6 +++++ .../main/java/io/trygvis/rules/engine/Engine.java | 2 -- .../io/trygvis/rules/engine/TemplateEngine.java | 14 ----------- .../io/trygvis/rules/engine/TemplateLoader.java | 7 ++++++ module/ri-module-api/classpath.txt | 23 +++++++++++++++++ module/ri-module-api/pom.xml | 16 ++++++++++++ .../io/trygvis/rules/engine/TemplateEngine.java | 10 ++++++++ module/ri-wireguard/classpath.txt | 1 + pom.xml | 2 ++ 16 files changed, 95 insertions(+), 52 deletions(-) create mode 100644 .run/ninja.run.xml delete mode 100644 module/ri-base/src/main/java/io/trygvis/rules/engine/TemplateEngine.java delete mode 100644 module/ri-engine/src/main/java/io/trygvis/rules/engine/TemplateEngine.java create mode 100644 module/ri-engine/src/main/java/io/trygvis/rules/engine/TemplateLoader.java create mode 100644 module/ri-module-api/classpath.txt create mode 100644 module/ri-module-api/pom.xml create mode 100644 module/ri-module-api/src/main/java/io/trygvis/rules/engine/TemplateEngine.java diff --git a/.run/ninja.run.xml b/.run/ninja.run.xml new file mode 100644 index 0000000..a7b68ab --- /dev/null +++ b/.run/ninja.run.xml @@ -0,0 +1,18 @@ + + + + + + + \ No newline at end of file diff --git a/module/acme-planner/classpath.txt b/module/acme-planner/classpath.txt index 0d4a2e7..411ee43 100644 --- a/module/acme-planner/classpath.txt +++ b/module/acme-planner/classpath.txt @@ -24,6 +24,7 @@ commons-io:commons-io:2.8.0:jar commons-net:commons-net:3.3:jar info.picocli:picocli:4.6.1:jar io.trygvis.rules-sandbox:ri-engine:1.0-SNAPSHOT:jar +io.trygvis.rules-sandbox.module:ri-module-api:1.0-SNAPSHOT:jar jakarta.activation:jakarta.activation-api:1.2.2:jar jakarta.xml.bind:jakarta.xml.bind-api:2.3.3:jar org.antlr:antlr-runtime:3.5.2:jar diff --git a/module/acme/classpath.txt b/module/acme/classpath.txt index 96576c4..e544c09 100644 --- a/module/acme/classpath.txt +++ b/module/acme/classpath.txt @@ -7,6 +7,7 @@ com.thoughtworks.xstream:xstream:1.4.14:jar commons-codec:commons-codec:1.14:jar commons-io:commons-io:2.8.0:jar io.trygvis.rules-sandbox.module:ri-base:1.0-SNAPSHOT:jar +io.trygvis.rules-sandbox.module:ri-module-api:1.0-SNAPSHOT:jar io.trygvis.rules-sandbox.module:ri-wireguard:1.0-SNAPSHOT:jar org.antlr:antlr-runtime:3.5.2:jar org.drools:drools-canonical-model:7.48.0.Final:jar diff --git a/module/ri-base/classpath.txt b/module/ri-base/classpath.txt index 1461d46..d5370b2 100644 --- a/module/ri-base/classpath.txt +++ b/module/ri-base/classpath.txt @@ -6,6 +6,7 @@ com.github.javaparser:javaparser-core:3.13.10:jar com.thoughtworks.xstream:xstream:1.4.14:jar commons-codec:commons-codec:1.14:jar commons-io:commons-io:2.8.0:jar +io.trygvis.rules-sandbox.module:ri-module-api:1.0-SNAPSHOT:jar org.antlr:antlr-runtime:3.5.2:jar org.drools:drools-canonical-model:7.48.0.Final:jar org.drools:drools-compiler:7.48.0.Final:jar diff --git a/module/ri-base/pom.xml b/module/ri-base/pom.xml index aca4f26..119368c 100644 --- a/module/ri-base/pom.xml +++ b/module/ri-base/pom.xml @@ -22,34 +22,11 @@ com.fasterxml.jackson.core jackson-databind - - - org.junit.jupiter - junit-jupiter-api - 5.7.0 - test - - org.junit.jupiter - junit-jupiter-params - 5.7.0 - test - - - org.junit.platform - junit-platform-commons - 1.7.0 - test + ${project.groupId} + ri-module-api + ${project.version} - - - - org.kie - kie-maven-plugin - - - - diff --git a/module/ri-base/src/main/java/io/trygvis/rules/engine/TemplateEngine.java b/module/ri-base/src/main/java/io/trygvis/rules/engine/TemplateEngine.java deleted file mode 100644 index eafa6e4..0000000 --- a/module/ri-base/src/main/java/io/trygvis/rules/engine/TemplateEngine.java +++ /dev/null @@ -1,10 +0,0 @@ -package io.trygvis.rules.engine; - -import java.io.IOException; -import java.util.Map; - -public interface TemplateEngine { - void clean(); - - void template(String name, String output, Map params) throws IOException; -} diff --git a/module/ri-engine/classpath.txt b/module/ri-engine/classpath.txt index ce43f01..f01f5f8 100644 --- a/module/ri-engine/classpath.txt +++ b/module/ri-engine/classpath.txt @@ -6,6 +6,7 @@ com.fasterxml.jackson.core:jackson-annotations:2.12.0:jar com.fasterxml.jackson.core:jackson-core:2.12.0:jar com.fasterxml.jackson.core:jackson-databind:2.12.0:jar com.fasterxml.jackson.dataformat:jackson-dataformat-yaml:2.12.0:jar +com.github.javaparser:javaparser-core:3.13.10:jar com.github.virtuald:curvesapi:1.06:jar com.google.code.findbugs:annotations:3.0.1:jar com.google.errorprone:error_prone_annotations:2.1.3:jar @@ -20,6 +21,7 @@ commons-codec:commons-codec:1.14:jar commons-io:commons-io:2.8.0:jar commons-net:commons-net:3.3:jar info.picocli:picocli:4.6.1:jar +io.trygvis.rules-sandbox.module:ri-module-api:1.0-SNAPSHOT:jar org.antlr:antlr-runtime:3.5.2:jar org.apache.commons:commons-collections4:4.4:jar org.apache.commons:commons-compress:1.19:jar @@ -31,13 +33,17 @@ org.apache.poi:poi-ooxml-schemas:4.1.2:jar org.apache.xmlbeans:xmlbeans:3.1.0:jar org.checkerframework:checker-compat-qual:2.0.0:jar org.codehaus.mojo:animal-sniffer-annotations:1.14:jar +org.drools:drools-canonical-model:7.48.0.Final:jar org.drools:drools-compiler:7.48.0.Final:jar org.drools:drools-core:7.48.0.Final:jar org.drools:drools-core-dynamic:7.48.0.Final:jar org.drools:drools-core-reflective:7.48.0.Final:jar org.drools:drools-decisiontables:7.48.0.Final:jar org.drools:drools-ecj:7.48.0.Final:jar +org.drools:drools-model-compiler:7.48.0.Final:jar org.drools:drools-mvel:7.48.0.Final:jar +org.drools:drools-mvel-compiler:7.48.0.Final:jar +org.drools:drools-mvel-parser:7.48.0.Final:jar org.drools:drools-templates:7.48.0.Final:jar org.javassist:javassist:3.24.1-GA:jar org.jsoup:jsoup:1.10.3:jar diff --git a/module/ri-engine/pom.xml b/module/ri-engine/pom.xml index 01a72cc..a2307f0 100644 --- a/module/ri-engine/pom.xml +++ b/module/ri-engine/pom.xml @@ -18,6 +18,12 @@ + + ${project.groupId}.module + ri-module-api + ${project.version} + + io.trygvis.rules-sandbox.module ri-base diff --git a/module/ri-engine/src/main/java/io/trygvis/rules/engine/Engine.java b/module/ri-engine/src/main/java/io/trygvis/rules/engine/Engine.java index 46a3302..f2247d3 100644 --- a/module/ri-engine/src/main/java/io/trygvis/rules/engine/Engine.java +++ b/module/ri-engine/src/main/java/io/trygvis/rules/engine/Engine.java @@ -23,8 +23,6 @@ import java.nio.charset.StandardCharsets; import java.util.ArrayList; import java.util.List; -import static io.trygvis.rules.engine.TemplateEngine.TemplateLoader; - public class Engine implements Closeable { @SuppressWarnings("FieldCanBeLocal") private final Logger logger = LoggerFactory.getLogger(getClass()); diff --git a/module/ri-engine/src/main/java/io/trygvis/rules/engine/TemplateEngine.java b/module/ri-engine/src/main/java/io/trygvis/rules/engine/TemplateEngine.java deleted file mode 100644 index e3199d9..0000000 --- a/module/ri-engine/src/main/java/io/trygvis/rules/engine/TemplateEngine.java +++ /dev/null @@ -1,14 +0,0 @@ -package io.trygvis.rules.engine; - -import java.io.IOException; -import java.util.Map; - -public interface TemplateEngine { - void clean(); - - void template(String name, String output, Map params) throws IOException; - - interface TemplateLoader { - String load(String name) throws IOException; - } -} diff --git a/module/ri-engine/src/main/java/io/trygvis/rules/engine/TemplateLoader.java b/module/ri-engine/src/main/java/io/trygvis/rules/engine/TemplateLoader.java new file mode 100644 index 0000000..9441264 --- /dev/null +++ b/module/ri-engine/src/main/java/io/trygvis/rules/engine/TemplateLoader.java @@ -0,0 +1,7 @@ +package io.trygvis.rules.engine; + +import java.io.IOException; + +interface TemplateLoader { + String load(String name) throws IOException; +} diff --git a/module/ri-module-api/classpath.txt b/module/ri-module-api/classpath.txt new file mode 100644 index 0000000..1f0f0a6 --- /dev/null +++ b/module/ri-module-api/classpath.txt @@ -0,0 +1,23 @@ +io.trygvis.rules-sandbox.module:ri-module-api:1.0-SNAPSHOT:jar +com.github.javaparser:javaparser-core:3.13.10:jar +com.thoughtworks.xstream:xstream:1.4.14:jar +commons-codec:commons-codec:1.14:jar +commons-io:commons-io:2.8.0:jar +org.antlr:antlr-runtime:3.5.2:jar +org.drools:drools-canonical-model:7.48.0.Final:jar +org.drools:drools-compiler:7.48.0.Final:jar +org.drools:drools-core:7.48.0.Final:jar +org.drools:drools-core-dynamic:7.48.0.Final:jar +org.drools:drools-core-reflective:7.48.0.Final:jar +org.drools:drools-ecj:7.48.0.Final:jar +org.drools:drools-model-compiler:7.48.0.Final:jar +org.drools:drools-mvel-compiler:7.48.0.Final:jar +org.drools:drools-mvel-parser:7.48.0.Final:jar +org.kie:kie-api:7.48.0.Final:jar +org.kie:kie-internal:7.48.0.Final:jar +org.kie:kie-memory-compiler:7.48.0.Final:jar +org.kie.soup:kie-soup-maven-support:7.48.0.Final:jar +org.kie.soup:kie-soup-xstream:7.48.0.Final:jar +org.slf4j:slf4j-api:1.7.30:jar +xmlpull:xmlpull:1.1.3.1:jar +xpp3:xpp3_min:1.1.4c:jar diff --git a/module/ri-module-api/pom.xml b/module/ri-module-api/pom.xml new file mode 100644 index 0000000..118b5ba --- /dev/null +++ b/module/ri-module-api/pom.xml @@ -0,0 +1,16 @@ + + + 4.0.0 + + + io.trygvis.rules-sandbox.module + ri-module-parent + 1.0-SNAPSHOT + ../ri-module-parent/pom.xml + + + ri-module-api + + diff --git a/module/ri-module-api/src/main/java/io/trygvis/rules/engine/TemplateEngine.java b/module/ri-module-api/src/main/java/io/trygvis/rules/engine/TemplateEngine.java new file mode 100644 index 0000000..eafa6e4 --- /dev/null +++ b/module/ri-module-api/src/main/java/io/trygvis/rules/engine/TemplateEngine.java @@ -0,0 +1,10 @@ +package io.trygvis.rules.engine; + +import java.io.IOException; +import java.util.Map; + +public interface TemplateEngine { + void clean(); + + void template(String name, String output, Map params) throws IOException; +} diff --git a/module/ri-wireguard/classpath.txt b/module/ri-wireguard/classpath.txt index af74a64..ef1b057 100644 --- a/module/ri-wireguard/classpath.txt +++ b/module/ri-wireguard/classpath.txt @@ -7,6 +7,7 @@ com.thoughtworks.xstream:xstream:1.4.14:jar commons-codec:commons-codec:1.14:jar commons-io:commons-io:2.8.0:jar io.trygvis.rules-sandbox.module:ri-base:1.0-SNAPSHOT:jar +io.trygvis.rules-sandbox.module:ri-module-api:1.0-SNAPSHOT:jar org.antlr:antlr-runtime:3.5.2:jar org.drools:drools-canonical-model:7.48.0.Final:jar org.drools:drools-compiler:7.48.0.Final:jar diff --git a/pom.xml b/pom.xml index ab5682c..2f062f1 100644 --- a/pom.xml +++ b/pom.xml @@ -80,6 +80,7 @@ module/acme module/acme-planner module/ri-engine + module/ri-module-api @@ -89,6 +90,7 @@ module/ri-base + module/ri-module-api module/ri-module-parent module/ri-wireguard -- cgit v1.2.3