input
stringlengths
10
828
output
stringlengths
5
107
public void log output logger logger level out level level err level string system out get stdout if system out null system out length 0 logger log out level system out string system err get stderr if system err null system err length 0 logger log err level system err
writes the results of system out and system err to the specified logger
public jar get jar return jar
the underlying ant task
private void maybe add provider target target if is using provider install wagon provider task provider get parent get ant feature add task new install wagon provider task provider set task name publish wagon provider set artifact id provider artifact id provider set version provider version
if a provider configuration has been specified then a new provider will
private void attach sources artifact string artifact name source archive archive get parent get source archive archive entry source archive entry archive get entry artifact name if entry null file artifact entry get artifact attached artifact attach current deploy task create attach attach set file artifact attach set classifier sources maybe attach signature file artifact sources jar
attaches the sources artifact associated with the given artifact name to
private void attach javadoc artifact string artifact name javadoc archive archive get parent get javadoc archive javadoc entry entry archive get entry artifact name if entry null file artifact entry get archive entry get artifact attached artifact attach current deploy task create attach attach set file artifact attach set classifier javadoc maybe attach signature file artifact javadoc jar
attaches the javadoc artifact associated with the given artifact name to
public exec task wrapper add command string command return add command command null null
convenience call to
public void execute logger logger get parent get logger for int i 0 i commands size i current tag tags get i current exec commands get i current command current exec get arg line logger info executing current command current exec get exec task execute arg runnable script session current listener listeners get i if current listener null current listener run this
this method executes all of the accumulated commands calling back the
public file get shell script if shell script null shell script get parent get layout get shell script return shell script
the script that the commands are sent to
public exec task wrapper get current exec return current exec
the command object resulting from the most recent command execution
public file get working dir if working dir null working dir new file get parent get layout get target dir publish working dir mkdirs return working dir
the directory where the ivy and maven files are extracted to
public void before start command command log command start command start time millis new date get time
reports that a command is about to be executed
public void after failure command command runtime exception e update elapsed time start time millis log command failed command e show status window false
reports that a command has failed with a possible log message and a
public void after success command command update elapsed time start time millis log command succeeded command show status window true
reports that a command has succeeded with a possible log message and a
private void log command start command command line command get current instruction create line get logger info get logger info format command command command started get logger info
logs start text
private void log command succeeded command command get logger info get logger info format command command command succeeded log elapsed time get logger info
logs success text
private string format command command command string message return command get name message line
creates a standard format of the command to be logged
private void log elapsed time string builder message new string builder message append total time long hours elapsed hours if hours 0 don t show hours else if hours 1 message append 1 hour else message append hours message append hours long minutes elapsed minutes if minutes 0 don t show minutes else if minutes 1 message append 1 minute else message append minutes message append minutes long seconds elapsed seconds if seconds 0 message append 0 seconds else if seconds 1 message append 1 second else message append seconds message append seconds get logger info message
appends a message describing the amount of time the build took
private logger get logger return get parent get logger
convenience method for obtaining the logger
public void release string gc user name string gc password string sf user name create docs project get delegate get junit feature junit project create all archives upload to maven sf user name upload to google code gc user name gc password
carries out the steps to release protoj starting from just the compiled
private void create docs boolean is java5 project get delegate is jdk6 if is java5 project extract javadocs project extract site
creates the javadocs and site docs but only in the java 5 build
public void upload to google code string gc user name string gc password standard project delegate project get delegate classes archive classes delegate get classes archive archive entry classes archive entry classes get entry project get delegate get versioned executable jar tag get archive entry file artifact entry get artifact delegate get upload google code feature upload artifact artifact project get delegate get executable jar name type archive op sys all featured executable jar file execute with help gc user name gc password
uploads the executable jar to the google code website
public void create project string project name if project name equals project name basic name create basic project new file else if project name equals project name acme name create acme project new file else if project name equals project name ajc name create ajc project new file else if project name equals project name alien name create alien project new file else if project name equals project name helloworld name create hello world project new file else if project name equals project name serverdemo name create server demo project new file
convenience method that delegates to the appropriate create xxx method
public void upload artifact standard project project string password upload google code feature upload project get upload google code feature classes archive classes project get classes archive file jar classes get entry acme get archive entry get artifact upload upload artifact jar acme 1 0 jar featured acme project bob password
performs the actual upload to google code blocking until complete
public void create basic project file parent dir create sample project parent dir basic bin run bsh src resources basic ivy xml conf profile conf basic properties readme txt notice txt src java org basic basic ignition java src java org basic basic project java src java org basic basic session java src java org basic basic test java
creates the basic project under the specified parent dir
public void create ajc project file parent dir create sample project parent dir ajc bin run bsh src resources org ajc ivy xml src resources meta inf aop xml conf profile conf ajc properties readme txt notice txt src java org ajc system ajc ignition java src java org ajc system ajc project java src java org ajc system ajc session java src java org ajc system ajc trace aj src java org ajc system soft exception aj
creates the ajc project with the specified root dir
public void create hello world project file parent dir create sample project parent dir helloworld bin run bsh conf helloworld properties conf profile conf helloworld properties src java helloworld hello world java src java helloworld hello world session java src java helloworld hello world test java readme txt notice txt
creates the hello world project with the specified root dir
public void create alien project file parent dir create sample project parent dir alien bin run bsh conf alien test properties conf profile conf alien properties conf profile conf alien test properties conf profile docs topsecret txt conf profile conf alien properties src java alien test successful test java src java alien alien ignition java src java alien alien project java src java alien alien session java src java alien alien test java src resources alien ivy xml readme txt notice txt
creates the alien project with the specified root dir
public void makepom string settings ref ivy make pom makepom get parent get ant feature add task new ivy make pom makepom set task name makepom makepom set ivy file ivy file makepom set pom file pom file mapping mapping makepom create mapping mapping set conf compile mapping set scope compile makepom execute
decorates the ivy makepom ant task
public void verify acme assert verify create sample project using jar project name acme name
creates the acme sample project and executes its tests
public void verify ajc assert verify create sample project using jar project name ajc name
creates the ajc sample project and executes its tests
public void verify alien assert verify create sample project using jar project name alien name
creates the alien sample project and executes its tests
public void ivy retrieve if ivy config null ivy retrieve get parent get ant feature add task new ivy retrieve file basedir get parent get layout get root dir ivy retrieve get project set base dir basedir ivy retrieve set task name ivy retrieve ivy retrieve set file get ivy file if config null config run this ivy retrieve execute
downloads the dependencies described in the project ivy
public string get jar name return jar name null jar name get versioned jar name
a convenience method that returns the actual file name of the dependency
private void init proto exe jar final string project version get version the no dependencies jar file merged with all jars in the lib dir classes archive classes delegate get classes archive string jar name delegate get versioned executable jar tag classes add entry jar name manifest protoj protoj common protoj exe null classes get entry jar name init config new arg runnable classes archive public void run classes archive archive archive get current assemble task init manifest proto j version project version archive init executable jar proto project class get name classes init exclude archives jar name aspectjtools jar
configures the artifacts for the executable archive
public file get jar file file lib dir parent get parent get layout get lib dir return new file lib dir get jar name
the absolute path of the jar file under the lib directory
public void maven retrieve if maven config null target target get parent get ant feature create target target dependencies create dependencies target string classes dependency classes fileset dependencies set fileset id classes dependency copy classes add dependency target classes dependency string javadocs dependency javadocs fileset dependencies set javadoc fileset id javadocs dependency copy javadocs add dependency target javadocs dependency string sources dependency sources fileset dependencies set sources fileset id sources dependency copy sources add dependency target sources dependency if config null config run this target execute
downloads the dependencies described in the project pom
public string get versioned jar name return artifact id version jar
a convenience method that returns the file name of the dependency with
public void init junit string memory this junit feature new junit feature create memory
this method must be called if junit tests are required in order to
public void verify basic assert verify create sample project using jar project name basic name
creates the basic sample project and executes its tests
private dependencies task create dependencies target target point to the project pom xml file in the conf directory pom pom get parent get ant feature add task new pom pom set task name maven feature pom pom set id protoj project pom set file get maven file assign the pom to a new dependencies task dependencies task dependencies get parent get ant feature add task new dependencies task dependencies set task name maven feature dependencies dependencies set pom ref id protoj project return dependencies
sets up the basic maven dependencies task
public string get unversioned jar name return artifact id jar
a convenience method that returns the file name of the dependency without
private copy add dependency target target string dependency project layout layout get parent get layout copy copy get parent get ant feature add task new copy copy set task name maven feature copy artifact file set file set new file set copy add fileset file set reference dependency ref new reference target get project dependency file set set refid dependency ref copy set todir layout get lib dir copy set overwrite true mapper flatten mapper copy create mapper mapper type flatten type new mapper type flatten type set value flatten flatten mapper set type flatten type return copy
adds an ant task to the specified target that copies the project pom
public boolean is repo return is repo
true if this dependency describes an artifact in a repository false if
public void set repo boolean is repo this is repo is repo
sometimes its necessary to update the information about where an artifact
public void verify hello world assert verify create sample project using jar project name helloworld name
creates the hello world sample project and executes its tests
public dependency info remove dependency string artifact id return dependencies remove artifact id
removes the dependency with the specified artifact id
public dependency info remove dependency dependency info info return remove dependency info get artifact id
removes the specified dependency
public dependency info get dependency string artifact id return dependencies get artifact id
looks up the info with the specified artifact id
private string create script name string name run string os name system get property os name to upper case boolean is windows os name index of windows 0 return is windows name bat name sh
returns the run shell script with the correct extension
public script session create script session return new script session
creates a helper that is able to drive the project represented by this
public file get ivy file if ivy file null resource feature feature get parent get resource feature file conf dir get parent get layout get conf dir ivy file feature filter resource to dir ivy config conf dir return ivy file
the ivy file used to define project dependencies
public void relax permissions chmod chmod get parent get ant feature add task new chmod chmod set task name sample permissions chmod set dir get root dir get parent file chmod set includes get root name chmod set perm 777 chmod execute
apply 777 permissions all the way down the project structure
private void assert verify final standard project sample project final script session session sample project create script session arg runnable script session listener new arg runnable script session public void run script session arg assert assert true session get current exec is success session add command verify listener null session execute
executes the verify on the specified sample project by issuing the
public file get maven file if maven file null resource feature feature get parent get resource feature file conf dir get parent get layout get conf dir maven file feature filter resource to dir maven config conf dir return maven file
the maven pom file used to define project dependencies
public file get working dir if working dir null working dir new file get parent get layout get target dir retrieve working dir mkdirs return working dir
the directory where the ivy and maven files are extracted to
public command runner get runner return runner
a reference to the delegate object used to execute a command usually
public beanshell feature get beanshell feature return beanshell feature
a reference to the delegate object commonly used by the beanshell
private void copy resource string res parent string res name string resource name protoj exe res parent res name input stream in get class get resource as stream resource name if in null throw new runtime exception couldn t find resource resource name file dest new file sample project get layout get root dir res name dest get parent file mkdirs dest create new file try file output stream out new file output stream dest try ioutils copy in out finally ioutils close quietly out finally ioutils close quietly in
copies the file under the protoj resource path to the project root
public file get exe file classes archive classes get delegate get classes archive classes entry entry classes get entry delegate get versioned executable jar tag return entry get archive entry get artifact
the executable jar we shall use to create the sample project
public string get protoj artifact id string tag if get parent is jdk6 tag protoj jdk6 else tag protoj jdk5 return tag
the protoj artifact id depends on the version of java running
public void create info archives get delegate get javadoc archive create archive get versioned jar tag get delegate get source archive create archive get versioned jar tag
creates just the sources and javadoc archives
public void configure default delegate get config feature relative local clean default delegate get config feature relative local overlay default false
configures proto j from the default profile with no interpolation
public config feature get config feature return config feature
a reference to the delegate object used to configure this application
public dependency store get dependency store return dependency store
a container of project dependencies belonging to this project
public project command get project command return project command
the command used for creating a sample project
public log feature get log feature return log feature
delegated functionality see
public logger get logger return get log feature get proto logger
access to the protoj log4j instance
public file get location class name file jar new file name get protection domain get code source get location to uri return jar
gets the filename of the code source that contains the specified class
public standard settings get settings return settings
delegated functionality see
public string create root system property string builder builder new string builder builder append d builder append root property builder append builder append get root path return builder to string
creates a d version of the root directory
public boolean is jdk6 string version system get property java specification version return version contains 6
true if version 6 otherwise version 5 is assumed
public string get jar name return get proto artifact get versioned jar name
the complete name of the maximum dependencies jar file as deployed to
public string get protoj version return 2 0 0
the proto j project version number
public string get version return delegate get protoj version
the project version number
public string get executable jar tag string tag if is jdk6 tag protoj exe jdk6 else tag protoj exe jdk5 return tag
the name of the executable protoj jar file without the version number or
public string get executable jar name return get versioned executable jar tag jar
the complete name of the executable jar file as deployed on google code
public string get exe download url return get download ur delegate get executable jar name
the url for downloading the executable jar from googlecode
public dependency info get proto artifact return delegate get dependency store get protoj
the artifact description of the proto j artifact being deployed
public ant feature get ant feature return ant feature
use this instance to access ant functionality
public string get protoj artifact id string tag if parent is jdk6 tag protoj jdk6 else tag protoj jdk5 return tag
the protoj artifact id depends on the version of java running
public void release string gc user name string gc password string sf user name show summary create docs project get delegate get junit feature junit project create all archives upload to maven sf user name upload to google code gc user name gc password
carries out the steps to release protoj starting from just the compiled
public void upload to google code string gc user name string gc password standard project delegate project get delegate archive feature archive delegate get archive feature classes archive classes archive get classes archive archive entry classes archive entry classes get entry project get versioned exe jar tag get archive entry file artifact entry get artifact delegate get upload google code feature upload artifact artifact project get exe jar name type archive op sys all featured executable jar file execute with help gc user name gc password
uploads the executable jar to the google code website
public file get exe file archive feature feature get delegate get archive feature classes archive classes feature get classes archive classes entry entry classes get entry get versioned exe jar tag return entry get archive entry get artifact
the executable jar we shall use to create the sample project
public string get protoj version return 1 9 2
the proto j project version number
public void create info archives archive feature archive delegate get archive feature archive get javadoc archive create archive get versioned jar tag archive get source archive create archive get versioned jar tag
creates just the sources and javadoc archives
public string get version return get proto artifact get version
the project version number
public string get exe jar tag string tag if delegate is jdk6 tag protoj exe jdk6 else tag protoj exe jdk5 return tag
the name of the executable protoj jar file without the version number or
public string get exe jar name return get versioned exe jar tag jar
the complete name of the executable jar file as deployed on google code
public string get version number return 1 7 0
used in version information and names of jar files for example
public void create basic project file parent dir file jar file create project parent dir basic jar file bin basic sh bin basic bat src resources basic ivy xml conf profile conf basic properties conf dev properties readme txt notice txt src java org basic core basic core java src java org basic system basic project java
creates the basic project under the specified parent dir
public void create ajc project file parent dir file jar file create project parent dir ajc jar file bin ajc sh bin ajc bat src resources ajc ivy xml src resources meta inf aop xml conf profile conf ajc properties conf dev properties readme txt notice txt src java org ajc core ajc core java src java org ajc system ajc project java src java org ajc system ajc trace aj src java org ajc system soft exception aj
creates the ajc project with the specified root dir
public void create hello world project file parent dir file jar file create project parent dir helloworld jar file bin helloworld sh bin helloworld bat conf helloworld properties conf profile conf helloworld properties src java helloworld hello world java readme txt notice txt
creates the hello world project with the specified root dir
public void create alien project file parent dir file jar file create project parent dir alien jar file bin alien sh bin alien bat conf alien test properties conf profile conf alien properties conf profile conf alien test properties conf profile docs topsecret txt conf profile conf alien properties src java alien core alien core java src java alien test alien test java src java alien alien project java src resources alien ivy xml readme txt notice txt
creates the alien project with the specified root dir
private void copy resource string res parent string res name string resource name protoj res parent res name input stream source get class get resource as stream resource name if source null throw new runtime exception couldn t find resource resource name file dest new file layout get root dir res name dest get parent file mkdirs dest create new file input stream reader in new input stream reader source try file output stream out new file output stream dest try ioutils copy in out finally ioutils close quietly out finally ioutils close quietly in
copies the file under the protoj resource path to the project root
public void report project help resource feature feature parent get resource feature string resource path protoj language english project txt string text feature filter resource to string resource path system out println text
reports general parent help information to stdout by iterating over the
public void release string gc user name string gc password string sf user name show summary project get delegate get junit feature junit extract site create archives upload to maven sf user name upload to google code gc user name gc password
carries out the steps to release protoj starting from just the compiled
public void extract site project layout layout project get delegate get layout file wiki dir new file layout get root dir get parent file wiki if wiki dir exists string message checked out wiki directory is required wiki dir get absolute path throw new runtime exception message file dir project extract site file src dir new file dir protoj site wiki file utils copy directory src dir wiki dir
just extracts the googlecode website files from the jar and copies to the
private void create archives standard project delegate project get delegate archive feature archive delegate get archive feature archive get classes archive create archives archive get javadoc archive create archives archive get source archive create archives
creates the tar and jar files that are to be uploaded to googlecode
public void upload to google code string gc user name string gc password upload artifact project get jar tag merged jar file with maximum dependencies gc user name gc password type archive op sys all upload artifact project get no dep jar tag merged executable jar file with minimum dependencies gc user name gc password type archive op sys all featured upload project archive gc user name gc password
uploads the project archive the jar with dependencies and the jar with
public string get no dep jar name return get no dep jar tag get version jar
the complete name of the no dependencies jar file