
org.impalaframework.build.ant.UnlessPropertyTask Maven / Gradle / Ivy
The newest version!
/*
* Copyright 2007-2010 the original author or authors.
*
* 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 org.impalaframework.build.ant;
/**
* Task which which contains nested tasks, which will evaluate based on the
* presence of a property, or whether the property evaluates to a particular
* value.
*
*
* In the following example, 'Hi Phil' will only be printed out if you don't have a property myname
present
*
*
<target name = "unlessproperty"
* description="If property test">
* <unlessproperty property = "myname">
* <echo>Hi Phil</echo>
* </unlessproperty>
* </target>
*
*
*
* In the following example, 'Hi Phil' will only be printed out if you don't have a property myname
with a value of 'phil'
*
*
<target name = "unlessproperty"
* description="If property test">
* <unlessproperty property = "myname" equals = "phil">
* <echo>Hi Phil</echo>
* </unlessproperty>
* </target>
*
*
* @author Phil Zoio
*/
public class UnlessPropertyTask extends ConditionalPropertyTask {
@Override
protected boolean shouldExecute(boolean isTrue) {
return !isTrue;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy