企业🤖AI智能体构建引擎,智能编排和调试,一键部署,支持私有化部署方案 广告
# D.4 FileSet FileSets offer an easy and straightforward way to include files. The tag supports [Selectors](apg.html "Appendix G. Core selectors") and [PatternSets](apds06.html "D.6 PatternSet"). Additionally, you can include/exclude files in/from a fileset using the `<include>`/`<exclude>` tags. In patterns, one asterisk (`*`) maps to a part of a file/directory name within a directory level. Two asterisks (`**`) may include above the "border" of the directory separator. Table D.3:聽 Attributes for the `<fileset>` tag NameTypeDescriptionDefaultRequired`dir``String`The directory, the paths given in `include`/`exclude` are relative to.n/aYes`defaultexcludes``Boolean`Whether default exclusions should be used or not. Default excludes are: `*~`, `#*#`, `.#*`, `%*%`, `CVS`, `CVS/**`, `.cvsignore`, `SCCS`, `SCCS/**`, `vssver.scc`, `.svn`, `.svn/**`, `._*`, `.DS_Store`, `.darcs`, `.darcs/**`, `.git`, `.git/**`, `.gitattributes`, `.gitignore`, `.gitmodules` `true`No`casesensitive``Boolean`The case sensitivity of the file system.`true`No`expandsymboliclinks``Boolean`Whether to expand/dereference (follow) symbolic links - set to 'true' to emulate old Phing behavior.`false`No`erroronmissingdir``Boolean`Specify what happens if the base directory does not exist. If true a build error will happen, if false, the fileset will be ignored/empty.`false`No`includes``String`Comma- or space-separated list of patterns of files that must be included; all files are included when omitted.n/aNo`includesfile``String`The name of a file; each line of this file is taken to be an include pattern.n/aNo`excludes``String`comma- or space-separated list of patterns of files that must be excluded; no files (except default excludes) are excluded when omitted.n/aNo`excludesfile``String`The name of a file; each line of this file is taken to be an exclude pattern.n/aNo D.4.1 Using wildcards - `test*.xml` will include `test_42.xml`, but it will not include `test/some.xml`. - `test**.xml` fits to `test_42.xml` as well as to `test/bla.xml`, for example. - `**/*.ent.xml` fits to all files that end with `ent.xml` in all subdirectories of the directory specified with the `dir` attribute of the `<fileset>` tag. However, it will not include any files that are directly in the base directory of the file set. D.4.2 Usage Examples ``` <fileset dir="/etc" > <include name="httpd/**" /> <include name="php.ini" /> </fileset> <fileset dir="/etc" > <patternset> <include name="**/*.php"/> <exclude name="**/*Test*"/> </patternset> </fileset> ``` This will include the apache configuration and PHP configuration file from `/etc`. D.4.3 Nested tags The tags that are supported by `Fileset` are: - `include` - `exclude` - `patternset` - any of the [selectors](apg.html "Appendix G. Core selectors") The `<include>` and the `<exclude>` tags must have a `name` attribute that contains the pattern to include/exclude. D.4.4 Related types - [pearpackagefileset](apds08.html "D.8 PearPackageFileSet")