I have a Rule based plugin and I’m trying to get properties of the War plugin from the convention but it’s not available in the general model space.
I want to create tasks conditionally on
- the war plugin being applied
- the WEB-INF dir contains some specific file “XYZ.xml”
In old style code I could have done something like
1. if (project.hasProperty('war')) { // do something }
2. project.convention.getPlugin(WarPluginConvention).webAppDir ... and then find a file
What’s the equivalent of this in the Rule based configuration model? Is the War plugin not setup yet to allow interactions with rule configured plugins? The closest I got was accessing the war task using a @Path(‘tasks.war’) kind of situation but I can’t find enough information from that task, also presumably the behavior is bad if the path doesn’t exist?
Ideally I would like to do something like
@Mutate createSomeWarBasedTask(.... params....) {
if ( hasWarPlugin() ) {
// do something
warPlugin.getAppDir().findSomeFile()...