Package aQute.bnd.ant

Class BndTask

  • All Implemented Interfaces:
    aQute.service.reporter.Report, aQute.service.reporter.Reporter, java.lang.Cloneable

    public class BndTask
    extends BaseTask

    This file is the bnd main task for ant.

    To define the task library, load property from build.bnd and prepare the workspace:

      <target name="init" unless="initialized"> <taskdef
     classpath="${path.to.bnd.jar}"
     resource="aQute/bnd/ant/taskdef.properties"> <bndprepare
     basedir="${projectdir}" print="false" top="${release.dir}"/> <property
     name="initialized" value="set"/> </target>
     

    To recursively build dependency projects, before building this project:

     <target name="dependencies" depends="init" if="project.dependson"
     unless="donotrecurse"> <subant target="build" inheritAll="false"
     buildpath="${project.dependson}"> <property name="donotrecurse"
     value="true"/> </subant> </target>
     

    To build a bundle:

      <target name="build" depends="compile"> <mkdir
     dir="${target}"/> <bnd command="build" exceptions="true"
     basedir="${project}"/> </target>
     

    To pass properties into bnd from ANT:

      <target name="build" depends="compile">
     <mkdir dir="${target}"/> <bnd command="build" exceptions="true"
     basedir="${project}"> <!-- Property will be set on the bnd Project:
     --> <property name="foo" value="bar"/> <!-- Property will be set
     on the bnd Workspace: --> <wsproperty name="foo" value="bar"/>
     </bnd> </target>
     
    See Also:
    DeployTask, ReleaseTask
    • Nested Class Summary

      • Nested classes/interfaces inherited from interface aQute.service.reporter.Report

        aQute.service.reporter.Report.Location
      • Nested classes/interfaces inherited from interface aQute.service.reporter.Reporter

        aQute.service.reporter.Reporter.SetLocation
    • Field Summary

      • Fields inherited from class org.apache.tools.ant.Task

        target, taskName, taskType, wrapper
      • Fields inherited from class org.apache.tools.ant.ProjectComponent

        description, location, project
    • Constructor Summary

      Constructors 
      Constructor Description
      BndTask()  
    • Constructor Detail

      • BndTask

        public BndTask()
    • Method Detail

      • execute

        public void execute()
                     throws org.apache.tools.ant.BuildException
        Overrides:
        execute in class org.apache.tools.ant.Task
        Throws:
        org.apache.tools.ant.BuildException
      • setCommand

        public void setCommand​(java.lang.String command)
      • setBasedir

        public void setBasedir​(java.io.File basedir)
        Set the base directory of the project. This property MUST be set.
        Parameters:
        basedir -
      • setFiles

        public void setFiles​(java.lang.String files)
      • setClasspath

        public void setClasspath​(java.lang.String value)
      • setEclipse

        public void setEclipse​(boolean eclipse)
      • setFailok

        public void setFailok​(boolean failok)
      • setSourcepath

        public void setSourcepath​(java.lang.String sourcepath)
      • setOutput

        public void setOutput​(java.io.File output)
      • setDestFile

        public void setDestFile​(java.io.File output)
      • setTestDir

        public void setTestDir​(java.io.File testDir)
      • setInherit

        public void setInherit​(boolean inherit)
      • setClasspathref

        public void setClasspathref​(org.apache.tools.ant.types.Reference reference)
      • setBndfilePath

        public void setBndfilePath​(org.apache.tools.ant.types.Reference reference)
      • addClasspath

        public void addClasspath​(org.apache.tools.ant.types.Path path)
      • addBndfiles

        public void addBndfiles​(org.apache.tools.ant.types.Path path)
      • validate

        protected void validate()
        validate required parameters before starting execution
        Throws:
        org.apache.tools.ant.BuildException - , if build is impossible