public class ProjectInstaller
extends java.lang.Object
Virtually everything is optional.
If no parameters or options are provided then a new project will be created with the current "Working Directory" as the root project directory.
If only a -project or ProjectName is provided, then a new project will be created as a subdirectory of the current "Working Directory".
The class not only creates the required directory structure, but will also attempt to populate the project with common project-specific utility scripts and assets.
Refer to Config File Options for more detailed information on available options.
processINIFile(File)
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
ARG_BENCH |
static java.lang.String |
ARG_CONFIG |
static java.lang.String |
ARG_DATA |
static java.lang.String |
ARG_DIF |
static java.lang.String |
ARG_LOGS |
static java.lang.String |
ARG_OUTPUT |
static java.lang.String |
ARG_PATH |
static java.lang.String |
ARG_PROJECT |
static java.lang.String |
ARG_SAFS |
static java.lang.String |
ARG_SELENIUM |
static java.lang.String |
ARG_STAF |
static java.lang.String |
ARG_TEST |
static java.lang.String |
ARG_TYPE |
protected java.io.File |
benchDir |
protected java.io.File |
configFile |
protected java.io.File |
dataDir |
protected java.io.File |
difDir |
protected java.io.File |
driverDir |
protected boolean |
isSAFS |
protected boolean |
isSelenium |
protected java.lang.String |
LOG_NAME |
protected java.io.File |
logsDir |
protected static java.lang.String |
nl
newline
|
protected java.io.File |
outputDir |
protected java.lang.StringBuffer |
progress |
protected java.io.File |
projectDir |
protected java.io.File |
projectParent |
protected java.io.File |
safsDir |
protected java.io.File |
safsHome |
protected java.io.File |
safstidFile |
protected java.io.File |
seleniumHome |
protected java.io.File |
stafDir |
protected java.io.File |
testDir |
protected java.io.File |
workDir |
Constructor and Description |
---|
ProjectInstaller()
Default constructor.
Functionality invoked with createProject(String[]). |
Modifier and Type | Method and Description |
---|---|
protected void |
createDirectory(java.io.File target,
java.io.File relativeParent,
java.lang.String role) |
void |
createProject(java.lang.String[] args)
If no arguments are provided then a default Project will be created in the "working directory".
|
protected void |
createProjectStructure()
Create the project directory structure using the required preset values.
|
protected void |
deduceMissingParameters()
fourth-order (last) processing to attempt to fill-in missing settings relative to other known info.
|
static void |
main(java.lang.String[] args) |
protected void |
processCMDLine(java.lang.String[] args)
third-order settings
|
protected void |
processEnvironment()
first-order settings
|
protected void |
processINIFile(java.io.File inifile)
second-order settings
|
protected void |
progress(java.lang.String message)
write progress/debug info to one or more sinks
|
protected void |
seekConfigFiles(java.lang.String[] args)
check for -config argument from command-line.
-config can be absolute or relative to the working directory. Attempt to locate safstid.ini relative to -config, if not then Attempt to locate safstid.ini relative to working directory. sets configFile and safstidFile variables as appropriate. |
public static final java.lang.String ARG_CONFIG
public static final java.lang.String ARG_PATH
public static final java.lang.String ARG_PROJECT
public static final java.lang.String ARG_TYPE
public static final java.lang.String ARG_DATA
public static final java.lang.String ARG_BENCH
public static final java.lang.String ARG_TEST
public static final java.lang.String ARG_DIF
public static final java.lang.String ARG_LOGS
public static final java.lang.String ARG_STAF
public static final java.lang.String ARG_SAFS
public static final java.lang.String ARG_SELENIUM
public static final java.lang.String ARG_OUTPUT
protected java.lang.String LOG_NAME
protected java.io.File safstidFile
protected java.io.File configFile
protected java.io.File workDir
protected java.io.File stafDir
protected java.io.File safsHome
protected java.io.File seleniumHome
protected java.io.File safsDir
protected java.io.File projectDir
protected java.io.File projectParent
protected java.io.File driverDir
protected java.io.File dataDir
protected java.io.File benchDir
protected java.io.File difDir
protected java.io.File testDir
protected java.io.File logsDir
protected java.io.File outputDir
protected java.lang.StringBuffer progress
protected boolean isSAFS
protected boolean isSelenium
protected static final java.lang.String nl
public ProjectInstaller()
createProject(String[])
protected void progress(java.lang.String message)
protected void processEnvironment()
Anything found and set here can be overridden by second- and third-order settings.
processINIFile(File)
,
processCMDLine(String[])
protected void processINIFile(java.io.File inifile)
override first-order settings.
Anything found and set here can be overridden by third-order settings.
INI File Settings Sought:
- [STAF] PATH=pathTo/STAFProc (parsed for STAF Install Directory)
- [SAFS_DRIVER] DriverName=SAFS | SeleniumPlus DriverRoot=pathTo/SAFS or SeleniumPlus Install Directory
- [SAFS_PROJECT] ProjectRoot=pathTo/ProjectParent directory (or ProjectDirectory if ProjectName is not provided) ProjectName=NameOfProject -- appended to project parent directory if provided
- [SAFS_DIRECTORIES] DATADIR =Data directory -- absolute path, or project-relative path BENCHDIR=Benchmark directory -- absolute path, or project-relative path TESTDIR =Test directory -- absolute path, or project-relative path DIFFDIR =Differences directory -- absolute path, or project-relative path LOGDIR =Logs directory -- absolute path, or project-relative path
processEnvironment()
,
processCMDLine(String[])
protected void processCMDLine(java.lang.String[] args)
override first- and second-order settings.
args
- -- createProject(String[])
processEnvironment()
,
seekConfigFiles(String[])
,
processINIFile(File)
,
deduceMissingParameters()
protected void seekConfigFiles(java.lang.String[] args)
args
- protected void deduceMissingParameters()
protected void createDirectory(java.io.File target, java.io.File relativeParent, java.lang.String role) throws java.lang.IllegalArgumentException
target
- -- can be relative or absoluterelativeParent
- -- must be absolute if target is relative. can be null if target is absolute.role
- - for logging/debug purposes (Project, Data, Test, Logs, Bench, Diff)java.lang.IllegalArgumentException
- if we are unable to create the directory.protected void createProjectStructure() throws java.lang.IllegalArgumentException, java.lang.SecurityException
java.lang.IllegalArgumentException
- -- if required parameters are invalid or null.java.lang.SecurityException
public void createProject(java.lang.String[] args)
args
- processEnvironment()
,
seekConfigFiles(String[])
,
processINIFile(File)
,
processCMDLine(String[])
,
deduceMissingParameters()
public static void main(java.lang.String[] args)
createProject(String[])
Copyright © SAS Institute. All Rights Reserved.