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/Cpptasks/net/sf/antcontrib/cpptasks/compiler/AbstractProcessor.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/Cpptasks/net/sf/antcontrib/cpptasks/compiler/AbstractProcessor.java')
-rw-r--r-- | Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/compiler/AbstractProcessor.java | 129 |
1 files changed, 0 insertions, 129 deletions
diff --git a/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/compiler/AbstractProcessor.java b/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/compiler/AbstractProcessor.java deleted file mode 100644 index b6456d5e3e..0000000000 --- a/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/compiler/AbstractProcessor.java +++ /dev/null @@ -1,129 +0,0 @@ -/*
- *
- * Copyright 2002-2004 The Ant-Contrib project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package net.sf.antcontrib.cpptasks.compiler;
-import org.apache.tools.ant.types.Environment;
-/**
- * An abstract processor (compiler/linker) implementation.
- *
- * @author Curt Arnold
- */
-public abstract class AbstractProcessor implements Processor, Cloneable {
- /**
- * default bid for a file name that the processor recognizes but does not
- * process and does not want to fall through to the linker
- */
- public final static int DEFAULT_DISCARD_BID = 1;
- /**
- * default bid for a file name that the processor desires to process
- */
- public final static int DEFAULT_PROCESS_BID = 100;
- /**
- * Determines the identification of a command line processor by capture the
- * first line of its output for a specific command.
- *
- * @param command
- * array of command line arguments starting with executable
- * name. For example, { "cl" }
- * @param fallback
- * start of identifier if there is an error in executing the
- * command
- * @return identifier for the processor
- */
- protected static String getIdentifier(String[] command, String fallback) {
- String identifier = fallback;
- try {
- String[] cmdout = CaptureStreamHandler.run(command);
- if (cmdout.length > 0) {
- identifier = cmdout[0];
- }
- } catch (Throwable ex) {
- identifier = fallback + ":" + ex.toString();
- }
- return identifier;
- }
- private final String[] headerExtensions;
- private final String[] sourceExtensions;
- protected AbstractProcessor(String[] sourceExtensions,
- String[] headerExtensions) {
- this.sourceExtensions = (String[]) sourceExtensions.clone();
- this.headerExtensions = (String[]) headerExtensions.clone();
- }
- /**
- * Returns the bid of the processor for the file.
- *
- * @param inputFile
- * filename of input file
- * @return bid for the file, 0 indicates no interest, 1 indicates that the
- * processor recognizes the file but doesn't process it (header
- * files, for example), 100 indicates strong interest
- */
- public int bid(String inputFile) {
- String lower = inputFile.toLowerCase();
- for (int i = 0; i < sourceExtensions.length; i++) {
- if (lower.endsWith(sourceExtensions[i])) {
- return DEFAULT_PROCESS_BID;
- }
- }
- for (int i = 0; i < headerExtensions.length; i++) {
- if (lower.endsWith(headerExtensions[i])) {
- return DEFAULT_DISCARD_BID;
- }
- }
- return 0;
- }
- public Processor changeEnvironment(boolean newEnvironment, Environment env) {
- return this;
- }
- protected Object clone() throws CloneNotSupportedException {
- return super.clone();
- }
- public String[] getHeaderExtensions() {
- return (String[]) this.headerExtensions.clone();
- }
- abstract public String getIdentifier();
- /**
- * Gets the target operating system architecture
- *
- * @return String target operating system architecture
- */
- protected String getOSArch() {
- return System.getProperty("os.arch");
- }
- /**
- * Gets the target operating system name
- *
- * @return String target operating system name
- */
- protected String getOSName() {
- return System.getProperty("os.name");
- }
- public String[] getSourceExtensions() {
- return (String[]) this.sourceExtensions.clone();
- }
- /**
- * Returns true if the target operating system is Mac OS X or Darwin.
- *
- * @return boolean
- */
- protected boolean isDarwin() {
- String osName = getOSName();
- return "Mac OS X".equals(osName);
- }
- public final String toString() {
- return getIdentifier();
- }
-}
|