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

Extent SourceTask for check and format tasks. #146

Merged
merged 1 commit into from
Oct 9, 2018

Conversation

Tapchicoma
Copy link
Collaborator

Closes #85

Signed-off-by: Yahor Berdnikau <egorr.berd@gmail.com>
@JLLeitschuh
Copy link
Owner

Unfortunately, this is going to be an API breaking change, unless @bamboo,@wolfs, or @eskatos has any brilliant ideas as to how not to have this be an API breaking change.

@Tapchicoma
Copy link
Collaborator Author

If you are talking about this:

    @InputFiles
    @SkipWhenEmpty
    @PathSensitive(PathSensitivity.RELATIVE)
    override fun getSource(): FileTree { return super.getSource() }

I have to add it otherwise task becomes non-relocatable (not support caching).

Original getSource() method doesn't have any @PathSensitive annotation.

@JLLeitschuh
Copy link
Owner

JLLeitschuh commented Oct 9, 2018

@Tapchicoma Yea, I know. That's why I was asking for feedback.

Related: gradle/kotlin-dsl-samples#1026

Also, as pointed out by @eskatos, sources was internal before. So technically this wouldn't be an API breaking change.

"${dir.path}/**/*.$extension"
}
})
javaExecSpec.args(getSource())
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You're sure this works? We only lint the sources we're supposed to?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, this actually returns paths to kotlin files, not directories passed to task.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Check added init {} block that adds include filters to this source task. I assume internally it filters out all passed sources.

Copy link
Owner

@JLLeitschuh JLLeitschuh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me!

@Tapchicoma Tapchicoma merged commit 617987c into JLLeitschuh:master Oct 9, 2018
@Tapchicoma Tapchicoma deleted the use-source-task branch October 9, 2018 19:09
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.

None yet

2 participants