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

GosuCompile shouldn't rely on SourceTask.source field #47

Open
lptr opened this issue Sep 21, 2018 · 4 comments
Open

GosuCompile shouldn't rely on SourceTask.source field #47

lptr opened this issue Sep 21, 2018 · 4 comments

Comments

@lptr
Copy link

lptr commented Sep 21, 2018

In getSourceRoots() there is this code that refers to the source field from SourceTask:

    for(Object obj : this.source) {
      if(obj instanceof SourceDirectorySet) {
        returnValues.addAll(((SourceDirectorySet) obj).getSrcDirs());
      }
    }

The source field was exposed before as protected, but we are removing that in Gradle 5.0. Please use getSource() instead.

@DPUkyle
Copy link
Member

DPUkyle commented Sep 25, 2018

At first glance, I thought it was just sloppy programming. But there is a reason I originally accessed the field directly - I need the raw values, some of which are instances of SourceDirectorySet.

It's ugly but reflection might be the only solution 👎👎

@lptr
Copy link
Author

lptr commented Sep 25, 2018

Why do you need the SourceDirectorySet? Why does gosu need both the source directories and the sources themselves? Could you maybe calculate the source directories by observing the source files (and collecting common root dirs)?

@DPUkyle
Copy link
Member

DPUkyle commented Sep 25, 2018

Yes that can work. There are some complicating factors though; I'll be in touch via Slack.

@DPUkyle
Copy link
Member

DPUkyle commented Sep 25, 2018

See gradle/gradle#6845

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

No branches or pull requests

2 participants