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

Add T.source to listen to a single source file/folder #749

Merged
merged 2 commits into from
Dec 24, 2019
Merged

Conversation

lihaoyi
Copy link
Member

@lihaoyi lihaoyi commented Dec 24, 2019

#546

Largely copy-pasted from T.sources, with all the Seq-related stuff removed

Not super heavily tested, but I stuffed a single usage into JavacCompileJavaTests to make sure it at least gets some coverage. Seems to work.

Review by @lefou

@lihaoyi lihaoyi requested a review from lefou December 24, 2019 03:38
Copy link
Member

@lefou lefou left a comment

Choose a reason for hiding this comment

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

The change itself looks good to me, but I nowadays doubt we need it at all. Wouldn't T.input { PathRef(file) } do the same?

@lihaoyi
Copy link
Member Author

lihaoyi commented Dec 24, 2019

I guess it would, but it's a nice symmetry with T.sources. Apart from the existing Scala/Java rules, I find use cases for T.source much more common than T.sources. Often you're depending on a single file, or single folder, rather than an entire extensible-search-path of source folders or classpaths

T.source does some things where the path can be defined by an incoming task, copied from T.sources. I don't know if it's a good idea or not, but I figured I'd reproduce the behavior for consistency

@lefou
Copy link
Member

lefou commented Jan 6, 2020

We also need a documentation update to reflect the additional target type.

@lefou lefou deleted the T.source branch January 6, 2020 08:42
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.

2 participants