]>
git.proxmox.com Git - mirror_edk2.git/blob - Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/types/CommandLineArgument.java
3 * Copyright 2001-2004 The Ant-Contrib project
5 * Licensed under the Apache License, Version 2.0 (the "License");
6 * you may not use this file except in compliance with the License.
7 * You may obtain a copy of the License at
9 * http://www.apache.org/licenses/LICENSE-2.0
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
17 package net
.sf
.antcontrib
.cpptasks
.types
;
19 import org
.apache
.tools
.ant
.types
.EnumeratedAttribute
;
22 * An compiler/linker command line flag.
24 public class CommandLineArgument
{
26 * Enumerated attribute with the values "start", "mid" and "end",
28 public static class LocationEnum
extends EnumeratedAttribute
{
29 public String
[] getValues() {
30 return new String
[]{"start", "mid", "end"};
33 private String ifCond
;
35 private String unlessCond
;
38 public CommandLineArgument() {
40 public int getLocation() {
43 public String
getValue() {
46 public File
getFile() {
50 * Returns true if the define's if and unless conditions (if any) are
53 public boolean isActive(org
.apache
.tools
.ant
.Project p
) {
57 if (ifCond
!= null && p
.getProperty(ifCond
) == null) {
59 } else if (unlessCond
!= null && p
.getProperty(unlessCond
) != null) {
65 * Sets the property name for the 'if' condition.
67 * The argument will be ignored unless the property is defined.
69 * The value of the property is insignificant, but values that would imply
70 * misinterpretation ("false", "no") will throw an exception when
73 public void setIf(String propName
) {
77 * Specifies relative location of argument on command line. "start" will
78 * place argument at start of command line, "mid" will place argument after
79 * all "start" arguments but before filenames, "end" will place argument
83 public void setLocation(LocationEnum location
) {
84 this.location
= location
.getIndex();
87 * Set the property name for the 'unless' condition.
89 * If named property is set, the argument will be ignored.
91 * The value of the property is insignificant, but values that would imply
92 * misinterpretation ("false", "no") of the behavior will throw an
93 * exception when evaluated.
98 public void setUnless(String propName
) {
99 unlessCond
= propName
;
102 * Specifies the string that should appear on the command line. The
103 * argument will be quoted if it contains embedded blanks. Use multiple
104 * arguments to avoid quoting.
107 public void setValue(String value
) {
111 * Specifies the file which lists many strings that should appear on
112 * the command line. Each line is one argument. The argument will be
113 * quated if it contains embedded blanks. Use multiple arguments in
114 * file to avoid quating.
119 public void setFile(File file
) {