inductiveautomation / ignition-module-tools

Tools that help in the creation and development of Modules for Inductive Automation's Ignition.
49 stars 12 forks source link

Added Development hostGateway Setting #29

Closed keith-gamble closed 2 years ago

keith-gamble commented 2 years ago

Currently the :deployModl task creates a hostGateway property that is not accessible by the end user. This pull requests adds the setting to the ModuleSettings.kt file, as well as the root.build.gradle default file so that the user can change it as well as see how it is used.

PerryAJ commented 2 years ago

Hi Keith,

Thanks for proposing this change, and for your patience. As mentioned on the forum thread when you submitted this PR, there are already idiomatic ways to configure these settings based on using task configuration. I'm going to post there here for future visitors:

Using the Kotlin DSL (build.gradle.kts), you can set the host url via:

// in the build.gradle.kts file where the module plugin is applied
tasks {
    withType<io.ia.sdk.gradle.modl.task.Deploy> {
        this.hostGateway.set("https://some.gateway.com:8099")
    }
}

In Groovy based buildscripts, it's similar, just slightly different syntax:

tasks.withType(io.ia.sdk.gradle.modl.task.Deploy).configureEach {
    hostGateway = "https://localhost:8088"
}

This pattern us effective with virtually any task.

I'm going to go ahead and close this for now, but have added documentation in how to use this task-based configuration in PR #32 .

Thanks again for your feedback and PR!