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