Closed tprochazka closed 4 years ago
It should work fine as long as GPP is applied after the maven plugin.
Maven plugin is applied directly inside of my plugin, which is applied before GPP plugin. It looks like this
plugins {
my-plugin
gpp
}
and in this situation, it crashes
But when I do the same with
apply my-plugin
appy gpp
it works.
Sadly I need to make it work also with plugins
, since this is now suggested way.
Maybe plugins not preserve apply order :-(
Yeah, looks like the order isn't being preserved. Either way, there's not much GPP can do. You can do something like this: https://docs.gradle.org/current/userguide/plugins.html#sec:subprojects_plugins_dsl. Add GPP with apply false, then immediately apply the plugin manually below.
Hmm, it looks that "apply false" make sense only if you want to declare plugin in parent gradle file, but then apply them only in some of the submodules.
But you should be able to do this:
plugins {
my-plugin
gpp apply false
}
apply(plugin=gpp)
Yes. This works. I tried it before, but I had bad syntax there :-( Thanks. But I was expected that they solved possible dependency between two plugins in some better way :-( Or there should be a way how to write a plugin to be independent on the other plugin order.
Yeah, it'd be nice if they had a built-in way of distinguishing tasks from each plugin.
It is probably not directly a bug inside of the published plugin. But when I use in my application project default Gradle publish plugin PublishingHelper.PublishPlugin.MAVEN_PUBLISH to upload APK to maven artifactory. It then cause that I can't use published plugin, because it crash on this error
An interesting fact is that it happens only when I'm using
plugins {}
syntax. On the project where I still using old goodapply
. I work OK. Or maybe publish plugin just override my publish mechanism to artifactory. I did not try it.So I'm basically just asking if it is a good idea that plugin adding this task again when it already existing. And if it is possible to simply use the existing one and only depend on it. I mean that "publish" task will doo both things then. Publish to artifactory and also to the play.