Interface Bundler
- All Known Implementing Classes:
LinuxAppBundler
,LinuxDebBundler
,LinuxRpmBundler
,MacAppBundler
,MacBaseInstallerBundler
,MacDmgBundler
,MacPkgBundler
,WinAppBundler
,WinExeBundler
,WinMsiBundler
public interface Bundler
Bundler
The basic interface implemented by all Bundlers.
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Removes temporary files that are used for bundling.Creates a bundle from existing content.getID()
getName()
boolean
Returns "true" if this bundler is he default for the current platform.boolean
supported
(boolean runtimeInstaller) Returns "true" if this bundler is supported on current platform.boolean
Determines if this bundler will execute with the given parameters.
-
Method Details
-
getName
String getName()- Returns:
- User Friendly name of this bundler.
-
getID
String getID()- Returns:
- Command line identifier of the bundler. Should be unique.
-
getBundleType
String getBundleType()- Returns:
- The bundle type of the bundle that is created by this bundler.
-
validate
Determines if this bundler will execute with the given parameters.- Parameters:
params
- The parameters to be validate. Validation may modify the map, so if you are going to be using the same map across multiple bundlers you should pass in a deep copy.- Returns:
- true if valid
- Throws:
ConfigException
- If the configuration params are incorrect. The exception may contain advice on how to modify the params map to make it valid.
-
execute
Creates a bundle from existing content. If a call tovalidate(java.util.Map)
date} returns true with the parameters map, then you can expect a valid output. However if an exception was thrown out of validate or it returned false then you should not expect sensible results from this call. It may or may not return a value, and it may or may not throw an exception. But any output should not be considered valid or sane.- Parameters:
params
- The Bundle parameters, Keyed by the id from the ParamInfo. Execution may modify the map, so if you are going to be using the same map across multiple bundlers you should pass in a deep copy.outputParentDir
- The parent dir that the returned bundle will be placed in.- Returns:
- The resulting bundled file For a bundler that produces a single artifact file this will be the location of that artifact (.exe file, .deb file, etc) For a bundler that produces a specific directory format output this will be the location of that specific directory (.app file, etc). For a bundler that produce multiple files, this will be a parent directory of those files (linux and windows images), whose name is not relevant to the result.
- Throws:
IllegalArgumentException
- for any of the following reasons:- A required parameter is not found in the params list, for example missing the main class.
- A parameter has the wrong type of an object, for example a String where a File is required
- Bundler specific incompatibilities with the parameters, for example a bad version number format or an application id with forward slashes.
PackagerException
-
cleanup
-
supported
boolean supported(boolean runtimeInstaller) Returns "true" if this bundler is supported on current platform. -
isDefault
boolean isDefault()Returns "true" if this bundler is he default for the current platform.
-