public class BeanbuildCmdScriptUpdater
extends java.lang.Object
Copyright (C) 2015 JIOWA Business Solutions GmbH, Bettinastr. 30 , D-60325 Frankfurt am Main, Germany
Homepage: www.jiowa.de
All rights reserved.
Download: www.jiowa.de/download.html
License: www.jiowa.de/license.html
Modifier and Type | Field and Description |
---|---|
protected java.lang.String |
arguments |
protected static java.lang.String |
ARGUMENTS |
protected static java.lang.String |
LIB_PATH_UNIX |
protected static java.lang.String |
LIB_PATH_WINDOWS |
protected static java.lang.String |
SCRIPT_TEMPLATE_NAME |
protected java.lang.String |
scriptName |
Constructor and Description |
---|
BeanbuildCmdScriptUpdater(java.lang.String... params)
Constructor for the beanbuild.cmd script updater
|
Modifier and Type | Method and Description |
---|---|
protected java.lang.String |
determineLibPath()
Returns the relative library path to the current binary (jar file, bin or target directory).
|
protected java.lang.String |
determineWinHomepathEnvVariable(java.lang.String libPathWindows) |
protected boolean |
fileExists(java.lang.String filePath) |
static void |
main(java.lang.String[] arguments) |
protected boolean |
needsToBeUpdated()
Returns true if script needs to be updated and false, otherwise.
|
protected java.lang.String |
readScriptTemplate()
Reads the script template which has been given via the arguments parameters.
|
protected boolean |
unixPathExists(java.lang.String relativePath)
Returns true if relative path exists and false, otherwise.
|
void |
update()
Updates the beanbuild.cmd script template.
|
protected void |
updateExcecutableFlag()
Updates the executable flag of the current beanbuild.cmd script.
|
protected java.lang.String |
updateScript(java.lang.String template)
Updates the script template with the according variables.
|
protected void |
writeUpdatedScript(java.lang.String updatedScript)
Overwrites the updated script on the file system.
|
protected static final java.lang.String SCRIPT_TEMPLATE_NAME
protected static final java.lang.String LIB_PATH_UNIX
protected static final java.lang.String LIB_PATH_WINDOWS
protected static final java.lang.String ARGUMENTS
protected java.lang.String scriptName
protected java.lang.String arguments
public BeanbuildCmdScriptUpdater(java.lang.String... params)
params
- first param is the script name (i.e. beanbuild.cmd), the following parameters are standard arguments for the script.public void update() throws java.lang.Exception
java.lang.Exception
- gets thrown if anything gets wrongprotected boolean needsToBeUpdated()
protected java.lang.String readScriptTemplate()
protected boolean unixPathExists(java.lang.String relativePath)
relativePath
- protected java.lang.String updateScript(java.lang.String template)
template
- script template with variablesprotected java.lang.String determineWinHomepathEnvVariable(java.lang.String libPathWindows)
protected boolean fileExists(java.lang.String filePath)
protected java.lang.String determineLibPath()
protected void writeUpdatedScript(java.lang.String updatedScript)
updatedScript
- gets written to the file system.protected void updateExcecutableFlag()
public static void main(java.lang.String[] arguments)
arguments
- param_1: script name, JiowaCodeGenTemplateBeanGenerator
(usually 'check-template-syntax-only')