]>
git.proxmox.com Git - mirror_edk2.git/blob - Tools/Source/Cpptasks/net/sf/antcontrib/cpptasks/types/ConditionalPath.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
;
20 import net
.sf
.antcontrib
.cpptasks
.CUtil
;
22 import org
.apache
.tools
.ant
.BuildException
;
23 import org
.apache
.tools
.ant
.Project
;
24 import org
.apache
.tools
.ant
.types
.Path
;
26 * An Ant Path object augmented with if and unless conditionals
30 public class ConditionalPath
extends Path
{
31 private String ifCond
;
32 private String unlessCond
;
34 public ConditionalPath(Project project
) {
37 public ConditionalPath(Project p
, String path
) {
40 public File
getFile() {
44 * Returns true if the Path's if and unless conditions (if any) are
47 public boolean isActive(org
.apache
.tools
.ant
.Project p
)
48 throws BuildException
{
49 return CUtil
.isActive(p
, ifCond
, unlessCond
);
52 * Sets the property name for the 'if' condition.
54 * The path will be ignored unless the property is defined.
56 * The value of the property is insignificant, but values that would imply
57 * misinterpretation ("false", "no") will throw an exception when
63 public void setIf(String propName
) {
67 * Set the property name for the 'unless' condition.
69 * If named property is set, the path will be ignored.
71 * The value of the property is insignificant, but values that would imply
72 * misinterpretation ("false", "no") of the behavior will throw an
73 * exception when evaluated.
78 public void setUnless(String propName
) {
79 unlessCond
= propName
;
82 * Specifies the file which lists many include paths that should appear on
83 * the command line. Each line is an include path. The includepath will be
84 * quated if it contains embedded blanks.
89 public void setFile(File file
) {