mbeddr / mps-gradle-plugin

Miscellaneous tasks that were found useful when building MPS-based projects with Gradle.
Other
14 stars 15 forks source link

Avoid eager resolving artifact in CreateDmg#jdkDependency #69

Open vlsi opened 4 years ago

vlsi commented 4 years ago

https://github.com/mbeddr/mps-gradle-plugin/blob/a4a8f3cf7204799e3cd9dd2e331c8f3692f65c0e/src/main/groovy/de/itemis/mps/gradle/CreateDmg.groovy#L55-L60

Gradle tasks should not perform artifact resolution at the configuration time as the task might even be non-required at all.

vlsi commented 4 years ago

Oh, it looks like the eager resolution is caused by the fact that the task wants to store File jdk property:

https://github.com/mbeddr/mps-gradle-plugin/blob/a4a8f3cf7204799e3cd9dd2e331c8f3692f65c0e/src/main/groovy/de/itemis/mps/gradle/CreateDmg.groovy#L19-L20

I guess it would make sense to use Property<File> (or RegularFile) API.

vlsi commented 4 years ago

What do you think if CreateDmg task (and the relevant others) were updated to use Property<...> APIs?

What do you think if the task was converted to Kotlin?