input
stringlengths
10
828
output
stringlengths
5
107
public void init default string memory package set set defaultexcludes true javadoc set maxmemory memory package set set includes
ensures that all packages are included in the javadoc execution and that
public dir set get package set return package set
a reference to the package set added to the javadoc ant task
public sample project feature get sample project feature return sample project feature
a reference to the delegate object used to create a sample project
public string load log return file utils read file to string get log file
loads the log from disk and reads its content into a string
public void upload to google code string gc user name string gc password upload artifact project get jar name merged jar file with maximum dependencies gc user name gc password type archive op sys all upload artifact project get no dep jar name merged executable jar file with minimum dependencies gc user name gc password type archive op sys all featured seem to have hit a file size limit do by hand for now upload project archive gc user name gc password
uploads the project archive the jar with dependencies and the jar with
public string load log return load file get layout get log file
loads the log from disk and reads its content into a string
private void upload project archive string user name string password standard project delegate project get delegate string summary build from source with protoj sh compile archive string labels type source op sys all string google name string format s src tar gz project get project name delegate get upload google code feature upload tar google name labels summary user name password
uploads the project tar archive to the googlecode website
public void clean file utils delete directory get target dir file utils delete directory get classes dir
deletes the classes and target directories
public void init jvmargs list string jvmargs this jvmargs add all jvmargs for string value jvmargs argument jvmarg junit create jvmarg jvmarg set value value
invoke if any virtual machine arguments are required
public resource feature get resource feature return core get resource feature
a reference to the delegate object used to extract resources to the
public void init included resources string included resources this included resources included resources
any resources to check for inclusion
public void init excluded resources string excluded resources this excluded resources excluded resources
any resources to check for exclusion
public string load file file file file reader reader new file reader file string contents try contents get contents reader return contents finally reader close
loads the given file and reads its content into a string
private void assert artifacts file artifact boolean exists file repo dir artifact get parent file string name artifact get name file artifact checksum new file repo dir name md5 file artifact digest new file repo dir name sha1 file artifact sig new file repo dir name asc file artifact sig checksum new file repo dir name asc md5 file artifact sig digest new file repo dir name asc sha1 assert exists artifact exists assert exists artifact checksum exists assert exists artifact digest exists assert exists artifact sig exists assert exists artifact sig checksum exists assert exists artifact sig digest exists
asserts that the given artifact and its associated signature digest and
private void assert exists file file boolean exists if exists string message couldn t find file get absolute path assert assert true message file exists else string message shouldn t have found file get absolute path assert assert false message file exists
asserts the given file exists or doesnt exist depending on the value of
private void assert advice script session project session string stdout project session get current exec get stdout string expected before advice triggered at standard project assemble execution join point assert assert true stdout stdout contains expected
asserts that advice was applied during load time weaving
public file get acme file project layout acme layout get project get layout return new file acme layout get target dir testvmarg txt
represents a file that should exist after the corresponding command has
private void assert log contents string log acme session get project get layout load log assert assert true log log contains archive assert assert true log log contains task archive started assert assert true log log contains building jar assert assert true log log contains acme 1 0 jar assert assert true log log contains foo jar assert assert true log log contains task archive finished
asserts that the build sent the expected text to the log file
private void assert foo classes jar project layout acme layout acme session get project get layout file jar new file acme layout get archive dir foo jar verify archive verify new verify archive jar verify init included resources test txt verify init excluded resources acme acme project class acme core acme core class verify execute manifest manifest verify get manifest this attribute was hard coded in file assert assert true manifest get main attributes values contains foo this attribute was added programmatically assert assert true manifest get main attributes values contains bar
asserts the contents of the foo classes jar is as expected
private void assert foo sources jar project layout acme layout acme session get project get layout file jar new file acme layout get archive dir foosources sources jar verify archive verify new verify archive jar verify init included resources acme acme project java org junit test java verify execute
asserts the contents of the foo sources jar is as expected
public retrieve feature get retrieve feature return core get retrieve feature
a reference to the delegate object used to download project dependencies
private void assert foo javadoc jar project layout acme layout acme session get project get layout file jar new file acme layout get archive dir foojavadoc javadoc jar verify archive verify new verify archive jar verify init included resources acme acme project html verify execute
asserts the contents of the foo javadoc jar is as expected
public void init merge archives string archives merge archives arrays as list archives
any additional archives in the
public void init merge archives filename filter filter file lib dir parent get project get layout get lib dir string archives lib dir list filter init merge archives archives
specifies that source archives in the
public void init project archive string name string prefix init project archive name prefix null null null
convenient wrapper when just the default tar is required with no
public file get artifact return artifact
the archive file
public void init include archives string name string archives get entry name init merge archives archives
any additional classes archives in the
public void add classes string name get classes archive add archive name null null null null
convenience method that schedules the creation of a single jar file with
public void init exclude archives string name string archives final list string list arrays as list archives filename filter filter new filename filter public boolean accept file dir string name return list contains name parent is classes jar name get entry name init merge archives filter
specifies that all the sources archives except for the excluded list in
public void add javadoc string name string memory get javadoc archive add archive name null null null memory null
convenience method that schedules the creation of a single javadoc
public void add sources string name get source archive add archive name null null null null
convenience method that schedules the creation of a single sources
public boolean is classes jar string name return name ends with jar is sources jar name is javadoc jar name
returns whether or not the given jar name represents a valid classes jar
public archive feature get archive feature return archive feature
a reference to the delegate object used to provide archive creation
public void create archive string name project layout layout parent get project get layout current assemble task entries get name create assemble task layout get java dir arg runnable source archive config entries get name get config if config null config run this current assemble task execute
creates the jar for the given name under
public boolean is javadoc jar string name return name ends with jar name contains layout get javadoc postfix
returns whether or not the given jar name represents a valid javadoc jar
public void visit arg runnable archive entry source archive visitor collection archive entry source archive values entries values for archive entry source archive entry values visitor run entry
convenient method that visits each entry in this archive
public boolean is sources jar string name return name ends with jar name contains layout get source postfix name contains layout get src postfix
returns whether or not the given jar name represents a valid sources jar
public classes archive get classes archive return classes archive
use this instance to configure the creation of java archives from the
public source archive get source archive return source archive
use this instance to configure the creation of java archives from the
public javadoc archive get javadoc archive return javadoc archive
use this instance to configure the creation of java archives from the
public standard project create hello world delegate return new subject project feature create test project this example helloworld helloworld null jar
copies the example helloworld project to the target directory and returns
public project archive get project archive return project archive
use this instance to configure the creation of a compressed tar file for
public standard project create alien project delegate return new subject project feature create test project this example alien alien null jar
copies the example alien project to the target directory and returns a
public project layout get layout return layout
the parent layout for convenient access
public standard project create acme project delegate return new subject project feature create test project this src testproject acme acme aspectjtools jar aspectjweaver jar aspectjrt jar null
copies the example acme project to the target directory and returns a
public void dispatch commands delegate get dispatch feature dispatch commands
dispatches any commands held by this project
public publish feature get publish feature return publish feature
a reference to the delegate object used to publish project artifacts
public release command get release command return release command
the command used to invoke release functionality
public site command get site command return site command
the command used to create documentation for the protoj googlecode
public standard project get delegate return delegate
the main protoj domain object
public string get project name return protoj get version number
the name of the project that includes the version number
public standard commands get commands return commands
a container of references of those commands belonging to this
public void init config arg runnable retrieve feature config this config config
the provided config argument is called back when
public aspect jcompile task get ajc task return ajc task
the ant wrapper used to carry out aspectj compilation
public javac compile task get javac task return javac task
the ant wrapper used to carry out javac compilation
public standard properties get properties return core get properties
a container of references of those properties belonging to this
private aspect jcompile task create ajc task string includes string excludes project layout layout parent get layout aspect jcompile task task new aspect jcompile task layout get java dir layout get classes dir parent get layout get classpath config memory includes excludes task init logging layout get log file return task
creates the ajc compile implementation instance
public string get project archive name return protoj
the name of the generated tar file
private javac compile task create javac task string includes string excludes project layout layout parent get layout javac compile task task new javac compile task layout get java dir layout get classes dir parent get layout get classpath config memory includes excludes task init logging layout get log file return task
creates the javac compile implementation instance
private void copy resources ant target target new ant target compile feature copy project layout layout parent 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 group id return com google code protoj
the group id to use when publish to the maven repository
private string create version info string builder builder new string builder builder append proto j version get version number return builder to string
nice to factor this into a method of its own
public string get version number return core get version number
the project version number
public void create no dep archive archive feature feature get delegate get archive feature classes archive classes feature get classes archive classes create archive get no dep jar name
creates the no dependencies archive in the archive directory
public void project failed string description get logger info get logger info build failed get logger info description log elapsed time get logger info
logs that the project command was unsuccessfully executed using the
public javac get javac return javac
the underlying ant task used to perform the compilation
public string get version number return 1 8 0
used in version information and names of jar files for example
public void init jvmargs list string jvmargs this jvmargs add all jvmargs for string value jvmargs argument jvmarg java create jvmarg jvmarg set value value
invoke if any virtual machine arguments are required
public void create physical layout get root dir mkdirs get bin dir mkdirs get shell script create new file get docs dir mkdirs get src dir mkdirs get log dir mkdirs get conf dir mkdirs get profile dir mkdirs get lib dir mkdirs get java dir mkdirs get resources dir mkdirs get manifest dir mkdirs
creates the project layout on the filing system
private void copy resource file dest string relative path layout get relative path dest replace string source protoj demo relative path input stream resource get class get resource as stream source if resource null throw new runtime exception couldn t find resource source if dest exists dest get parent file mkdirs dest create new file copy resource new input stream reader resource dest
copies the file under the demo resource path to the specified dest
private void copy jar file file jar file ant target target new ant target demo copy copy new copy copy set task name demo copy jar target add task copy copy set file jar file copy set todir layout get lib dir target execute
copies the jar file into the demo lib directory
private void relax permissions ant target target new ant target demo chmod chmod new chmod chmod set task name demo permissions target add task chmod chmod set dir layout get root dir get parent file chmod set includes layout get root name chmod set perm 777 target execute
apply 777 permissions all the way down
private void copy resource reader source file dest buffered reader reader new buffered reader source try print writer writer new print writer new file output stream dest try string line while line reader read line null writer println line finally writer close finally reader close
streams the contents of the source reader to the destination file
public string get lib excludes pattern string lib dir name layout get lib dir get name return string format s s jar s s jar s s jar lib dir name parent get javadoc postfix lib dir name parent get source postfix lib dir name parent get src postfix
the pattern used to filter out source and javadoc jar files from directly
public void init publish string name string pom name get entry name init publish pom name
call this method if publishing to a maven repository is required
private void attach sources artifact string artifact name archive feature feature parent get archive feature source archive archive feature 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
attaches the sources artifact associated with the given artifact name to
private void attach javadoc artifact string artifact name archive feature feature parent get archive feature javadoc archive archive feature 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
attaches the javadoc artifact associated with the given artifact name to
public void release string gc user name string gc password string sf user name show summary create archives verify project archive upload to maven sf user name upload to google code gc user name gc password extract site
carries out the steps to release protoj starting from just the compiled
private void extract site project extract site
just extracts the googlecode website files from the jar
public void init load time weaving string partial name core init load time weaving partial name
proto j commands are each executed in their own virtual machines
private void upload to maven string sf user name publish feature publish feature project get delegate get publish feature publish feature deploy all sf user name null null null
publishes the archives to the sourceforge maven repository
private void upload to google code string gc user name string gc password upload artifact project get jar name merged jar file with maximum dependencies gc user name gc password type archive op sys all upload artifact project get no dep jar name merged executable jar file with minimum dependencies gc user name gc password type archive op sys all featured seem to have hit a file size limit do by hand for now upload project archive gc user name gc password
uploads the project archive the jar with dependencies and the jar with
public standard project create hello world delegate return new sample project feature create sample project this example helloworld helloworld null jar
copies the example helloworld project to the target directory and returns
public standard project create alien project delegate return new sample project feature create sample project this example alien alien null jar
copies the example alien project to the target directory and returns a
public boolean is javadoc jar string name return name ends with jar name contains get javadoc postfix
returns whether or not the given jar name represents a valid javadoc jar
public boolean is sources jar string name return name ends with jar name contains get source postfix name contains get src postfix
returns whether or not the given jar name represents a valid sources jar
public standard project create demo project delegate create no dep archive ant target target new ant target demo project layout layout delegate get layout target init logging layout get log file project msg info java java new java target add task java java set task name demo java java set jar get no dep file java set fork true java set failonerror true java set dir layout get target dir target execute file root dir new file layout get target dir demo return new standard project root dir demo null
ensures the no dependencies jar file is present and executes it so that
public demo project feature get demo project feature return demo project feature
a reference to the delegate object used to create a demo project
public standard project create acme project delegate return new sample project feature create sample project this src testproject acme acme aspectjtools jar aspectjweaver jar aspectjrt jar null
copies the example acme project to the target directory and returns a
public void clean core clean
deletes the classes and target directories
public string get version number return 1 7 2
used in version information and names of jar files for example
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 archive listener null session add command test listener null session execute
executes the project commands failing if any of those commands
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 archive feature get project archive 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
private scp task create scp task string tar path project get archive feature get project archive get archive 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
public assemble task get assemble task return assemble task
the ant task responsible for creating the jar during the call to
public void release string user name string password standard project delegate project get delegate show summary delegate delegate get archive feature get classes archive create archives delegate get junit feature junit delegate get archive feature get project archive create archive false true delegate get verify tar feature verify tar verify proto resources string summary better support for multiple jars string labels type archive op sys all featured string google name project get project name src tar gz delegate get upload google code feature upload tar user name password google name labels summary
convenient short hand for invoking the assemble javadocs test tar
public string get lib excludes pattern string lib dir name layout get lib dir get name return string format s s jar s s jar s src jar lib dir name parent get javadoc postfix lib dir name parent get source postfix lib dir name
the pattern used to filter out source and javadoc jar files from directly
public void execute assert assert true archive exists array list string resources new array list string jar file jar file new jar file archive enumeration jar entry entries jar file entries while entries has more elements jar entry entry entries next element resources add entry get name if included resources null for string resource included resources assert assert true resources contains resource if excluded resources null for string resource excluded resources assert assert false resources contains resource manifest jar file get manifest
asserts that the given jar file exists and contains or does not contain
public void init tar string name string prefix init tar name prefix null null null
convenient wrapper when just the default tar is required with no
public void create archives get classes archive create archives get javadoc archive create archives get source archive create archives
convenience method that creates all of the scheduled archives