-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Give a meaningful error message when applying both 'cpp-application' & 'cpp-library' (or java
) in a script
#216
Comments
Thanks for reporting this. The intention is to apply one of the plugins at any time in a project. I rename the title of this issue to add a better error message for this scenario. |
Consider having the same messaging for |
java
) in a script
This is causing enough pain, we should address this now. |
I ended up going down a rabbit hole last week. The main issue is being able to catch when unwanted plugins are mixed together. Adding code to the plugin itself is a bit hacky and requires to modify all plugins to work. Also, applying the native plugin first then the Java plugin after succeeds given that JVM plugins use We can focus on just giving an improved messaging for native plugin mixing. Scoping the JVM plugins as well increase the code change and scenario to support. One thought while working on this is the plugin manager should probably take care of this restriction. I think it would nicely fall into the supporting work for improved metadata for plugins such as supported Gradle APIs and such. The use case we are trying to solve is declaring how plugins interact with each other. I'm not sure how we want to move forward. We could spike this as simply doing code changes to all the affected plugins and ignore any change to the plugin manager or we can lay down the minimal strategic work to improve the error message. |
The basic problem here is that multiple plugins are defining a main component, but not all of them declare that they are going to do so. A good fix would take steps towards addressing the basic problem, by adding the smallest amount of infrastructure for a plugin to declare this. This can be just enough to give a better error message. Later this can evolve to do better stuff. There are 2 approaches we could take:
|
Hi
When both 'cpp-executable' & 'cpp-library' plugins are applied in a gradle script, the build fails with
How to reproduce this failure
In the script subprojects\docs\src\samples\native-binaries\cpp\build.gradle, replace
by
and build the updated script.
The text was updated successfully, but these errors were encountered: