Quantcast
Channel: Gradle Forums - Latest posts
Viewing all articles
Browse latest Browse all 20435

Pass dynamic arguments to a plugin

$
0
0

All code in the apply(Project project) method of the plugin executes on the apply plugin: GreetingPlugin line, which includes the println, so you’re printing the message the line before you set greet.message.

You need to defer evaluation of your extension property until later. If the other plugin supports it, use Property<String> instead of just String. Otherwise, execute your code first in a task action (doFirst { }), a separate task, or as a last resort, afterEvaluate { }.


Viewing all articles
Browse latest Browse all 20435

Latest Images

Trending Articles



Latest Images