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 option preserveExecutable to IO.copyFile and IO.copyDirectory #53

Merged
merged 4 commits into from
Jun 30, 2017
Merged

Add option preserveExecutable to IO.copyFile and IO.copyDirectory #53

merged 4 commits into from
Jun 30, 2017

Conversation

dwijnand
Copy link
Member

Fixes sbt/sbt#944

Forward port of
sbt/sbt@1e61b9a

Part of sbt/sbt#2384

Copy link
Member

@eed3si9n eed3si9n left a comment

Choose a reason for hiding this comment

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

Default params made it impossible to evolve the old IO. We should learn from that and add overloads here.

@dwijnand
Copy link
Member Author

You can evolve by just appending to the end.

These methods have 3 optional booleans, how would you like to overload them?

@eed3si9n
Copy link
Member

def copy(sources: Traversable[(File, File)]): Set[File]
def copy(sources: Traversable[(File, File)], options: CopyOption): Set[File]
def copy(sources: Traversable[(File, File)],
      overwrite: Boolean,
      preserveLastModified: Boolean,
      preserveExecutable: Boolean): Set[File] 

where CopyOption is defined using Contraband.

dwijnand added 4 commits June 30, 2017 13:32
Look to be no longer necessary:

    > ++2.10.6
    [info] Setting Scala version to 2.10.6 on 2 projects.
    [info] Reapplying settings...
    [info] Set current project to IO Root (in build file:/d/sbt-io/)
    > show io/scalacOptions
    [info] * -encoding
    [info] * utf8
    [info] * -deprecation
    [info] * -feature
    [info] * -unchecked
    [info] * -Xlint
    [info] * -language:higherKinds
    [info] * -language:implicitConversions
    [info] * -Xfuture
    [info] * -Yinline-warnings
    [info] * -Yno-adapted-args
    [info] * -Ywarn-dead-code
    [info] * -Ywarn-numeric-widen
    [info] * -Ywarn-value-discard
    [info] Total time: 0 s, completed 30-Jun-2017 12:37:08
Fixes sbt/sbt#944

Modified forward port of
sbt/sbt@1e61b9a

Modified because it switches to using a CopyOptions contraband record
and overloading.
@dwijnand
Copy link
Member Author

@eed3si9n Done, but I'm concerned about the impact it has on users migrating from sbt 0.13 to sbt 1... Lemme know.

Copy link
Member

@eed3si9n eed3si9n left a comment

Choose a reason for hiding this comment

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

Perfect

@eed3si9n
Copy link
Member

There might be some source breakages if ppl relied on the default params, but I think we did the best we can to make this evolvable, so I think it's an okay compromise.

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