-
Notifications
You must be signed in to change notification settings - Fork 4
Tasks | Cp
Oleg edited this page May 14, 2017
·
5 revisions
Requires version 0.10.x
Copies individual files, folders and filesets to another location.
there's a
copy
alias forcp
.
Cp
task accepts settings of the CpArgs type:
type CpArgs = {
dir: string
file: string
files: Fileset
todir: string
flatten: bool
verbose: bool
overwrite: bool
dryrun: bool
}
Command is available via both common and simplified syntax:
open Xake.Tasks
...
do! Cp {CpArgs.Default with file = "bin/*.exe"; todir = "deploy"}
/// or simplified syntax:
do! cp {file "bin/*.exe"; todir "deploy"}
file
argument accepts file masks.
The following code will recursively copy the "bin" directory and its content to "deploy" directory preserving the folder structure:
do! cp {dir "bin"; todir "deploy"}
Note: this command will put "bin" under "deploy" like this "deploy/bin/***".
The following command will flatten the file list.
do! cp {dir "bin"; todir "deploy"; flatten}
flatten
is explicitly set totrue
iffile
is specified.
Using fileset is the most flexible way to define Copy
behavior.
do! cp {
files (fileset {
basedir "bin"
includes "*.exe"
})
todir "deploy"
}
In this case cp
also preserves the directory structure, using basedir
as a root of the structure.
- Creating simple script
- Running the first build
- What the rule and recipe is?
- Filesets defined
- Editing the script
- Configure your project and CI
- Defining filesets
- Recipe computation
- Declaring the rules
- Error handling and exceptions
- Script and environment settings
- Command line interface (CLI)
- Writing cross-platform scripts
- Build-in functions
- .NET tasks
- System tasks
- Other
- ...