]> git.proxmox.com Git - mirror_edk2.git/blobdiff - Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/borland/BorlandProcessor.java
Retiring the ANT/JAVA build and removing the older EDK II packages that required...
[mirror_edk2.git] / Tools / Java / Source / Cpptasks / net / sf / antcontrib / cpptasks / borland / BorlandProcessor.java
diff --git a/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/borland/BorlandProcessor.java b/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/borland/BorlandProcessor.java
deleted file mode 100644 (file)
index d53f00c..0000000
+++ /dev/null
@@ -1,219 +0,0 @@
-/*\r
- * \r
- * Copyright 2002-2004 The Ant-Contrib project\r
- *\r
- *  Licensed under the Apache License, Version 2.0 (the "License");\r
- *  you may not use this file except in compliance with the License.\r
- *  You may obtain a copy of the License at\r
- *\r
- *      http://www.apache.org/licenses/LICENSE-2.0\r
- *\r
- *  Unless required by applicable law or agreed to in writing, software\r
- *  distributed under the License is distributed on an "AS IS" BASIS,\r
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
- *  See the License for the specific language governing permissions and\r
- *  limitations under the License.\r
- */\r
-package net.sf.antcontrib.cpptasks.borland;\r
-import java.io.BufferedReader;\r
-import java.io.File;\r
-import java.io.FileReader;\r
-import java.io.IOException;\r
-import java.io.Reader;\r
-import java.util.Vector;\r
-import java.io.FileWriter;\r
-\r
-import net.sf.antcontrib.cpptasks.CUtil;\r
-import net.sf.antcontrib.cpptasks.types.LibraryTypeEnum;\r
-/**\r
- * A add-in class for Borland(r) processor adapters\r
- * \r
- *  \r
- */\r
-public final class BorlandProcessor {\r
-    public static void addWarningSwitch(Vector args, int level) {\r
-        switch (level) {\r
-            case 0 :\r
-                args.addElement("-w-");\r
-                break;\r
-            case 5 :\r
-                args.addElement("-w!");\r
-                break;\r
-            default :\r
-                args.addElement("-w");\r
-                break;\r
-        }\r
-    }\r
-    public static String getCommandFileSwitch(String cmdFile) {\r
-        StringBuffer buf = new StringBuffer("@");\r
-        quoteFile(buf, cmdFile);\r
-        return buf.toString();\r
-    }\r
-    public static void getDefineSwitch(StringBuffer buffer, String define,\r
-            String value) {\r
-        buffer.append("-D");\r
-        buffer.append(define);\r
-        if (value != null && value.length() > 0) {\r
-            buffer.append('=');\r
-            buffer.append(value);\r
-        }\r
-    }\r
-    /**\r
-     * This method extracts path information from the appropriate .cfg file in\r
-     * the install directory.\r
-     * \r
-     * @param toolName\r
-     *            Tool name, for example, "bcc32", "brc32", "ilink32"\r
-     * @param switchChar\r
-     *            Command line switch character, for example "L" for libraries\r
-     * @param defaultRelativePaths\r
-     *            default paths relative to executable directory\r
-     * @return path\r
-     */\r
-    public static File[] getEnvironmentPath(String toolName, char switchChar,\r
-            String[] defaultRelativePath) {\r
-        if (toolName == null) {\r
-            throw new NullPointerException("toolName");\r
-        }\r
-        if (defaultRelativePath == null) {\r
-            throw new NullPointerException("defaultRelativePath");\r
-        }\r
-        String[] path = defaultRelativePath;\r
-        File exeDir = CUtil.getExecutableLocation(toolName + ".exe");\r
-        if (exeDir != null) {\r
-            File cfgFile = new File(exeDir, toolName + ".cfg");\r
-            if (cfgFile.exists()) {\r
-                try {\r
-                    Reader reader = new BufferedReader(new FileReader(cfgFile));\r
-                    BorlandCfgParser cfgParser = new BorlandCfgParser(\r
-                            switchChar);\r
-                    path = cfgParser.parsePath(reader);\r
-                    reader.close();\r
-                } catch (IOException ex) {\r
-                    //\r
-                    //  could be logged\r
-                    //\r
-                }\r
-            }\r
-        } else {\r
-            //\r
-            //  if can't find the executable,\r
-            //     assume current directory to resolve relative paths\r
-            //\r
-            exeDir = new File(System.getProperty("user.dir"));\r
-        }\r
-        int nonExistant = 0;\r
-        File[] resourcePath = new File[path.length];\r
-        for (int i = 0; i < path.length; i++) {\r
-            resourcePath[i] = new File(path[i]);\r
-            if (!resourcePath[i].isAbsolute()) {\r
-                resourcePath[i] = new File(exeDir, path[i]);\r
-            }\r
-            //\r
-            //  if any of the entries do not exist or are\r
-            //     not directories, null them out\r
-            if (!(resourcePath[i].exists() && resourcePath[i].isDirectory())) {\r
-                resourcePath[i] = null;\r
-                nonExistant++;\r
-            }\r
-        }\r
-        //\r
-        //  if there were some non-existant or non-directory\r
-        //    entries in the configuration file then\r
-        //    create a shorter array\r
-        if (nonExistant > 0) {\r
-            File[] culled = new File[resourcePath.length - nonExistant];\r
-            int index = 0;\r
-            for (int i = 0; i < resourcePath.length; i++) {\r
-                if (resourcePath[i] != null) {\r
-                    culled[index++] = resourcePath[i];\r
-                }\r
-            }\r
-            resourcePath = culled;\r
-        }\r
-        return resourcePath;\r
-    }\r
-    public static String getIncludeDirSwitch(String includeOption,\r
-            String includeDir) {\r
-        StringBuffer buf = new StringBuffer(includeOption);\r
-        quoteFile(buf, includeDir);\r
-        return buf.toString();\r
-    }\r
-    public static String[] getLibraryPatterns(String[] libnames, LibraryTypeEnum libType) {\r
-        StringBuffer buf = new StringBuffer();\r
-        String[] patterns = new String[libnames.length];\r
-        for (int i = 0; i < libnames.length; i++) {\r
-            buf.setLength(0);\r
-            buf.append(libnames[i]);\r
-            buf.append(".lib");\r
-            patterns[i] = buf.toString();\r
-        }\r
-        return patterns;\r
-    }\r
-    public static String[] getOutputFileSwitch(String outFile) {\r
-        return new String[0];\r
-    }\r
-    public static void getUndefineSwitch(StringBuffer buffer, String define) {\r
-        buffer.append("-U");\r
-        buffer.append(define);\r
-    }\r
-    public static boolean isCaseSensitive() {\r
-        return false;\r
-    }\r
-    private static void quoteFile(StringBuffer buf, String outPath) {\r
-        if (outPath.indexOf(' ') >= 0) {\r
-            buf.append('\"');\r
-            buf.append(outPath);\r
-            buf.append('\"');\r
-        } else {\r
-            buf.append(outPath);\r
-        }\r
-    }\r
-    \r
-    /**\r
-     * Prepares argument list to execute the linker using a response file.\r
-     * \r
-     * @param outputFile\r
-     *            linker output file\r
-     * @param args\r
-     *            output of prepareArguments\r
-     * @return arguments for runTask\r
-     */\r
-    public static String[] prepareResponseFile(File outputFile, \r
-               String[] args,\r
-                       String continuation)\r
-            throws IOException {\r
-        String baseName = outputFile.getName();\r
-        File commandFile = new File(outputFile.getParent(), baseName + ".lnk");\r
-        FileWriter writer = new FileWriter(commandFile);\r
-        for (int i = 1; i < args.length - 1; i++) {\r
-            writer.write(args[i]);\r
-            //\r
-            //  if either the current argument ends with\r
-            //     or next argument starts with a comma then\r
-            //      don't split the line\r
-            if (args[i].endsWith(",") || args[i + 1].startsWith(",")) {\r
-                writer.write(' ');\r
-            } else {\r
-                //\r
-                //  split the line to make it more readable\r
-                //\r
-                writer.write(continuation);\r
-            }\r
-        }\r
-        //\r
-        //  write the last argument\r
-        //\r
-        if (args.length > 1) {\r
-            writer.write(args[args.length - 1]);\r
-        }\r
-        writer.close();\r
-        String[] execArgs = new String[2];\r
-        execArgs[0] = args[0];\r
-        execArgs[1] = getCommandFileSwitch(commandFile.toString());\r
-        return execArgs;\r
-    }\r
-    \r
-    private BorlandProcessor() {\r
-    }\r
-}\r