diff options
author | lhauch <lhauch@6f19259b-4bc3-4df7-8a09-765794883524> | 2008-12-31 16:26:40 +0000 |
---|---|---|
committer | lhauch <lhauch@6f19259b-4bc3-4df7-8a09-765794883524> | 2008-12-31 16:26:40 +0000 |
commit | 808def96aa4589fba9c2d0ea55837754a3b7a4f7 (patch) | |
tree | 0ea221c59abb2474c694e7ab5bd61006be77e47e /Tools/Java/Source/GenBuild/org/tianocore/build/toolchain/ConfigReader.java | |
parent | 9216450d1143056a50a5f916984a2d7faf590488 (diff) | |
download | edk2-platforms-808def96aa4589fba9c2d0ea55837754a3b7a4f7.tar.xz |
Retiring the ANT/JAVA build and removing the older EDK II packages that required ANT/JAVA.
Last Ant/Java build was r7166
Developers requiring the Java/Ant packages should checkout the branch from:
https://edk2.tianocore.org/svn/edk2/branches/AntJava
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@7168 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'Tools/Java/Source/GenBuild/org/tianocore/build/toolchain/ConfigReader.java')
-rw-r--r-- | Tools/Java/Source/GenBuild/org/tianocore/build/toolchain/ConfigReader.java | 114 |
1 files changed, 0 insertions, 114 deletions
diff --git a/Tools/Java/Source/GenBuild/org/tianocore/build/toolchain/ConfigReader.java b/Tools/Java/Source/GenBuild/org/tianocore/build/toolchain/ConfigReader.java deleted file mode 100644 index 4275f8eb78..0000000000 --- a/Tools/Java/Source/GenBuild/org/tianocore/build/toolchain/ConfigReader.java +++ /dev/null @@ -1,114 +0,0 @@ -/** @file
- ConfigReader class.
-
- ConfigReader is used to read tool chain config file with flat format.
-
-Copyright (c) 2006, Intel Corporation
-All rights reserved. This program and the accompanying materials
-are licensed and made available under the terms and conditions of the BSD License
-which accompanies this distribution. The full text of the license may be found at
-http://opensource.org/licenses/bsd-license.php
-
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-**/
-package org.tianocore.build.toolchain;
-
-import org.apache.tools.ant.Project;
-
-import org.tianocore.build.exception.GenBuildException;
-
-import java.io.BufferedReader;
-import java.io.File;
-import java.io.FileReader;
-import java.util.ArrayList;
-import java.util.List;
-
-/**
-
- ConfigReader is used to read tool chain config file with flat format. Comments
- is line starting with character '#'.
-
- @since GenBuild 1.0
-**/
-public class ConfigReader {
-
- /**
- Parse specified tool chain definition file.
-
- @param filename The config file name with full path
-
- @return String[][] The definition array
- **/
- public static synchronized String[][] parse(Project prj, String filename) throws GenBuildException {
- return parse(prj, new File(filename));
- }
-
- /**
- Get all definitions in config file. the config file format is flat
- with "A=B". If line started with '#' looks as comments.
-
- @param configFile The config file
-
- @return String[][] The variables defined in the config file
-
- @throws GenBuildException
- Config file's format is not valid
- **/
- public static synchronized String[][] parse(Project prj, File configFile) throws GenBuildException {
- List<String> keyList = new ArrayList<String>(256);
- List<String> valueList = new ArrayList<String>(256);
- int lines = 0;
-
- try {
- FileReader reader = new FileReader(configFile);
- BufferedReader in = new BufferedReader(reader);
- String str;
-
- while ((str = in.readLine()) != null) {
- ++lines;
- str = str.trim();
- //
- // skip empty line, comment (start with '#')
- //
- if (str.length() == 0 || str.startsWith("#")) {
- continue;
- }
-
- //
- // stop if the definition line is not in "name=value" form
- //
- int index;
- if ((index = str.indexOf('=')) <= 0) {
- throw new GenBuildException("ERROR Processing file ["
- + configFile.getAbsolutePath()
- + "] (line " + lines + ").\n");
- }
-
- //
- // look as line "A = B"
- //
- keyList.add(str.substring(0, index).trim());
- if (prj != null) {
- valueList.add(prj.replaceProperties(str.substring(index + 1).trim()));
- } else {
- valueList.add(str.substring(index + 1).trim());
- }
- }
- } catch (Exception ex) {
- GenBuildException e = new GenBuildException("ERROR Processing file ["
- + configFile.getAbsolutePath()
- + "] (line " + lines + ").\n" + ex.getMessage());
- e.setStackTrace(ex.getStackTrace());
- throw e;
- }
-
- String[][] definitions = new String[2][keyList.size()];
- definitions[0] = (String[])keyList.toArray(definitions[0]);
- definitions[1] = (String[])valueList.toArray(definitions[1]);
-
- return definitions;
- }
-}
-
-
|