Module Structure Project

Back a few months ago, one of the Ignition team demoed a project named GenerateModuleStructure that would go and generate the base module structure for you in your own namespace. This was in the Perspective Security Module Development Tea With Travis video. Was this project ever released and if so where can I get a copy of it?

+1 That would be amazing. I tried to update the namespace from one of the samples to build a simple module and it was less than fun.

It’s not quite ready for primetime, but @PerryAJ was working on a module skeleton CLI that’s along these lines:

1 Like

The module-tools Paul linked are definitely a work in progress, but they are pretty functional, with some caveats.

We’re nearing completion of the new module plugin, and then the generator will be updated with more complete support. The generator should work to get you a decent base structure, but currently has some limitations:

  1. it’s a tad out of date in terms of gradle version that gets used in the generated module skeletons
  2. it does not generate structures/support for perspective
  3. the CLI binary is very much a prototype that has limitations - some of which are due to GraalVM’s native image
  4. Not sure the kotlin buildscript or project support is quite ‘there’.

#2 is planned, but won’t happen until we’ve finished some internal work and have developed an ‘ideal’ structure and updated toolchain for perspective modules. The example perspective module we’ve published is functional, but we have some ideas for improvement that we’re working on internally that should improve the dev-test-debug cycle, as well as build speed. Once we’ve got that sorted, we’ll apply what we’ve learned to the generator, new module plugin, and examples. No ETA, prob end of summer if I had to guess.

Now that all said, feel free to try one or both, and don’t hesitate to open issues if you find problems and/or have ideas for improvements. While that repo hasn’t been the most active, it’s something we’re actively using internally, and (with the exception of the binary CLI tool, which is an experimental) plan to continue to improve and polish.

2 Likes

*Big asterisk here, I’m a big Maven noob and this is my first foray into gradle.

After building/publishing the plugin to Maven local, I was getting this error when building the generated project.

> Could not resolve all artifacts for configuration ':classpath'.
   > Could not find com.inductiveautomation.ignitionsdk:module-signer:0.0.1.ia.
     Searched in the following locations:
       - file:/C:/Users/Ben/.m2/repository/com/inductiveautomation/ignitionsdk/module-signer/0.0.1.ia/module-signer-0.0.1.ia.pom
       - https://plugins.gradle.org/m2/com/inductiveautomation/ignitionsdk/module-signer/0.0.1.ia/module-signer-0.0.1.ia.pom
     Required by:
         project : > io.ia.sdk.modl:io.ia.sdk.modl.gradle.plugin:0.1.0-SNAPSHOT-10 > io.ia.sdk:gradle-module-plugin:0.1.0-SNAPSHOT-10

Possible solution:
 - Declare repository providing the artifact, see the documentation at https://docs.gradle.org/current/userguide/declaring_repositories.html

To resolve, I added the following to settings.gradle.

pluginManagement {
    repositories {
        mavenLocal()
        gradlePluginPortal()
        maven {
            url 'https://nexus.inductiveautomation.com/repository/public'
        }
    }
}

Also under build.gradle, I needed to add an explicit plugin version to get it to resolve. (I think this is just an artifact of using a local repository?)

plugins {
    id "io.ia.sdk.modl" version "0.1.0-SNAPSHOT-10"
}
1 Like