de.enough.polish.preverify
Class Preverifier

java.lang.Object
  extended by de.enough.polish.Extension
      extended by de.enough.polish.preverify.Preverifier
Direct Known Subclasses:
AntCallPreverifier, CldcPreverifier, NoPreverifier, ProGuardPreverifier

public abstract class Preverifier
extends Extension

Preverifies the project for a specific device.

Copyright Enough Software 2005 - 2011

Author:
Robert Virkus, j2mepolish@enough.de

Field Summary
static String BUILDCONTROL_PREVERIFIER_ENABLED
           
static String KEY_ENVIRONMENT
          Key for accessing the used preverifier in the Environment.
static String KEY_EXECUTABLE
          Key for accessing the executable in the Environment.
static String KEY_TARGET
          Key for accessing the preverify target directory in the Environment.
protected  File preverifyExecutable
          The executable of the WTK that preverifies the project.
 
Fields inherited from class de.enough.polish.Extension
antProject, autoStartCondition, environment, extensionDefinition, extensionManager, extensionSetting, extensionTypeDefinition, isBuildStarted
 
Constructor Summary
Preverifier()
          Creates a new preverifier
 
Method Summary
 void execute(Device device, Locale locale, Environment env)
          Executes this extension.
abstract  void preverify(Device device, File sourceDir, File targetDir, org.apache.tools.ant.types.Path bootClassPath, org.apache.tools.ant.types.Path classPath)
          Preverifies the classes for the target device.
 
Methods inherited from class de.enough.polish.Extension
configure, executeAntTarget, executeAntTarget, finalize, getAntProject, getAutoStartCondition, getEnvironment, getExtensionDefinition, getExtensionSetting, getInstance, getParameterValue, getType, init, initialize, isConditionFulfilled, notifyBuildEnd, notifyBuildStart
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

BUILDCONTROL_PREVERIFIER_ENABLED

public static final String BUILDCONTROL_PREVERIFIER_ENABLED
See Also:
Constant Field Values

KEY_ENVIRONMENT

public static final String KEY_ENVIRONMENT
Key for accessing the used preverifier in the Environment.

See Also:
Environment.get(String), Constant Field Values

KEY_EXECUTABLE

public static final String KEY_EXECUTABLE
Key for accessing the executable in the Environment.

See Also:
Environment.get(String), Constant Field Values

KEY_TARGET

public static final String KEY_TARGET
Key for accessing the preverify target directory in the Environment.

See Also:
Environment.get(String), Constant Field Values

preverifyExecutable

protected File preverifyExecutable
The executable of the WTK that preverifies the project. Beware: this can be null in the preverify( ... ) method!

Constructor Detail

Preverifier

public Preverifier()
Creates a new preverifier

Method Detail

execute

public void execute(Device device,
                    Locale locale,
                    Environment env)
             throws BuildException
Description copied from class: Extension
Executes this extension. Not all extension types are executed.

Specified by:
execute in class Extension
Parameters:
device - the current device
locale - the current locale, can be null
env - the environment/configuration
Throws:
BuildException - when the execution failed

preverify

public abstract void preverify(Device device,
                               File sourceDir,
                               File targetDir,
                               org.apache.tools.ant.types.Path bootClassPath,
                               org.apache.tools.ant.types.Path classPath)
                        throws IOException
Preverifies the classes for the target device.

Parameters:
device - the target device
sourceDir - the directory containing the class files
targetDir - the directory to which the preverfied class files should be written to
bootClassPath - the boot class path of the device
classPath - the class path of the device, null when the device does not support additional APIs
Throws:
IOException - when the process could not be executed