forked from FakeBuild/Xake
-
Notifications
You must be signed in to change notification settings - Fork 0
Reference | Filesets
Oleg edited this page Mar 30, 2017
·
2 revisions
Fileset represents the rules to collect list of files. Fileset is "materialized" on demand, the paths are resolved from a "root" folder defined as ProjectRoot in script settings.
There're several ways to define fileset. The most flexible and powerful one is to use fileset computation:
let sourceFiles = fileset {
// define common prefix for all subsequent instructions
basedir "src"
// includes individual file
includes "assemblyinfo.cs"
// includes files by mask
includes "lib/*.cs"
// includes all files in src and all nested folders
includes "src/**/*.cs"
// excludes file assemblyinfo.cs from all nested folders
excludes "**/assemblyinfo.cs"
// includes the files by mask if first argument evaluates to true
includesif NUNIT "test/**/*.cs"
// instructs build script to fail if fileset contains no files
failonempty true
// joins another fileset
join commonFiles
}Xake also provides several operators for manipulating filesets:
// create fileset from file mask
let sourceFiles = ls "src/*.cs"
// the same as
let sourceFiles = !! "src/*.cs"
// add files to fileset
let allSourceFiles = sourceFiles + "common/*.cs"
// set basedir "src"
let src = ls "*.cs" @@ "src"