Skip to content
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

Make the sourceset recognized by IDE. #51

Open
wants to merge 12 commits into
base: user/sv/gradle-6.0.1-Support
Choose a base branch
from

Conversation

rcw3bb
Copy link

@rcw3bb rcw3bb commented Apr 22, 2020

On my first initial trial to use the original one on this branch with IntelliJ. The gosu sourceset was not recognized but the gradle does. This one makes IntelliJ happy.

I've added some a group name to all the tasks related to this plugin.

Also fixed some unit tests.

Any comments on this to be merged will be greatly appreciated.

@sadheeshv
Copy link
Contributor

Hi Ron,
First off, Thank you and Appreciate your work on this. I'd like to give you little bit background on what I'm trying to do here and understand what's your goal as well. I'm working on to upgrade this plugin to support gradle 6.0.1 and make it work on it on Gradle 6.0.1.
When have gone thru your changes, I got the following questions

  1. Make the sourceset recognized by IDE: Could you explain the problem clearly what exactly you are facing with IDE.
    8c31644
    Here it was changed javaBasePlugin to JavaPlugin, would like to understand the reason? After all this "javaBasePlugin" instance variable have not been used in the current code. It was used for older versions of gradle,( please look at the else block).
  2. Line #77 sourceSet.getJava().srcDir(gosuSourceSet.getGosu()); How this change helps. Could you spell it out.
  3. Group name can be added.
  4. If you need a plugin that works on Gradle 5.1.1 Please use the 0.3.14

@rcw3bb
Copy link
Author

rcw3bb commented Apr 23, 2020

Hi @sadheeshv,

Thank you for checking my PR.

For item 1,

When I use the plugin with IntelliJ the src/main/gosu and src/test/gosu were not recognized as a sourceset. To overcome it I still need to use the idea plugin just to make those recognized as a source set.

For the JavaBasePlugin, it seems to me that we are registering 2 java plugins (i.e. JavaPlugin and JavaBasePlugin). Where in reality we can just use the JavaPlugin itself just register it first in the GosuPlugin.

For item 2,

That line of code actually made IntelliJ recognized the src/main/gosu and src/test/gosu as a sourceset coming from gradle without using the idea plugin as a support. I tried a lot of different ways to make it work until this one.

Can you try the plugin without this PR with IntelliJ and observe the src/main/gosu and src/test/gosu? Then use this PR with IntelliJ - If you have time.

@DPUkyle
Copy link
Member

DPUkyle commented Apr 23, 2020

Recently I learned about this plugin: JetBrains/gradle-idea-ext-plugin

This should allow cleaner importation of projects using the "native" Tooling API.

@rcw3bb
Copy link
Author

rcw3bb commented Apr 23, 2020

Hi @DPUkyle, that is the idea plugin that I am talking about on my response to @sadheeshv. For me, why do I need a support plugin (i.e. like the idea plugin). If I can already make my plugin do it, it just showing the completeness of the plugin. Just like what the v0.3.10, it doesn't require any supplementary plugin to be used. I'm just returning its independence.

Does the PR breaks any behavior of the plugin? Or any test brokes?
Is there a better way to return the independence of the plugin (i.e. without using any supplementary plugin as v0.3.10)?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants