From d0b6bbcaf3e30c9b16f39a2e5e93d4a80947fc5e Mon Sep 17 00:00:00 2001 From: mischuma Date: Mon, 31 Aug 2020 13:49:34 +0200 Subject: [PATCH 1/7] #1211 Set next development version --- cobigen/cobigen-tsplugin/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cobigen/cobigen-tsplugin/pom.xml b/cobigen/cobigen-tsplugin/pom.xml index 7d694a3c18..ce4a769bcf 100644 --- a/cobigen/cobigen-tsplugin/pom.xml +++ b/cobigen/cobigen-tsplugin/pom.xml @@ -2,7 +2,7 @@ 4.0.0 tsplugin CobiGen - TypeScript Plug-in - 2.4.4 + 2.4.5-SNAPSHOT jar CobiGen - TypeScript Plug-in From f21b44e3f265979c582777b742f61cb0392a71d2 Mon Sep 17 00:00:00 2001 From: Malte Brunnlieb Date: Wed, 9 Sep 2020 23:47:09 +0200 Subject: [PATCH 2/7] #1228 comply to new lazy loading plugin interface --- cobigen/cobigen-tsplugin/pom.xml | 6 +++--- .../tsplugin/TypeScriptPluginActivator.java | 20 +++++++++++++------ .../TypeScriptTriggerInterpreter.java | 3 +++ .../inputreader/TypeScriptInputReader.java | 10 +++++----- 4 files changed, 25 insertions(+), 14 deletions(-) diff --git a/cobigen/cobigen-tsplugin/pom.xml b/cobigen/cobigen-tsplugin/pom.xml index ce4a769bcf..66802ebbc8 100644 --- a/cobigen/cobigen-tsplugin/pom.xml +++ b/cobigen/cobigen-tsplugin/pom.xml @@ -26,12 +26,12 @@ com.devonfw.cobigen core-api - [6.1.2,) + [6.2.0-SNAPSHOT,) com.devonfw.cobigen core - [6.1.2,) + [6.2.0-SNAPSHOT,) provided @@ -50,7 +50,7 @@ com.devonfw.cobigen core-test - 5.0.0 + [6.2.0-SNAPSHOT,) test diff --git a/cobigen/cobigen-tsplugin/src/main/java/com/devonfw/cobigen/tsplugin/TypeScriptPluginActivator.java b/cobigen/cobigen-tsplugin/src/main/java/com/devonfw/cobigen/tsplugin/TypeScriptPluginActivator.java index ee043596bc..8bcb702818 100644 --- a/cobigen/cobigen-tsplugin/src/main/java/com/devonfw/cobigen/tsplugin/TypeScriptPluginActivator.java +++ b/cobigen/cobigen-tsplugin/src/main/java/com/devonfw/cobigen/tsplugin/TypeScriptPluginActivator.java @@ -2,27 +2,35 @@ import java.util.List; +import com.devonfw.cobigen.api.annotation.Activation; import com.devonfw.cobigen.api.extension.GeneratorPluginActivator; import com.devonfw.cobigen.api.extension.Merger; import com.devonfw.cobigen.api.extension.TriggerInterpreter; +import com.devonfw.cobigen.tsplugin.inputreader.TypeScriptInputReader; import com.devonfw.cobigen.tsplugin.merger.TypeScriptMerger; import com.google.common.collect.Lists; /** * TypeScript Plug-in Activator to be registered in the PluginRegistry of CobiGen. */ +@Activation(byFileExtension = { TypeScriptInputReader.VALID_EXTENSION }, + byMergeStrategy = { TypeScriptPluginActivator.TSMERGE, TypeScriptPluginActivator.TSMERGE_OVERRIDE }) public class TypeScriptPluginActivator implements GeneratorPluginActivator { - - /** - * Defines the trigger type - */ + + /** Merger type for typescript files (prefer patch) */ + static final String TSMERGE_OVERRIDE = "tsmerge_override"; + + /** Merger type for typescript files (prefer base) */ + static final String TSMERGE = "tsmerge"; + + /** Defines the trigger type */ private static final String TRIGGER_TYPE = "typescript"; @Override public List bindMerger() { List merger = Lists.newLinkedList(); - merger.add(new TypeScriptMerger("tsmerge", false)); - merger.add(new TypeScriptMerger("tsmerge_override", true)); + merger.add(new TypeScriptMerger(TSMERGE, false)); + merger.add(new TypeScriptMerger(TSMERGE_OVERRIDE, true)); return merger; } diff --git a/cobigen/cobigen-tsplugin/src/main/java/com/devonfw/cobigen/tsplugin/TypeScriptTriggerInterpreter.java b/cobigen/cobigen-tsplugin/src/main/java/com/devonfw/cobigen/tsplugin/TypeScriptTriggerInterpreter.java index 75d8b0967b..4955c3c6f1 100644 --- a/cobigen/cobigen-tsplugin/src/main/java/com/devonfw/cobigen/tsplugin/TypeScriptTriggerInterpreter.java +++ b/cobigen/cobigen-tsplugin/src/main/java/com/devonfw/cobigen/tsplugin/TypeScriptTriggerInterpreter.java @@ -1,7 +1,9 @@ package com.devonfw.cobigen.tsplugin; +import com.devonfw.cobigen.api.annotation.ReaderPriority; import com.devonfw.cobigen.api.extension.InputReader; import com.devonfw.cobigen.api.extension.MatcherInterpreter; +import com.devonfw.cobigen.api.extension.Priority; import com.devonfw.cobigen.api.extension.TriggerInterpreter; import com.devonfw.cobigen.tsplugin.inputreader.TypeScriptInputReader; import com.devonfw.cobigen.tsplugin.matcher.TypeScriptMatcher; @@ -9,6 +11,7 @@ /** * {@link TriggerInterpreter} implementation of a Swagger Interpreter */ +@ReaderPriority(Priority.LOW) public class TypeScriptTriggerInterpreter implements TriggerInterpreter { /** diff --git a/cobigen/cobigen-tsplugin/src/main/java/com/devonfw/cobigen/tsplugin/inputreader/TypeScriptInputReader.java b/cobigen/cobigen-tsplugin/src/main/java/com/devonfw/cobigen/tsplugin/inputreader/TypeScriptInputReader.java index cccd19611f..0034a80ffa 100644 --- a/cobigen/cobigen-tsplugin/src/main/java/com/devonfw/cobigen/tsplugin/inputreader/TypeScriptInputReader.java +++ b/cobigen/cobigen-tsplugin/src/main/java/com/devonfw/cobigen/tsplugin/inputreader/TypeScriptInputReader.java @@ -35,6 +35,9 @@ */ public class TypeScriptInputReader implements InputReader { + /** Valid file extension */ + public static final String VALID_EXTENSION = "ts"; + /** Logger instance. */ private static final Logger LOG = LoggerFactory.getLogger(TypeScriptInputReader.class); @@ -135,9 +138,6 @@ public boolean isValidInput(Object input) { response = br.readLine(); return Boolean.parseBoolean(response); - } catch (NullPointerException e) { - return false; - } catch (IOException e) { connectionExc.handle(e); } @@ -282,8 +282,8 @@ public Object read(Path path, Charset inputCharset, Object... additionalArgument } @Override - public Boolean isMostLikelyReadable(Path path) { - return isValidInput(path); + public boolean isMostLikelyReadable(Path path) { + return path.toFile().isFile() && path.getFileName().endsWith("." + VALID_EXTENSION); } /** From 171880df25c49d80182ee5608f41622d2387284a Mon Sep 17 00:00:00 2001 From: Malte Brunnlieb Date: Wed, 9 Sep 2020 23:57:34 +0200 Subject: [PATCH 3/7] #1228 fix tests --- .../cobigen/tsplugin/inputreader/TypeScriptInputReader.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cobigen/cobigen-tsplugin/src/main/java/com/devonfw/cobigen/tsplugin/inputreader/TypeScriptInputReader.java b/cobigen/cobigen-tsplugin/src/main/java/com/devonfw/cobigen/tsplugin/inputreader/TypeScriptInputReader.java index 0034a80ffa..fb837b0db8 100644 --- a/cobigen/cobigen-tsplugin/src/main/java/com/devonfw/cobigen/tsplugin/inputreader/TypeScriptInputReader.java +++ b/cobigen/cobigen-tsplugin/src/main/java/com/devonfw/cobigen/tsplugin/inputreader/TypeScriptInputReader.java @@ -283,7 +283,7 @@ public Object read(Path path, Charset inputCharset, Object... additionalArgument @Override public boolean isMostLikelyReadable(Path path) { - return path.toFile().isFile() && path.getFileName().endsWith("." + VALID_EXTENSION); + return path.toFile().isFile() && path.toString().endsWith("." + VALID_EXTENSION); } /** From 0513f256dec92936d42970f4ed73a8da2f1bfe37 Mon Sep 17 00:00:00 2001 From: Malte Brunnlieb Date: Thu, 10 Sep 2020 01:44:44 +0200 Subject: [PATCH 4/7] set new version to make compatibility recognition easier --- cobigen/cobigen-tsplugin/pom.xml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/cobigen/cobigen-tsplugin/pom.xml b/cobigen/cobigen-tsplugin/pom.xml index 66802ebbc8..4957c2b318 100644 --- a/cobigen/cobigen-tsplugin/pom.xml +++ b/cobigen/cobigen-tsplugin/pom.xml @@ -2,7 +2,7 @@ 4.0.0 tsplugin CobiGen - TypeScript Plug-in - 2.4.5-SNAPSHOT + 7.0.0-SNAPSHOT jar CobiGen - TypeScript Plug-in @@ -26,12 +26,12 @@ com.devonfw.cobigen core-api - [6.2.0-SNAPSHOT,) + [7.0.0-SNAPSHOT,) com.devonfw.cobigen core - [6.2.0-SNAPSHOT,) + [7.0.0-SNAPSHOT,) provided @@ -50,7 +50,7 @@ com.devonfw.cobigen core-test - [6.2.0-SNAPSHOT,) + [7.0.0-SNAPSHOT,) test From fe1c9013050d2d49d9d89c4be04813d6f8642a02 Mon Sep 17 00:00:00 2001 From: Malte Brunnlieb Date: Mon, 14 Sep 2020 15:38:26 +0200 Subject: [PATCH 5/7] set latest release version --- cobigen/cobigen-tsplugin/pom.xml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/cobigen/cobigen-tsplugin/pom.xml b/cobigen/cobigen-tsplugin/pom.xml index 4957c2b318..b25d2fac0d 100644 --- a/cobigen/cobigen-tsplugin/pom.xml +++ b/cobigen/cobigen-tsplugin/pom.xml @@ -26,12 +26,12 @@ com.devonfw.cobigen core-api - [7.0.0-SNAPSHOT,) + [7.0.0,) com.devonfw.cobigen core - [7.0.0-SNAPSHOT,) + [7.0.0,) provided @@ -50,7 +50,7 @@ com.devonfw.cobigen core-test - [7.0.0-SNAPSHOT,) + [7.0.0,) test From dc0e34366572915636375bf5ce8f97cdef0a35b7 Mon Sep 17 00:00:00 2001 From: Malte Brunnlieb Date: Mon, 14 Sep 2020 17:17:17 +0200 Subject: [PATCH 6/7] #1236 update wiki docs --- documentation/master-cobigen.asciidoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/documentation/master-cobigen.asciidoc b/documentation/master-cobigen.asciidoc index 8f4ef21ec7..44db78fd70 100644 --- a/documentation/master-cobigen.asciidoc +++ b/documentation/master-cobigen.asciidoc @@ -20,7 +20,7 @@ DISCLAIMER: All Cobigen plugins are compatible with the latest release of Devonf * CobiGen v6.1.2 * CobiGen - Java Plug-in v2.2.3 * CobiGen - XML Plug-in v4.2.0 -* CobiGen - TypeScript Plug-in v2.4.4 +* CobiGen - TypeScript Plug-in v7.0.0 * CobiGen - Property Plug-in v2.1.0 * CobiGen - Text Merger v2.1.0 * CobiGen - JSON Plug-in v2.1.0 From 7c9768ab52dde2c11856251745585ca9963e2b4e Mon Sep 17 00:00:00 2001 From: Malte Brunnlieb Date: Mon, 14 Sep 2020 17:17:25 +0200 Subject: [PATCH 7/7] #1236 Set release version --- cobigen/cobigen-tsplugin/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cobigen/cobigen-tsplugin/pom.xml b/cobigen/cobigen-tsplugin/pom.xml index b25d2fac0d..aaab698a16 100644 --- a/cobigen/cobigen-tsplugin/pom.xml +++ b/cobigen/cobigen-tsplugin/pom.xml @@ -2,7 +2,7 @@ 4.0.0 tsplugin CobiGen - TypeScript Plug-in - 7.0.0-SNAPSHOT + 7.0.0 jar CobiGen - TypeScript Plug-in