ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From <Jan.Mate...@rzf.fin-nrw.de>
Subject AW: ProjectHelper (was Re: EasyAnt project)
Date Thu, 30 Oct 2008 09:55:02 GMT
>My "build file" is going to look like this (I'm making up half of it):
>
>@Project(Name="example", DefaultTarget="echo")
>public class BuildFile extends JavaFrontBuildFile {
>    public BuildFile(Project p) {
>        super(p);
>    }
>
>    @Target
>    public void echo() {
>        getProject().log("Hello world");
>    }
>
>    @Target(Name="-setproperty")
>    public void setProperty() {
>        taskBuilder().newProperty().withName("world").andValue("world")
>          .execute();
>    }
>
>    @Target(Depends="-setproperty")
>    public void moreComplexExample() {
>        taskBuilder().newEcho().withMessage("Hello
${world}").execute();
>    }
>}


Looks like Leafcutter: https://leafcutter.dev.java.net/

<target name="backup" depends="init" if="backup.enabled">
   <property name="source.dir" value="src/main"/>
   <copy todir="home/backups" verbose=true>
      <fileset dir=${source.dir}" includes="**/*.txt"/>
   </copy>
</target>

public void backup(boolean enabled){
   init();
   if (enabled){
      File sourceDir = new File("src/main");
      TaskRunner.run("copy todir=home/backups verbose=true (fileset
dir=${1} includes=**/*.txt)", sourceDir);
   }
}


Jan

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org


Mime
View raw message