-
Notifications
You must be signed in to change notification settings - Fork 52
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #53 from dwijnand/preserve-exec
Add option preserveExecutable to IO.copyFile and IO.copyDirectory
- Loading branch information
Showing
7 changed files
with
147 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
/** | ||
* This code is generated using [[http://www.scala-sbt.org/contraband/ sbt-contraband]]. | ||
*/ | ||
|
||
// DO NOT EDIT MANUALLY | ||
package sbt.io | ||
/** The options for the copy operation in `IO`. */ | ||
final class CopyOptions private ( | ||
/** | ||
* A source file is always copied if `overwrite` is true. | ||
* If `overwrite` is false, the source is only copied if the target is missing or is older than the | ||
* source file according to last modified times. | ||
* If the source is a directory, the corresponding directory is created. | ||
*/ | ||
val overwrite: Boolean, | ||
/** If `true` the last modified times are copied. */ | ||
val preserveLastModified: Boolean, | ||
/** If `true` the executable properties are copied. */ | ||
val preserveExecutable: Boolean) extends Serializable { | ||
|
||
private def this() = this(false, false, true) | ||
|
||
override def equals(o: Any): Boolean = o match { | ||
case x: CopyOptions => (this.overwrite == x.overwrite) && (this.preserveLastModified == x.preserveLastModified) && (this.preserveExecutable == x.preserveExecutable) | ||
case _ => false | ||
} | ||
override def hashCode: Int = { | ||
37 * (37 * (37 * (37 * (17 + "CopyOptions".##) + overwrite.##) + preserveLastModified.##) + preserveExecutable.##) | ||
} | ||
override def toString: String = { | ||
"CopyOptions(" + overwrite + ", " + preserveLastModified + ", " + preserveExecutable + ")" | ||
} | ||
protected[this] def copy(overwrite: Boolean = overwrite, preserveLastModified: Boolean = preserveLastModified, preserveExecutable: Boolean = preserveExecutable): CopyOptions = { | ||
new CopyOptions(overwrite, preserveLastModified, preserveExecutable) | ||
} | ||
def withOverwrite(overwrite: Boolean): CopyOptions = { | ||
copy(overwrite = overwrite) | ||
} | ||
def withPreserveLastModified(preserveLastModified: Boolean): CopyOptions = { | ||
copy(preserveLastModified = preserveLastModified) | ||
} | ||
def withPreserveExecutable(preserveExecutable: Boolean): CopyOptions = { | ||
copy(preserveExecutable = preserveExecutable) | ||
} | ||
} | ||
object CopyOptions { | ||
|
||
def apply(): CopyOptions = new CopyOptions(false, false, true) | ||
def apply(overwrite: Boolean, preserveLastModified: Boolean, preserveExecutable: Boolean): CopyOptions = new CopyOptions(overwrite, preserveLastModified, preserveExecutable) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
package sbt.io | ||
@target(Scala) | ||
|
||
## The options for the copy operation in `IO`. | ||
type CopyOptions { | ||
|
||
## A source file is always copied if `overwrite` is true. | ||
## If `overwrite` is false, the source is only copied if the target is missing or is older than the | ||
## source file according to last modified times. | ||
## If the source is a directory, the corresponding directory is created. | ||
overwrite: boolean! = false @since("0.0.1") | ||
|
||
## If `true` the last modified times are copied. | ||
preserveLastModified: boolean! = false @since("0.0.1") | ||
|
||
## If `true` the executable properties are copied. | ||
preserveExecutable: boolean! = true @since("0.0.1") | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
addSbtPlugin("org.scala-sbt" % "sbt-houserules" % "0.3.3") | ||
addSbtPlugin("org.scala-sbt" % "sbt-contraband" % "0.3.0-M6") |