]> git.proxmox.com Git - mirror_edk2.git/blame - Tools/Source/GenBuild/org/tianocore/build/global/DpFileList.java
Fixed grammar in messages.
[mirror_edk2.git] / Tools / Source / GenBuild / org / tianocore / build / global / DpFileList.java
CommitLineData
878ddf1f 1/** @file\r
2This file is used to nest elements corresponding to DpFile\r
3\r
4Copyright (c) 2006, Intel Corporation\r
5All rights reserved. This program and the accompanying materials\r
6are licensed and made available under the terms and conditions of the BSD License\r
7which accompanies this distribution. The full text of the license may be found at\r
8http://opensource.org/licenses/bsd-license.php\r
9\r
10THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
11WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
12\r
13**/\r
14package org.tianocore.build.global;\r
15\r
16import java.util.ArrayList;\r
17import java.util.List;\r
18\r
196ad8d7 19import org.apache.tools.ant.DirectoryScanner;\r
20import org.apache.tools.ant.types.DataType;\r
21import org.apache.tools.ant.types.FileSet;\r
22\r
878ddf1f 23/**\r
24 DpFileList is a container of Dpfile at the point of ANT task/datatype\r
25 **/\r
196ad8d7 26public class DpFileList extends DataType {\r
878ddf1f 27 ///\r
28 /// Keep all the file names from all nested DpFile\r
29 ///\r
30 List<String> nameList = new ArrayList<String>();\r
31\r
32 /**\r
33 Empty constructor just in case\r
34 **/\r
35 public DpFileList() {\r
36 }\r
37\r
38 /**\r
39 Empty execute method of ANT task. ANT will call it even we don't need it.\r
40 **/\r
41 public void execute() {\r
42 }\r
43\r
44 /**\r
45 Standard add method of ANT task, for nested DpFile type of elements. It just\r
46 simply fetch the files list from DpFile and put them in its own nameList.\r
47\r
48 @param f a DpFile object which will be instantiated by ANT\r
49 **/\r
50 public void addConfiguredFile(DpFile f) {\r
51 this.nameList.addAll(f.getList());\r
52 }\r
196ad8d7 53\r
54 public void addConfiguredFileSet(FileSet fileSet) {\r
55 DirectoryScanner ds = fileSet.getDirectoryScanner(getProject());\r
56 String dir = fileSet.getDir(getProject()).getAbsolutePath();\r
57 String[] files = ds.getIncludedFiles();\r
58\r
59 for (int i = 0; i < files.length; ++i) {\r
60 nameList.add(dir + "/" + files[i]);\r
61 }\r
62 }\r
878ddf1f 63}\r
64\r