Calling Zelix KlassMaster from a Build Tool
Zelix KlassMaster exposes a generic Java API that allows it to be called by a build tool.
We provide an Apache Ant plugin, an Apache Maven plugin and a Gradle plugin based upon this API.
The basic parameters to the run methods correspond to the basic command line options.
The idea is that the ZKM Script referred to will make use of System Variables that have been set in the System properties or which have been passed in as the extra properties.
You can also set Special Configuration Options by setting System properties.
Generic API
package com.zelix;
public class ZKM
public static void run(String zkmScriptFileName,
String logFileName,
boolean isVerbose,
boolean isParseOnly)
throws Exception
public static void run(String zkmScriptFileName,
String logFileName,
boolean isVerbose,
boolean isParseOnly,
Hashtable propertiesTable)
throws Exception
public static void run(String zkmScriptFileName,
String logFileName,
String trimLogFileName,
String defaultExcludeFileName,
String defaultTrimExcludeFileName,
String defaultMethodParameterChangesExcludeFileName,
String defaultMethodParameterObfuscationExcludeFileName,
String defaultDirectoryName,
boolean isVerbose,
boolean isParseOnly)
throws Exception
public static void run(String zkmScriptFileName,
String logFileName,
String trimLogFileName,
String defaultExcludeFileName,
String defaultTrimExcludeFileName,
String defaultDirectoryName,
boolean isVerbose,
boolean isParseOnly,
Hashtable propertiesTable)
throws Exception
public static void run(String zkmScriptFileName,
String logFileName,
String trimLogFileName,
String defaultExcludeFileName,
String defaultTrimExcludeFileName,
String defaultMethodParameterChangesExcludeFileName,
String defaultMethodParameterObfuscationExcludeFileName,
String defaultDirectoryName,
boolean isVerbose,
boolean isParseOnly,
Hashtable propertiesTable)
throws Exception
public static void run(String zkmScriptFileName,
String logFileName,
String trimLogFileName,
String defaultExcludeFileName,
String defaultTrimExcludeFileName,
String defaultDirectoryName,
boolean isVerbose,
boolean isParseOnly,
Properties properties)
throws Exception
public static void run(String zkmScriptFileName,
String logFileName,
String trimLogFileName,
String defaultExcludeFileName,
String defaultTrimExcludeFileName,
String defaultMethodParameterChangesExcludeFileName,
String defaultMethodParameterObfuscationExcludeFileName,
String defaultDirectoryName,
boolean isVerbose,
boolean isParseOnly,
Properties properties)
throws Exception
public static void run(String zkmScriptFileName,
String logFileName,
String trimLogFileName,
String defaultExcludeFileName,
String defaultTrimExcludeFileName,
String defaultMethodParameterChangesExcludeFileName,
String defaultMethodParameterObfuscationExcludeFileName,
String defaultDirectoryName,
String redirectOutFileName,
String redirectErrFileName,
boolean isVerbose,
boolean isParseOnly,
Properties properties)
throws Exception
public static void run(String proGuardConfigFileName,
Map propertiesTable)
throws Exception
public static void run(String zkmScriptFileName,
String logFileName,
String trimLogFileName,
String defaultExcludeFileName,
String defaultTrimExcludeFileName,
String defaultMethodParameterChangesExcludeFileName,
String defaultMethodParameterObfuscationExcludeFileName,
String defaultDirectoryName,
String redirectOutFileName,
String redirectErrFileName,
boolean isVerbose,
boolean isParseOnly,
Properties properties,
boolean isProGuardStyle)
throws Exception
Parameters:
|
|
zkmScriptFileName
|
The path name of the ZKM Script file to execute. May be relative or absolute.
Mandatory. If the path is relative, Zelix KlassMaster will look in the default directory.
|
logFileName
|
The path name of the log file to which messages should be written. May be relative or absolute.
Optional. If the path is relative, then it will be written to the default directory.
If null then the file "ZKM_log.txt" will be used.
|
trimLogFileName
|
The path name of the trim log file to which trim results should be written. May be relative or absolute.
Optional. If the path is relative, then it will be written to the default directory.
If null then the file "ZKM_TrimLog.txt" will be used.
|
defaultExcludeFileName
|
The path name of the file containing the default name exclusions. May be relative or absolute.
Optional. If the path is relative, Zelix KlassMaster will look in the default directory.
If null then Zelix KlassMaster will look in the default directory for the file "defaultExclude.txt".
|
defaultTrimExcludeFileName
|
The path name of the file containing the default trim exclusions. May be relative or absolute.
Optional. If the path is relative, Zelix KlassMaster will look in the default directory.
If the path is null then Zelix KlassMaster will look in the default directory for the file "defaultTrimExclude.txt".
|
defaultMethodParameterChangesExcludeFileName
|
The path name of the file containing the default Method Parameter Change exclusions. May be relative or absolute.
Optional. If the path is relative, Zelix KlassMaster will look in the default directory.
If the path is null then Zelix KlassMaster will look in the default directory for the file "defaultMethodParameterChangesExclude.txt".
|
defaultMethodParameterObfuscationExcludeFileName
|
The path name of the file containing the default Method Parameter Obfuscation exclusions. May be relative or absolute.
Optional. If the path is relative, Zelix KlassMaster will look in the default directory.
If the path is null then Zelix KlassMaster will look in the default directory for the file "defaultMethodParameterObfuscationExclude.txt".
|
defaultDirectoryName
|
The path name of the directory which will be used as the default directory. May be relative or absolute.
Optional. If the path is relative, then it will be relative to the current working directory.
If the path is null then the default directory will be the current working directory.
|
isVerbose
|
If true , extra information is written to the log file.
|
isParseOnly
|
If true , the ZKM Script file will be parsed but not executed.
|
extraPropertiesTable
|
A Hashtable of String name value pairs for use in ZKM Script System Variable substitution.
|
extraProperties
|
A Properties object containing name value pairs for use in ZKM Script System Variable substitution.
|
redirectOutFileName
|
The file to which stdout should be redirected. May be null.
|
redirectErrFileName
|
The file to which stderr should be redirected. May be null.
|
Throws:
|
|
Exception
|
If any errors are encountered in parsing and executing the ZKM Script.
|
For example:
com.zelix.ZKM.run("/projects/myScript.txt", null, null, null, null, null, false, false, myProperties);
|