org.schmant
Class LauncherSettings

java.lang.Object
  extended by org.schmant.LauncherSettings

public final class LauncherSettings
extends Object

Settings created when parsing input arguments to the Launcher class's main method. This can also be used to launch Schmant directly via Launcher.launch(LauncherSettings, javax.script.Bindings) from a Java program.

Since:
0.5
Author:
Karl Gustafsson

Constructor Summary
LauncherSettings()
           
 
Method Summary
 LauncherSettings addProgramArgument(String s)
           
 LauncherSettings addProperties(Map<String,String> props)
          Add all properties in the map.
 LauncherSettings addProperty(String key, String value)
           
 LauncherSettings decreaseVerbosityLevel()
           
 String getPreparationScripts()
           
 List<String> getProgramArguments()
           
 Map<String,String> getProperties()
           
 String getReportFactory()
           
 String getReportLineFormatter()
           
 File getSchmantHome()
           
 String getScriptExecutorImplementation()
          Get the fully qualified class name of the ScriptExecutor implementation to use for running the build script, if that is set.
 File getScriptFile()
           
 NamedReadableFile getScriptFileObject()
          Get the script file object.
 String getTaskPackagePath()
          Get the extra task packages set, if any.
 Level getVerbosityLevel()
           
 LauncherSettings increaseVerbosityLevel()
           
 boolean isIsolatedClassLoaders()
           
 boolean isKeepTempFiles()
           
 boolean isTraceMode()
           
 LauncherSettings setIsolatedClassLoaders(boolean b)
           
 LauncherSettings setKeepTempFiles(boolean b)
           
 LauncherSettings setPreparationScripts(String s)
           
 LauncherSettings setReportFactory(String s)
           
 LauncherSettings setReportLineFormatter(String s)
           
 LauncherSettings setSchmantHome(File f)
           
 LauncherSettings setScriptExecutorImplementation(Class<? extends ScriptExecutor> c)
          Set the ScriptExecutor implementation to use for running the build script.
 LauncherSettings setScriptExecutorImplementation(String fqn)
          Set the fully qualified class name of the ScriptExecutor implementation to use.
 LauncherSettings setScriptFile(File f)
          Set the script file to run.
 LauncherSettings setScriptFile(String f)
          Set the file system path to the script file to run.
 LauncherSettings setScriptFileObject(NamedReadableFile f)
          Set the script file to run.
 LauncherSettings setTaskPackagePath(String s)
          Set the path of extra task packages.
 LauncherSettings setTraceMode()
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

LauncherSettings

public LauncherSettings()
Method Detail

setScriptFileObject

public LauncherSettings setScriptFileObject(NamedReadableFile f)
Set the script file to run. If this is set, it has precedence over the path set in setScriptFile(String)

Parameters:
f - The script file object.
Since:
1.0
See Also:
setScriptFile(String)

getScriptFileObject

public NamedReadableFile getScriptFileObject()
Get the script file object. If this object is set, it takes precedence over the script file from getScriptFile().

Returns:
The script file object.

setScriptFile

public LauncherSettings setScriptFile(String f)
Set the file system path to the script file to run.

Parameters:
f - The file system path to the script file to run.
See Also:
setScriptFileObject(NamedReadableFile)

setScriptFile

public LauncherSettings setScriptFile(File f)
Set the script file to run.

Parameters:
f - The script file to run.
See Also:
setScriptFileObject(NamedReadableFile)

getScriptFile

public File getScriptFile()

increaseVerbosityLevel

public LauncherSettings increaseVerbosityLevel()

decreaseVerbosityLevel

public LauncherSettings decreaseVerbosityLevel()

getVerbosityLevel

public Level getVerbosityLevel()

addProperty

public LauncherSettings addProperty(String key,
                                    String value)

addProperties

public LauncherSettings addProperties(Map<String,String> props)
Add all properties in the map.

Returns:
this
Since:
1.1

getProperties

public Map<String,String> getProperties()

setSchmantHome

public LauncherSettings setSchmantHome(File f)

getSchmantHome

public File getSchmantHome()

setTaskPackagePath

public LauncherSettings setTaskPackagePath(String s)
Set the path of extra task packages. If this is set, the standard task package path (the SCHMANT_HOME/task directory is appended to the end of the supplied path.

Parameters:
s - The extra task package path as a File.separator -separated string.

getTaskPackagePath

public String getTaskPackagePath()
Get the extra task packages set, if any.

Returns:
A File.separator-separated string, or null if not set.
See Also:
setTaskPackagePath(String)

setKeepTempFiles

public LauncherSettings setKeepTempFiles(boolean b)

isKeepTempFiles

public boolean isKeepTempFiles()

setPreparationScripts

public LauncherSettings setPreparationScripts(String s)

getPreparationScripts

public String getPreparationScripts()

setIsolatedClassLoaders

public LauncherSettings setIsolatedClassLoaders(boolean b)

isIsolatedClassLoaders

public boolean isIsolatedClassLoaders()

setReportFactory

public LauncherSettings setReportFactory(String s)

getReportFactory

public String getReportFactory()

setReportLineFormatter

public LauncherSettings setReportLineFormatter(String s)

getReportLineFormatter

public String getReportLineFormatter()

addProgramArgument

public LauncherSettings addProgramArgument(String s)

getProgramArguments

public List<String> getProgramArguments()

setTraceMode

public LauncherSettings setTraceMode()

isTraceMode

public boolean isTraceMode()

setScriptExecutorImplementation

public LauncherSettings setScriptExecutorImplementation(String fqn)
Set the fully qualified class name of the ScriptExecutor implementation to use. If this is not set, Launcher will use its service provider lookup mechanism to find an implementation based on the file name extension of the script file.

Parameters:
fqn - The fully qualified class name of a ScriptExecutor implementation.
Returns:
this
Since:
1.1

setScriptExecutorImplementation

public LauncherSettings setScriptExecutorImplementation(Class<? extends ScriptExecutor> c)
Set the ScriptExecutor implementation to use for running the build script. If this is not set, Launcher will use its service provider lookup mechanism to find an implementation based on the file name extension of the script file.

Parameters:
c - The class to use for running the build script.
Returns:
this
Since:
1.1

getScriptExecutorImplementation

public String getScriptExecutorImplementation()
Get the fully qualified class name of the ScriptExecutor implementation to use for running the build script, if that is set.

Returns:
The fully qualified class name, or null if that is not set.
Since:
1.1

toString

public String toString()
Overrides:
toString in class Object