com.threerings.media.tile.bundle.tools
Class TileSetBundlerTask

java.lang.Object
  extended by org.apache.tools.ant.ProjectComponent
      extended by org.apache.tools.ant.Task
          extended by com.threerings.media.tile.bundle.tools.TileSetBundlerTask
All Implemented Interfaces:
Cloneable
Direct Known Subclasses:
DirectoryTileSetBundlerTask

public class TileSetBundlerTask
extends Task

Ant task for creating tilset bundles.


Field Summary
protected  File _config
           
protected  ArrayList<FileSet> _filesets
          A list of filesets that contain tileset bundle definitions.
protected  boolean _keepRawPngs
          Whether we should keep raw pngs rather than reencoding them in the bundle.
protected  File _mapfile
           
protected  boolean _uncompressed
          Whether we should keep the bundle jars uncompressed rather than zipped.
 
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
TileSetBundlerTask()
           
 
Method Summary
 void addFileset(FileSet set)
          Adds a nested <fileset> element.
protected  TileSetBundler createBundler()
          Create the bundler to use during creation.
protected  void ensureSet(Object value, String errmsg)
           
 void execute()
          Performs the actual work of the task.
protected  String getTargetPath(File fromDir, String path)
          Returns the target path in which our bundler will write the tile set.
 void setConfig(File config)
          Sets the path to the bundler configuration file that we'll use when creating the bundle.
 void setKeepRawPngs(boolean keep)
          Note whether we are supposed to use the raw png files directly in the bundle or try to re-encode them.
 void setMapfile(File mapfile)
          Sets the path to the tileset id mapping file we'll use when creating the bundle.
 void setUncompressed(boolean uncompressed)
          Note whether we are supposed to leave the jar uncompressed rather than the normal process of zipping it at maximum compression.
 
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

_config

protected File _config

_mapfile

protected File _mapfile

_filesets

protected ArrayList<FileSet> _filesets
A list of filesets that contain tileset bundle definitions.


_keepRawPngs

protected boolean _keepRawPngs
Whether we should keep raw pngs rather than reencoding them in the bundle.


_uncompressed

protected boolean _uncompressed
Whether we should keep the bundle jars uncompressed rather than zipped.

Constructor Detail

TileSetBundlerTask

public TileSetBundlerTask()
Method Detail

setConfig

public void setConfig(File config)
Sets the path to the bundler configuration file that we'll use when creating the bundle.


setMapfile

public void setMapfile(File mapfile)
Sets the path to the tileset id mapping file we'll use when creating the bundle.


addFileset

public void addFileset(FileSet set)
Adds a nested <fileset> element.


setKeepRawPngs

public void setKeepRawPngs(boolean keep)
Note whether we are supposed to use the raw png files directly in the bundle or try to re-encode them.


setUncompressed

public void setUncompressed(boolean uncompressed)
Note whether we are supposed to leave the jar uncompressed rather than the normal process of zipping it at maximum compression.


execute

public void execute()
             throws BuildException
Performs the actual work of the task.

Overrides:
execute in class Task
Throws:
BuildException

createBundler

protected TileSetBundler createBundler()
                                throws IOException
Create the bundler to use during creation.

Throws:
IOException

getTargetPath

protected String getTargetPath(File fromDir,
                               String path)
Returns the target path in which our bundler will write the tile set.


ensureSet

protected void ensureSet(Object value,
                         String errmsg)
                  throws BuildException
Throws:
BuildException