com.google.caja.tools
Class InnocentAntTask

java.lang.Object
  extended by org.apache.tools.ant.ProjectComponent
      extended by org.apache.tools.ant.Task
          extended by com.google.caja.tools.AbstractCajaAntTask
              extended by com.google.caja.tools.InnocentAntTask

public class InnocentAntTask
extends AbstractCajaAntTask

An ANT task that transforms a SINGLE file of innocent code. Given an ANT task like <innocent> <output file="foo/bar.js"/> <input file="baz/input1.js"/> </innocent> innocent code transforms the input. This is intended for uncajoled code that needs to interact with cajoled code. It removes protected elements from for-in loops and puts checks on methods that access THIS to make sure they don't accidentally refer to the global THIS.

A single <innocent> element can have multiple <job>s, but each <job> takes a single input/output file.

Author:
adriennefelt@gmail.com

Nested Class Summary
 
Nested classes/interfaces inherited from class com.google.caja.tools.AbstractCajaAntTask
AbstractCajaAntTask.FileGroup, AbstractCajaAntTask.Output
 
Field Summary
 
Fields inherited from class org.apache.tools.ant.Task
description, location, target, taskName, taskType, wrapper
 
Fields inherited from class org.apache.tools.ant.ProjectComponent
project
 
Constructor Summary
InnocentAntTask()
           
 
Method Summary
(package private)  AbstractCajaAntTask.Output makeOutput()
           
protected  boolean run(BuildService buildService, java.io.PrintWriter logger, java.util.List<java.io.File> depends, java.util.List<java.io.File> input, java.io.File output, java.util.Map<java.lang.String,java.lang.Object> options)
          Called to actually execute a job by invoking the BuildService.
 
Methods inherited from class com.google.caja.tools.AbstractCajaAntTask
createDepend, createInput, createOutput, execute, getBuildService, getLogger
 
Methods inherited from class org.apache.tools.ant.Task
getDescription, getLocation, getOwningTarget, getRuntimeConfigurableWrapper, getTaskName, getTaskType, getWrapper, handleErrorFlush, handleErrorOutput, handleFlush, handleInput, handleOutput, init, isInvalid, log, log, maybeConfigure, perform, reconfigure, setDescription, setLocation, setOwningTarget, setRuntimeConfigurableWrapper, setTaskName, setTaskType
 
Methods inherited from class org.apache.tools.ant.ProjectComponent
getProject, setProject
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

InnocentAntTask

public InnocentAntTask()
Method Detail

run

protected boolean run(BuildService buildService,
                      java.io.PrintWriter logger,
                      java.util.List<java.io.File> depends,
                      java.util.List<java.io.File> input,
                      java.io.File output,
                      java.util.Map<java.lang.String,java.lang.Object> options)
               throws org.apache.tools.ant.BuildException
Description copied from class: AbstractCajaAntTask
Called to actually execute a job by invoking the BuildService.

Specified by:
run in class AbstractCajaAntTask
Throws:
org.apache.tools.ant.BuildException

makeOutput

AbstractCajaAntTask.Output makeOutput()
Specified by:
makeOutput in class AbstractCajaAntTask


Copyright (C) 2008 Google Inc.
Licensed under the Apache License, Version 2.0