-
Notifications
You must be signed in to change notification settings - Fork 270
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
Support multi-plugin project #17
Comments
Hi Alexander, How do you think this should work? I've found it's a bit tricky to use the proposed strategy because prepareSandbox from multiple plugins pointed at the same folder seems to blow away the depended on plugin (I am no gradle expert so maybe I configure the dependency wrong). I was looking into how we could define it in the context of this plugin and was wondering what the best model might be. At first I thought allowing e.g.
Thoughts? |
Hi Patrick, The point of suggested strategy is that if you have several plugin sub-project, then prepareSandbox tasks will populate shared sandbox directory with plugins from each module. And I think it should work in 0.0.29 version (I've published it a moment ago) I don't think it will work for projects that depend on other plugin-subprojects. Do you really need this? As for 'junit' and 'Groovy' plugin dependencies, please take a look at readme, you can attach it with intellij.plugins ['junit', 'Groovy'] |
Hey Alexander, Thanks for getting back to me. The 0.0.29 update does fix the issue of the plugin sub-projects cleaning out the full sandbox directory so that you couldn't effectively share the same directory across dependent plugin sub-projects for running. Thanks! I did see you can declare the intellij sdk packaged plugins as deps using This works fine. I was just wondering, if you eventually support multiple plugin sub-projects with dependencies between them, how you would declare those dependencies in the build.gradle. We've used the normal Java deps way of My initial snippet (from my first comment) is a suggestion to add a special intellij plugin dep configuration, and if you did so you could also move your intellij.plugins declaration to use the same mechanism. But really any way to fix the problem including being able to declare sub-project deps in the intellij extension would be welcome. Thanks again for working on this plugin! It's exactly what we needed. |
I see. Well, I think I can handle it too. And if I fail, I'll try to implement the custom syntax you suggested. Give me couple more days and I'll return to this. Thank you for feedback. I'm very glad that you're using this plugin. Actually I didn't expect that someone will use it until its "official" announcement or until documentation is published :) |
Ha! Sorry about that. If you build it, they will come. :) You're addressing a pressing need for us. |
I've updated how to use this new setup for importing into IntelliJ. Due to an issue with how intellij does import you unfortunately have to revert the imports changes to .idea after import to get the preconfigured runconfiguration. There's also a couple ugly hacks to support multi-plugin projects which will be fixed when JetBrains/intellij-platform-gradle-plugin#17 is fixed in a few days.
I've updated how to use this new setup for importing into IntelliJ. Due to an issue with how intellij does import you unfortunately have to revert the imports changes to .idea after import to get the preconfigured runconfiguration. There's also a couple ugly hacks to support multi-plugin projects which will be fixed when JetBrains/intellij-platform-gradle-plugin#17 is fixed in a few days.
FYI one thing to keep in mind is how to deal with the third party classes exported in a Plugin API. Without an explicit Gradle provided scope it's tricky not to accidentally package those jars with the client plugin, which would cause the same classloader issues as bundling the dependent plugin jar in the client plugin package. |
I've updated how to use this new setup for importing into IntelliJ. Due to an issue with how intellij does import you unfortunately have to revert the imports changes to .idea after import to get the preconfigured runconfiguration. There's also a couple ugly hacks to support multi-plugin projects which will be fixed when JetBrains/intellij-platform-gradle-plugin#17 is fixed in a few days.
I've updated how to use this new setup for importing into IntelliJ. Due to an issue with how intellij does import you unfortunately have to revert the imports changes to .idea after import to get the preconfigured runconfiguration. There's also a couple ugly hacks to support multi-plugin projects which will be fixed when JetBrains/intellij-platform-gradle-plugin#17 is fixed in a few days.
I've updated how to use this new setup for importing into IntelliJ. Due to an issue with how intellij does import you unfortunately have to revert the imports changes to .idea after import to get the preconfigured runconfiguration. There's also a couple ugly hacks to support multi-plugin projects which will be fixed when JetBrains/intellij-platform-gradle-plugin#17 is fixed in a few days.
I've updated how to use this new setup for importing into IntelliJ. Due to an issue with how intellij does import you unfortunately have to revert the imports changes to .idea after import to get the preconfigured runconfiguration. There's also a couple ugly hacks to support multi-plugin projects which will be fixed when JetBrains/intellij-platform-gradle-plugin#17 is fixed in a few days.
Please try 0.0.31. Now all dependency projects that looks like intellij plugins and its dependencies won't be included in target distribution |
@patflynn hi! How is it going? Does 0.0.31 version works for you? |
@zolotov I've tried this on our project, and it does look as though our plugin dep is no longer bundled into the lib, however the shared dependencies are still there. Without an explicit way to declare which third party libraries are exported as part of the dependent plugin API, it's not clear to me how you would know what not to package. |
@patflynn And who provides these libraries in runtime? A 'parent' plugin? Please describe a simple project layout to recreate the issue and I'll try to handle it. |
@patflynn I see that you worked it around with following code:
It seems that I can do the same in plugin. Let's say that we use only runtime and compile dependencies for distribution. What do you think? |
Makes sense to me. It's a shame that gradle doesn't have provided as a On Mon, Nov 30, 2015 at 5:52 PM, Alexander Zolotov <notifications@github.com
|
@patflynn but the question is still open. How user's IDE will get |
The simplified scenario is this: Plugin B: Plugin A: For Plugin A to compile it needs to include C.jar on it's compile The way we addressed this is by removing C.jar from Plugin A's library and This is not a robust solution but it works, and I'm not aware of any On Tue, Dec 1, 2015 at 10:33 AM, Alexander Zolotov <notifications@github.com
|
That's right.
Sure, if B plugin has C.jar in its /lib directory and A depends on B, then classes from C.jar will be available in A. Actually IDEA uses exactly the same classloader for B classes and classes from /lib/*.jars.
Offtopic: I've looked at gcloud intellij plugin and found some issues. First of all,
Also, the plugin depends on Git4Idea and this is quite strange for gcloud plugin. I think it could be better to have Git4Idea as an optional dependency. To do that just replace In the third. IDEA provides junit, commons-io and guava dependencies, no need to explicitly depend on them. |
Thank you for taking a look at our project, and sorry for the slow On Tue, Dec 1, 2015 at 1:25 PM, Alexander Zolotov notifications@github.com
|
@patflynn btw, gradle-intellij-plugin is able to add version to plugin.xml file (https://github.com/GoogleCloudPlatform/gcloud-intellij/blob/master/build.gradle#L57) |
Nice! |
It appears that @patflynn 's earlier issue - that @zolotov Any advice would be much appreciated, thanks! |
@aslo thanks, I'm sure I had a test for this, I'll take a look anyway. How exactly can I recreate this on Google Cloud Platform plugin? |
You can recreate by pulling the Thanks for taking a look! Let me know if you think there's something on our end that needs to change. |
@aslo cannot recreate, that's what I got on prepareSandbox task:
|
Or, I see, both of them should be available in sandbox. Recreated then |
Temporary fix was implemented in 0.1.10. The proper solution will come up with 0.2.0 |
Thanks for your help! I really appreciate it. |
Since The second way is to patch prepareSandbox task like this:
|
There is a workaround for that: use the same sandbox directory in each module and make :prepareSandbox tasks depend on each other. But this way requires a lot of non-obvious configuration. There should be a way to do it easier.
The text was updated successfully, but these errors were encountered: