Skip to content

Commit 8432a9e

Browse files
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>
1 parent a9f0a15 commit 8432a9e

6 files changed

Lines changed: 9 additions & 10 deletions

File tree

generator/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33
Consists of two projects useful in generating the boilerplate structure for an Ignition module built using the
44
Gradle build tool.
55

6-
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.
6+
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.
77

8-
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.
8+
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.
99

1010
## Usage
1111

generator/generator-core/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ A library for generating boilerplate folder/file structures for gradle-based Ign
66

77
We've had requests to make it easier to get started with module development using Gradle. So when we started writing
88
functional tests for
9-
the [Gradle Module Plugin](https://github.com/inductiveautomation/ignition-module-tools/tree/master/gradle-module-plugin#readme)
9+
the [Gradle Module Plugin](../../gradle-module-plugin)
1010
and realized that we were generating module projects, we decided to pull out the functions and make them an independent
1111
library. The result is a somewhat unpolished but functional codebase, owing to its roots as simple testing support.
1212

generator/generator-core/src/main/kotlin/io/ia/ignition/module/generator/data/ModuleGeneratorContext.kt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,7 @@ class ModuleGeneratorContext(override val config: GeneratorConfig) : GeneratorCo
4747
init {
4848
// initialize the values that will be injected into the template resource files
4949
replacements[MODULE_NAME.key] = config.moduleName
50-
replacements[MODULE_FILENAME.key] =
51-
"${config.moduleName.replace(" ", "-")}.modl"
50+
replacements[MODULE_FILENAME.key] = config.moduleName.replace(" ", "-")
5251
replacements[MODULE_ID.key] = "${config.packageName}.$classPrefix"
5352
replacements[MODULE_CLASSNAME.key] = classPrefix
5453
replacements[PACKAGE_ROOT.key] = config.packageName

generator/generator-core/src/main/resources/templates/config/modlPluginConfig.groovy

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ ignitionModule {
2222
* the course of a major Ignition (7.9, 8.0, etc) version, except for when the Ignition Platform adds/changes APIs
2323
* used by the module.
2424
*/
25-
requiredIgnitionVersion = "8.0.10"
25+
requiredIgnitionVersion = rootProject.ext.sdk_version
2626
/*
2727
* This is a map of String: String, where the 'key' represents the fully qualified path to the project
2828
* (using gradle path syntax), and the value is the shorthand Scope string.

generator/generator-core/src/main/resources/templates/config/modlPluginConfig.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ ignitionModule {
2525
* the course of a major Ignition (7.9, 8.0, etc) version, except for when the Ignition Platform adds/changes APIs
2626
* used by the module.
2727
*/
28-
requiredIgnitionVersion.set("8.1.11")
28+
requiredIgnitionVersion.set(rootProject.ext.sdk_version)
2929
/*
3030
* This is a map of String: String, where the 'key' represents the fully qualified path to the project
3131
* (using gradle path syntax), and the value is the shorthand Scope string.

gradle-module-plugin/src/functionalTest/kotlin/io/ia/sdk/gradle/modl/task/WriteModuleXmlTest.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ class WriteModuleXmlTest : BaseTest() {
3838
}
3939
}
4040
""",
41-
"requiredIgnitionVersion = \"8.0.10\"" to
41+
"requiredIgnitionVersion = rootProject.ext.sdk_version" to
4242
"requiredIgnitionVersion = \"8.3.0\""
4343
)
4444

@@ -72,7 +72,7 @@ class WriteModuleXmlTest : BaseTest() {
7272
}
7373
}
7474
""",
75-
"requiredIgnitionVersion = \"8.0.10\"" to
75+
"requiredIgnitionVersion = rootProject.ext.sdk_version" to
7676
"requiredIgnitionVersion = \"8.3.0\""
7777
)
7878

@@ -119,7 +119,7 @@ class WriteModuleXmlTest : BaseTest() {
119119
}
120120
}
121121
""",
122-
"requiredIgnitionVersion = \"8.0.10\"" to
122+
"requiredIgnitionVersion = rootProject.ext.sdk_version" to
123123
"requiredIgnitionVersion = \"8.3.0\""
124124
)
125125

0 commit comments

Comments
 (0)