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

Conversation

Projects
None yet
2 participants
@dwijnand
Copy link
Member

commented Jun 28, 2017

Fixes sbt/sbt#944

Forward port of
sbt/sbt@1e61b9a

Part of sbt/sbt#2384

@dwijnand dwijnand referenced this pull request Jun 28, 2017

Closed

Forward port (or not) changes in wip/old-1.0 #2384

0 of 4 tasks complete
@eed3si9n
Copy link
Member

left a comment

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

@dwijnand

This comment has been minimized.

Copy link
Member Author

commented Jun 29, 2017

You can evolve by just appending to the end.

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

@eed3si9n

This comment has been minimized.

Copy link
Member

commented Jun 29, 2017

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 some commits Jun 30, 2017

Drop sbt-houserules workarounds
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
Add option preserveExecutable to IO.copyFile and IO.copyDirectory
Fixes sbt/sbt#944

Modified forward port of
sbt/sbt@1e61b9a

Modified because it switches to using a CopyOptions contraband record
and overloading.
@dwijnand

This comment has been minimized.

Copy link
Member Author

commented Jun 30, 2017

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

@eed3si9n
Copy link
Member

left a comment

Perfect

@eed3si9n

This comment has been minimized.

Copy link
Member

commented Jun 30, 2017

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.

@eed3si9n eed3si9n merged commit 34c28cf into sbt:1.0 Jun 30, 2017

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details

@dwijnand dwijnand deleted the dwijnand:preserve-exec branch Jun 30, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.