Gradle in Action by Benjamin Muschko

Gradle in Action by Benjamin Muschko

Author:Benjamin Muschko [Unknown]
Language: eng
Format: epub, pdf
Publisher: Manning Publications


Listing 8.14. Registering and using an extension

Every task of your plugin has a property named conventionMapping. To be more specific, every task derived from DefaultTask owns this property. You use this property to assign the extension model values to a task’s input or output fields. By wrapping the extension model value into a closure, you lazily set these values. This means that the value is only calculated when the task is executed. To retrieve the values of a property stored in convention mapping, you’ll need to explicitly use getter methods, as shown in the next listing. Keep in mind that trying to access a field directly will result in a null value.



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.