inductiveautomation / ignition-module-tools

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

'signModule.signed' does not support lazy evaluation #50

Closed benmusson closed 3 months ago

benmusson commented 3 months ago

Goal: I would like to lazily access the output file produced by the signModule task.

val releaseFiles: Configuration by configurations.creating {
    isCanBeConsumed = true
    isCanBeResolved = false
}

afterEvaluate {
    artifacts.add(releaseFiles.name, tasks.signModule.flatMap { it.signed })
}

Error Recieved:

> Querying the mapped value of task ':modules:charts:signModule' property 'unsigned' before task ':modules:charts:zipModule' has completed is not supported

I believe there is something wrong with the dependency chain of the signed property, causing it to prematurely stop between the zipModule and signModule tasks.

benmusson commented 3 months ago

Suggested fix: https://github.com/inductiveautomation/ignition-module-tools/pull/51

benmusson commented 3 months ago

This repo demonstrates the issue: https://github.com/benmusson/ignition-module-tools-issue50

With v0.3.0:

PS D:\Projects\Ignition Modules\ignition-module-tools-issue50> ./gradlew printSignedModulePath      
Configuration on demand is an incubating feature.
Type-safe project accessors is an incubating feature.

FAILURE: Build failed with an exception.

* What went wrong:
A problem occurred configuring root project 'ignition-module-tools-issue50'.
> Could not create task ':printSignedModulePath'.
   > Querying the mapped value of map(task ':signModule' property 'unsigned') before task ':zipModule' has completed is not supported

With https://github.com/inductiveautomation/ignition-module-tools/pull/51:

PS D:\Projects\Ignition Modules\ignition-module-tools-issue50> ./gradlew printSignedModulePath
Configuration on demand is an incubating feature.
Type-safe project accessors is an incubating feature.
D:\Projects\Ignition Modules\ignition-module-tools-issue50\build\ignition-module-tools-issue50.modl

BUILD SUCCESSFUL in 1s
4 actionable tasks: 1 executed, 3 up-to-date
brianeray commented 3 months ago

For internal tracking: IGN-10611.

brianeray commented 3 months ago

Fixed by #55.