package org.tianocore.build;\r
\r
import java.io.File;\r
-import java.util.Set;\r
\r
import org.apache.tools.ant.BuildException;\r
import org.apache.tools.ant.Project;\r
///\r
/// Current module's include pathes\r
///\r
- private Set<String> includes;\r
+ private String[] includes;\r
\r
///\r
/// Xml Document.\r
@param sourceFiles Modules source files\r
@param document XML document\r
**/\r
- public void init(Project project, Set<String> includes, Document document) {\r
+ public void init(Project project, String[] includes, Document document) {\r
this.document = document;\r
this.includes = includes;\r
this.project = project;\r
@param root Root node\r
**/\r
public synchronized void parseFile(String filename, Node root) throws BuildException {\r
- boolean flag = false;\r
for (int i = 0; i < fileTypes.length; i++) {\r
if (filename.endsWith(fileTypes[i][0])) {\r
- flag = true;\r
parseFile(filename, fileTypes[i][2], root);\r
+ return ;\r
}\r
}\r
- if (!flag) {\r
- throw new BuildException("File [" + filename + "] is not known from its suffix.");\r
- }\r
}\r
\r
/**\r
ele.setAttribute("FILEPATH", sourceFilepath);\r
ele.setAttribute("FILENAME", sourceFilename);\r
ele.setAttribute("FILEEXT", sourceFileext.substring(1));\r
- String[] includePaths = includes.toArray(new String[includes.size()]);\r
Element includesEle = document.createElement("EXTRA.INC");\r
- for (int i = 0; i < includePaths.length; i++) {\r
+ for (int i = 0; i < includes.length; i++) {\r
Element includeEle = document.createElement("includepath");\r
- includeEle.setAttribute("path", includePaths[i]);\r
+ includeEle.setAttribute("path", project.replaceProperties(includes[i]));\r
includesEle.appendChild(includeEle);\r
}\r
ele.appendChild(includesEle);\r