input
stringlengths
10
828
output
stringlengths
5
107
public int create directory string dir if file manager create directory dir return 0 else return 1
create a new directory
public console appender set console appender enabled boolean enable string name proto console appender appender appender logger get root logger get appender name boolean appender exists appender null if enable if appender exists appender new console appender new pattern layout get console pattern console appender system out appender set name name proto logger add appender appender ant logger add appender appender logger get root logger add appender appender else if appender exists proto logger remove appender appender ant logger remove appender appender logger get root logger remove appender appender return console appender proto logger get appender name
adds or removes a new console console appender to the log4j loggers
public compile task get task return task
the ant wrapper used to carry out the compilation
public void compile string includes string excludes copy resources task create task includes excludes if config null config run this task execute if task is success throw new information exception there was a problem compiling the source code
compiles the source code based on the specified ant patterns
private compile task create task string includes string excludes project layout layout core get layout compile task task new compile task layout get java dir layout get classes dir core get layout get classpath config memory includes excludes task init logging layout get log file return task
creates the compile implementation instance
private void copy resources ant target target new ant target compile feature copy project layout layout core get layout layout get classes dir mkdirs copy copy new copy target add task copy copy set task name copy copy set todir layout get classes dir file set resource files new file set resource files set dir layout get resources dir copy add fileset resource files target execute
copies the files in the resources directory into the classes directory
public string get value string value store get config get string key missing default if value equals value empty default return value
provides a value for the underlying key in all cases
public boolean get boolean value return boolean parse boolean get value
conveniently typed method for converting
public core project get core return core
the parent core for this store
public int get integer value return integer parse int get value
conveniently typed method for converting
public command get command string name command target command null collection command values commands for command command values if command contains alias name target command command break return target command
looks up the command with the given name
public string get empty default return empty default
the default value to use when the value of a property is empty
public string get missing default return missing default
the default value to use when a property isnt specified at all
public string create jvm arg string value string builder builder new string builder builder append d builder append get key if value null builder append builder append value return builder to string
creates a command line equivalent of this property with the specified
public string get text return new string name opts trim
returns a textual representation of this instruction suitable for the
private string create current main class try throw new runtime exception catch exception e stack trace element trace e get stack trace return trace trace length 1 get class name
creation method for the current main class property
private runnable create bootstrap runnable bootstrap new runnable public void run start vm return bootstrap
constructor support that creates the vm wrapper used to delegate the
public string get opts return opts
the unparsed options for the instruction
public boolean has opts return opts length 0
returns true if this instruction has an options set
public boolean is init instruction return init equals get name
returns whether or not this instruction is the one that provides
public boolean is opts instruction return opts equals get name
returns whether or not this instruction is the one that provides system
private boolean create script vm string script vm system get property script vm property boolean true to string return boolean value of script vm
creation method for the script vm property
public void init file root dir string script name this root dir root dir get canonical file this script name script name this command instructions new linked hash map string instruction this jvm args new array list string
common initialization method
private void start vm core project core store get core instruction chain chain core get instruction chain string opts with body instruction get opts body trim dispatch feature dispatch feature core get dispatch feature string main class if bootstrap current vm main class dispatch feature get current main class else main class dispatch feature get main class string args chain create main args get name opts with body dispatch feature start vm main class args memory get start vm config
this method must not be inlined into the anonymous inner class as the
public string get revision result return revision result
stores the result of the most recent invocation of
public project reporter get reporter return reporter
the helper used to report dispatch progress
public void begin command string command if is reporting enabled get logger info get logger info get highlighted message command get logger info
logs that a command is about to be executed
public void unknown command string command if is reporting enabled get logger error unknown command command
logs that the given command was unknown when an execution was attempted
public void project succeeded if is reporting enabled get logger info get logger info build successful get logger info
logs that the project command was successfully executed
public instruction add instruction string name string options instruction instruction new instruction name options if instruction is init instruction init instruction instruction else if instruction is opts instruction opts instruction instruction else command instructions put name instruction return instruction
adds another item to the configuration
public void project failed throwable e get logger info get logger info build failed e get logger info
logs that the project command was unsuccessfully executed using the
public void init aliases string aliases this aliases add all arrays as list aliases
optional method specify alternate names for this command
public void project failed string description get logger info string builder message new string builder message append build failed message append n message append description get logger info message get logger info
logs that the project command was unsuccessfully executed using the
public string get highlighted message string message return message
used to format each message in a standard way
public instruction get init instruction return init instruction
the init definition that should always be present
private string get gcskip description string builder builder new string builder builder append specify whether or not the project tar file gets uploaded to google code builder append n the two possible values are builder append n n 1 true the tar file doesn t get posted and an informative message is logged builder append n n 2 false the tar file gets posted normally return builder to string
factoring out large description into its own method
public void init bootstrap current vm this bootstrap current vm true
there is almost no reason to use this method since by default most
private void exit application int code if is script vm system exit code else if is status window show status window code else system exit code
exits the application with the specified error code
public instruction get opts instruction return opts instruction
the opts definition that may be null
public instruction remove string name return command instructions remove name
removes the instruction with the given name and returns it
public void execute instruction instruction this instruction instruction this options parser parse instruction get opts split boolean execute body options has body if execute body project reporter reporter store get core get dispatch feature get reporter reporter begin command get name body run else bootstrap run
executes this command using the given specified instruction that usually
public void init logging file log file int level target init logging log file level
enables logging to the specified log file at project
private void show status window int code jframe frame new jframe frame set background code 0 color green color red frame set size 300 100 frame set resizable true frame set default close operation jframe exit on close dimension screen size toolkit get default toolkit get screen size frame set size screen size width screen size height frame validate jframe create status window frame create status window set visible true
shows the status window but only from the script vm
public void visit and remove arg runnable instruction visitor break visit false iterator instruction instructions command instructions values iterator while instructions has next break visit instruction instruction instructions next visitor run instruction instructions remove command instructions clear
visits each of the instructions in turn removing them as they are
public void init fork string max memory boolean spawn this fork true this max memory max memory this spawn spawn java set fork true java set maxmemory max memory java set spawn spawn if spawn java set outputproperty stdout property java set error property stderr property java set result property result property
invoke this method if the virtual machine should fork
public void init args string args init args arrays as list args
invoke if any arguments to main are required
public proto property get property string key return properties get key
looks up the property with the given key
public void init args list string args this args add all args for string value args argument arg java create arg arg set value value
invoke if any arguments to main are required
public string get name return aliases get 0
the unique name of this command
public void init jvmargs string jvmargs init jvmargs arrays as list jvmargs
invoke if any virtual machine arguments are required
public proto property get debug property return debug property
set to true or false to to turn debugging on or off
private boolean is in project main return get current main class equals get main class
returns true if we are in the main class specified by
public void init classpath arg runnable path config path classpath get java create classpath config run classpath
invoke if the classpath should be configured
public proto property get level property return level property
one of the logging levels constant values as declared in the log4j level
private void start project main vm string args project get instruction chain create args and remove start vm main class args main memory get start vm config
starts a forked vm to the project main
public void init debug int port boolean suspend debug suspend suspend y n debug port port argument jvmarg java create jvmarg jvmarg set line xdebug xrunjdwp transport dt socket address port server y suspend debug suspend
invoke if debugging is required
public ajc task get ajc return ajc
the underlying ant task used to perform the compilation
public option parser get parser return parser
use in order to configure the command line options for this command
public proto property get quiet property return quiet property
set to true or false to turn the console appender on or off
public void init weaving file weaver jar argument jvmarg java create jvmarg jvmarg set value javaagent weaver jar get absolute path
invoke if runtime weaving is required
public void dispatch commands get core get dispatch feature dispatch commands
see code standard project dispatch commands code
public string get alias text string builder builder new string builder string name get name builder append name if aliases size 1 builder append for string alias aliases if alias equals name builder append alias builder append builder delete builder length 2 builder length builder append return builder to string
reports the aliases available useful for help text
public string get version number return 1 7 1
used in version information and names of jar files for example
public void init local jmx argument jvmarg java create jvmarg jvmarg set value dcom sun management jmxremote
invoke if local jmx connectivity is required
public void init remote jmx integer port argument jvmarg java create jvmarg jvmarg set value dcom sun management jmxremote port port
invoke if remote jmx connectivity is required
public option set get options return options
the helper responsible for parsing the command line arguments
public string get current main class return current main class
calculates the name of the main method containing class that was used
public proto property get debug port property return debug port property
set to a valid port number that the debugger should listen for
public boolean contains alias string alias return aliases contains alias
convenience method that checks whether or not the given alias is known to
public string get instruction text return instruction get text
includes both the command name and arguments if any that make up the
public void init logging file log file int level log4j listener listener new log4j listener project add build listener listener
enables logging to the specified log file at the specified level
public void add task task task task set project target get project target add task task
adds a task sequentially to the underlying ant target
public void execute target execute
executes the underlying ant target
public proto property get gcskip property return gcskip property
whether or not the upload to google code should occur
public command store get store return store
a reference to the owning store
public string get main memory return main memory
the maximum amount of memory that should be allocated by the new vm
public proto property get scpskip property return scpskip property
whether or not the remote copy via scp should occur
public string get help text string builder builder new string builder builder append name builder append get alias text builder append n n description builder append get description builder append n return builder to string
builds a message suitable for displaying in response to a help command
public boolean is script vm return script vm
returns whether or not the current vm was started directly from the shell
public void throw bad options exception string hint string builder builder new string builder builder append the following command contained unrecognized options ignore any body switch n n builder append get instruction text boolean is hint specified hint null hint length 0 if is hint specified builder append builder append hint builder append n n please review the command help as follows n builder append get help text throw new information exception builder to string
throws an information exception with standardized error information
public void init executable jar string jar name string current main class project get dispatch feature get current main class init executable jar jar name current main class
convenience method that delegates to
public void assemble collection assemble task tasks assemble tasks values for assemble task task tasks task execute
responsible for creating one or more jar files from the compiled source
public jar get ant jar string jar name return assemble tasks get jar name get jar
if further configuration of the jar file to be created is required then
public boolean is status window return status window
returns whether or not the
public int get jar count return assemble tasks size
the number of jars this features is configured to create
public standard project get project return project
the parent of this feature
public void verify tar extract tar files apply rwx execute session
starts the verification process
public assemble task get recent task return recent task
returns the most recently added assemble task
public void junit junit test java null
executes all the classes that contain test as part of their name
public void scp string to dir string password do scp false to dir null password
copies the project tar file to the remote location using simple password
public void scp string to dir string passphrase string key file do scp true to dir key file passphrase
copies the project tar file to the remote location using key based
private void apply rwx project layout layout project get layout create the parent ant target ant target target new ant target extract tar files target init logging layout get log file project msg info applies the chmod chmod chmod new chmod chmod set task name rwx target add task chmod chmod set dir get verify project get layout get root dir chmod set includes chmod set perm 777 target execute
applies rwx permissions to the extracted project
private scp task create scp task string tar path project get tar feature get compressed path file tar file new file tar path if tar file exists throw new information exception no tar file scp won t work until a tar file has been generated with the tar command scp task scp new scp task to dir tar file project layout layout project get layout file log file layout get log file scp init logging log file return scp
creates the default scp task instance ready for further customization
private void execute session project layout layout get verify project get layout file src dir layout get src dir file shell script layout get shell script if src dir exists throw new runtime exception unable to find src directory for the compilation part of tar verification at src dir get absolute path script session session new script session shell script throwing listener listener new throwing listener shell script session add command compile listener null session add command assemble listener null session add command test listener null session execute
executes the project commands failing if any of those commands
public scp get ant scp return scp task get scp
the underlying scp ant object for fine grained customization
public standard project get verify project project layout this layout project get layout file verify tar dir new file this layout get target dir verify tar string prefix project get tar feature get prefix file root dir new file verify tar dir prefix string script name this layout get script name standard project project new standard project root dir script name return project
creates a project instance representing the project being verified in the
public void report command help command command system out println command get help text
reports help on the specified command to stdout
public void configure string name project layout layout project get layout file profile instance dir new file layout get profile dir name if profile instance dir exists string reason can t find profile directory profile instance dir get absolute path throw new information exception reason new clean task get working dir execute get working dir mkdir if interpolated reduce properties profile instance dir filtered copy profile instance dir else merge properties profile instance dir copy dir profile instance dir get working dir null properties copy dir get working dir layout get root dir null null
configures the project config directory by overlaying the content of the
public void report property help proto property property string builder builder new string builder builder append name builder append property get key builder append n n description builder append property get description builder append n n when the key is not specified the application assumes a value of builder append property get missing default builder append builder append n when the key is specified but not assigned a value the application assumes a value of builder append property get empty default builder append builder append n system out println builder
reports help on the specified property to stdout
public void report version system out println version info
reports version information to stdout