2 * This file is ANT task VariableTask.
4 * VariableTask task implements part of ANT property task. The difference is
5 * this task will override variable with same name, but ANT property task do not.
7 * Copyright (c) 2006, Intel Corporation
8 * All rights reserved. This program and the accompanying materials
9 * are licensed and made available under the terms and conditions of the BSD License
10 * which accompanies this distribution. The full text of the license may be found at
11 * http://opensource.org/licenses/bsd-license.php
13 * THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
14 * WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
16 package org
.tianocore
.build
.global
;
18 import org
.apache
.tools
.ant
.BuildException
;
19 import org
.apache
.tools
.ant
.Task
;
22 * VariableTask task implements part of ANT property task. The difference is
23 * this task will override variable with same name, but ANT property task do not.
27 public class VariableTask
extends Task
{
42 * @param name property name
44 public void setName( String name
) {
52 * @param value property value
54 public void setValue( String value
) {
59 * ANT task's entry point, will be called after init().
61 * @exception BuildException
62 * If name or value is null
64 public void execute() throws BuildException
{
65 if (name
== null || value
== null) {
66 throw new BuildException("Name or value cannot be null.");
68 getProject().setProperty(name
, value
);