org.apache.hadoop.hive.ant
Class GetVersionPref

java.lang.Object
  extended by org.apache.tools.ant.ProjectComponent
      extended by org.apache.tools.ant.Task
          extended by org.apache.hadoop.hive.ant.GetVersionPref
All Implemented Interfaces:
Cloneable

public class GetVersionPref
extends org.apache.tools.ant.Task

Implementation of the ant task . This ant task takes an input version string (e.g. 0.17.2) and set an ant property (whose name is specified in the property attribute) with the version prefix. For 0.17.2, the version prefix is 0.17. Similarly, for 0.18.0, the version prefix is 0.18. The version prefix is the first two components of the version string.


Field Summary
protected  String input
          The input string that contains the version string.
protected  String property
          The name of the property that gets the version prefix.
 
Fields inherited from class org.apache.tools.ant.Task
target, taskName, taskType, wrapper
 
Fields inherited from class org.apache.tools.ant.ProjectComponent
description, location, project
 
Constructor Summary
GetVersionPref()
           
 
Method Summary
 void execute()
          Executes the ant task .
 String getInput()
           
 String getProperty()
           
 void setInput(String input)
           
 void setProperty(String property)
           
 
Methods inherited from class org.apache.tools.ant.Task
bindToOwner, getOwningTarget, getRuntimeConfigurableWrapper, getTaskName, getTaskType, getWrapper, handleErrorFlush, handleErrorOutput, handleFlush, handleInput, handleOutput, init, isInvalid, log, log, log, log, maybeConfigure, perform, reconfigure, setOwningTarget, setRuntimeConfigurableWrapper, setTaskName, setTaskType
 
Methods inherited from class org.apache.tools.ant.ProjectComponent
clone, getDescription, getLocation, getProject, setDescription, setLocation, setProject
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

property

protected String property
The name of the property that gets the version prefix.


input

protected String input
The input string that contains the version string.

Constructor Detail

GetVersionPref

public GetVersionPref()
Method Detail

setProperty

public void setProperty(String property)

getProperty

public String getProperty()

setInput

public void setInput(String input)

getInput

public String getInput()

execute

public void execute()
             throws org.apache.tools.ant.BuildException
Executes the ant task . It extracts the version prefix using regular expressions on the version string. It then sets the property in the project with the extracted prefix. The property is set to an empty string in case no match is found for the prefix regular expression (which will happen in case the version string does not conform to the version format).

Overrides:
execute in class org.apache.tools.ant.Task
Throws:
org.apache.tools.ant.BuildException


Copyright © 2013 The Apache Software Foundation