From 8432a9eee0f818804a13fd4bff1344eb620bb57b Mon Sep 17 00:00:00 2001 From: Brian Ray Date: Tue, 27 Aug 2024 14:19:57 -0700 Subject: [PATCH] IGN-10603 Clean up filename and required ignition version templates (#58) Plus massaged existing overlapping unit test fixtures to ensure they keep passing. --------- Co-authored-by: Paul Griffith <39345262+paul-griffith@users.noreply.github.com> --- generator/README.md | 4 ++-- generator/generator-core/README.md | 2 +- .../module/generator/data/ModuleGeneratorContext.kt | 3 +-- .../main/resources/templates/config/modlPluginConfig.groovy | 2 +- .../main/resources/templates/config/modlPluginConfig.kts | 2 +- .../kotlin/io/ia/sdk/gradle/modl/task/WriteModuleXmlTest.kt | 6 +++--- 6 files changed, 9 insertions(+), 10 deletions(-) diff --git a/generator/README.md b/generator/README.md index efa4177..b7f8cf2 100644 --- a/generator/README.md +++ b/generator/README.md @@ -3,9 +3,9 @@ Consists of two projects useful in generating the boilerplate structure for an Ignition module built using the Gradle build tool. -1. [Ignition Module Generator Core](https://github.com/inductiveautomation/ignition-module-tools/tree/master/generator/generator-core#readme) library for creating Ignition module skeletons. Written in Kotlin, usable in Kotlin, Java and other JVM languages via jar-based dependency available as Maven artifacts. +1. [Ignition Module Generator Core](generator-core/README.md): library for creating Ignition module skeletons. Written in Kotlin, usable in Kotlin, Java and other JVM languages via jar-based dependency available as Maven artifacts. -2. [Module Generator CLI](https://github.com/inductiveautomation/ignition-module-tools/tree/master/generator/generator-cli#readme) command line application which uses the generator library to provide a _command line interface_ (CLI) that can be used to create modules from your operating system's terminal/console. +2. [Module Generator CLI](generator-cli/README.md): command line application which uses the generator library to provide a _command line interface_ (CLI) that can be used to create modules from your operating system's terminal/console. ## Usage diff --git a/generator/generator-core/README.md b/generator/generator-core/README.md index 377905a..47b0444 100644 --- a/generator/generator-core/README.md +++ b/generator/generator-core/README.md @@ -6,7 +6,7 @@ A library for generating boilerplate folder/file structures for gradle-based Ign We've had requests to make it easier to get started with module development using Gradle. So when we started writing functional tests for -the [Gradle Module Plugin](https://github.com/inductiveautomation/ignition-module-tools/tree/master/gradle-module-plugin#readme) +the [Gradle Module Plugin](../../gradle-module-plugin) and realized that we were generating module projects, we decided to pull out the functions and make them an independent library. The result is a somewhat unpolished but functional codebase, owing to its roots as simple testing support. diff --git a/generator/generator-core/src/main/kotlin/io/ia/ignition/module/generator/data/ModuleGeneratorContext.kt b/generator/generator-core/src/main/kotlin/io/ia/ignition/module/generator/data/ModuleGeneratorContext.kt index 63490a9..d91834a 100644 --- a/generator/generator-core/src/main/kotlin/io/ia/ignition/module/generator/data/ModuleGeneratorContext.kt +++ b/generator/generator-core/src/main/kotlin/io/ia/ignition/module/generator/data/ModuleGeneratorContext.kt @@ -47,8 +47,7 @@ class ModuleGeneratorContext(override val config: GeneratorConfig) : GeneratorCo init { // initialize the values that will be injected into the template resource files replacements[MODULE_NAME.key] = config.moduleName - replacements[MODULE_FILENAME.key] = - "${config.moduleName.replace(" ", "-")}.modl" + replacements[MODULE_FILENAME.key] = config.moduleName.replace(" ", "-") replacements[MODULE_ID.key] = "${config.packageName}.$classPrefix" replacements[MODULE_CLASSNAME.key] = classPrefix replacements[PACKAGE_ROOT.key] = config.packageName diff --git a/generator/generator-core/src/main/resources/templates/config/modlPluginConfig.groovy b/generator/generator-core/src/main/resources/templates/config/modlPluginConfig.groovy index d33a351..bc82f44 100644 --- a/generator/generator-core/src/main/resources/templates/config/modlPluginConfig.groovy +++ b/generator/generator-core/src/main/resources/templates/config/modlPluginConfig.groovy @@ -22,7 +22,7 @@ ignitionModule { * the course of a major Ignition (7.9, 8.0, etc) version, except for when the Ignition Platform adds/changes APIs * used by the module. */ - requiredIgnitionVersion = "8.0.10" + requiredIgnitionVersion = rootProject.ext.sdk_version /* * This is a map of String: String, where the 'key' represents the fully qualified path to the project * (using gradle path syntax), and the value is the shorthand Scope string. diff --git a/generator/generator-core/src/main/resources/templates/config/modlPluginConfig.kts b/generator/generator-core/src/main/resources/templates/config/modlPluginConfig.kts index 090882a..7a2c0e2 100644 --- a/generator/generator-core/src/main/resources/templates/config/modlPluginConfig.kts +++ b/generator/generator-core/src/main/resources/templates/config/modlPluginConfig.kts @@ -25,7 +25,7 @@ ignitionModule { * the course of a major Ignition (7.9, 8.0, etc) version, except for when the Ignition Platform adds/changes APIs * used by the module. */ - requiredIgnitionVersion.set("8.1.11") + requiredIgnitionVersion.set(rootProject.ext.sdk_version) /* * This is a map of String: String, where the 'key' represents the fully qualified path to the project * (using gradle path syntax), and the value is the shorthand Scope string. diff --git a/gradle-module-plugin/src/functionalTest/kotlin/io/ia/sdk/gradle/modl/task/WriteModuleXmlTest.kt b/gradle-module-plugin/src/functionalTest/kotlin/io/ia/sdk/gradle/modl/task/WriteModuleXmlTest.kt index 5b1167c..aba2632 100644 --- a/gradle-module-plugin/src/functionalTest/kotlin/io/ia/sdk/gradle/modl/task/WriteModuleXmlTest.kt +++ b/gradle-module-plugin/src/functionalTest/kotlin/io/ia/sdk/gradle/modl/task/WriteModuleXmlTest.kt @@ -38,7 +38,7 @@ class WriteModuleXmlTest : BaseTest() { } } """, - "requiredIgnitionVersion = \"8.0.10\"" to + "requiredIgnitionVersion = rootProject.ext.sdk_version" to "requiredIgnitionVersion = \"8.3.0\"" ) @@ -72,7 +72,7 @@ class WriteModuleXmlTest : BaseTest() { } } """, - "requiredIgnitionVersion = \"8.0.10\"" to + "requiredIgnitionVersion = rootProject.ext.sdk_version" to "requiredIgnitionVersion = \"8.3.0\"" ) @@ -119,7 +119,7 @@ class WriteModuleXmlTest : BaseTest() { } } """, - "requiredIgnitionVersion = \"8.0.10\"" to + "requiredIgnitionVersion = rootProject.ext.sdk_version" to "requiredIgnitionVersion = \"8.3.0\"" )