Package aQute.bnd.ant
Class BndTask
java.lang.Object
org.apache.tools.ant.ProjectComponent
org.apache.tools.ant.Task
aQute.bnd.ant.BaseTask
aQute.bnd.ant.BndTask
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:
-
Nested Class Summary
Nested classes/interfaces inherited from interface aQute.service.reporter.Report
Report.Location
Nested classes/interfaces inherited from interface aQute.service.reporter.Reporter
Reporter.SetLocation
-
Field Summary
FieldsModifier and TypeFieldDescription(package private) File
private org.apache.tools.ant.types.Path
private boolean
private org.apache.tools.ant.types.Path
(package private) String
(package private) boolean
(package private) static File[]
(package private) boolean
(package private) boolean
(package private) boolean
private static final org.slf4j.Logger
(package private) File
(package private) boolean
(package private) boolean
(package private) File
Fields inherited from class aQute.bnd.ant.BaseTask
errors, messages, onfail, pedantic, progress, properties, reporter, trace, warnings, workspaceProps
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 -
Method Summary
Modifier and TypeMethodDescription(package private) void
void
addBndfiles
(org.apache.tools.ant.types.Path path) void
addClasspath
(org.apache.tools.ant.types.Path path) private void
addFilesFrom
(org.apache.tools.ant.types.Path path, List<File> files) private void
assertPathNotSet
(org.apache.tools.ant.types.Path path, String message) private org.apache.tools.ant.types.Path
createPath
(org.apache.tools.ant.types.Reference r) void
execute()
private void
(package private) boolean
isFailok()
(package private) boolean
isPrint()
void
setBasedir
(File basedir) Set the base directory of the project.void
setBndfilePath
(org.apache.tools.ant.types.Reference reference) void
setClasspath
(String value) void
setClasspathref
(org.apache.tools.ant.types.Reference reference) void
setCommand
(String command) void
setDestFile
(File output) void
setEclipse
(boolean eclipse) void
setFailok
(boolean failok) void
void
setInherit
(boolean inherit) void
(package private) void
setPrint
(boolean print) void
setSourcepath
(String sourcepath) void
setTestDir
(File testDir) (package private) File[]
private void
private void
protected void
validate()
validate required parameters before starting executionMethods inherited from class aQute.bnd.ant.BaseTask
addProperty, addWsproperty, error, exception, getBndProject, getErrors, getFile, getLocation, getWarnings, isExceptions, isOk, isPedantic, isTrace, join, progress, report, report, setExceptions, setPedantic, setTrace, split, trace, warning
Methods inherited from class org.apache.tools.ant.Task
bindToOwner, getOwningTarget, getRuntimeConfigurableWrapper, getTaskName, getTaskType, getWrapper, handleErrorFlush, handleErrorOutput, handleFlush, handleInput, handleOutput, init, isInvalid, log, log, log, log, maybeConfigure, perform, reconfigure, setOwningTarget, setRuntimeConfigurableWrapper, setTaskName, setTaskType
Methods inherited from class org.apache.tools.ant.ProjectComponent
clone, getDescription, getLocation, getProject, setDescription, setLocation, setProject
-
Field Details
-
logger
private static final org.slf4j.Logger logger -
command
String command -
basedir
File basedir -
test
boolean test -
failok
boolean failok -
exceptions
boolean exceptions -
print
boolean print -
classpathDirectlySet
private boolean classpathDirectlySet -
classpathReference
private org.apache.tools.ant.types.Path classpathReference -
bndfilePath
private org.apache.tools.ant.types.Path bndfilePath -
files
-
classpath
-
sourcepath
-
output
File output -
testDir
File testDir -
eclipse
boolean eclipse -
inherit
boolean inherit -
EMPTY_FILES
-
-
Constructor Details
-
BndTask
public BndTask()
-
-
Method Details
-
execute
public void execute() throws org.apache.tools.ant.BuildException- Overrides:
execute
in classorg.apache.tools.ant.Task
- Throws:
org.apache.tools.ant.BuildException
-
setCommand
-
setBasedir
Set the base directory of the project. This property MUST be set.- Parameters:
basedir
-
-
executeBackwardCompatible
private void executeBackwardCompatible() throws org.apache.tools.ant.BuildException- Throws:
org.apache.tools.ant.BuildException
-
setFiles
-
addAll
-
setClasspath
-
setEclipse
public void setEclipse(boolean eclipse) -
isFailok
boolean isFailok() -
setFailok
public void setFailok(boolean failok) -
isPrint
boolean isPrint() -
setPrint
void setPrint(boolean print) -
setSourcepath
-
toFiles
-
setOutput
-
setDestFile
-
setTestDir
-
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) -
createPath
private org.apache.tools.ant.types.Path createPath(org.apache.tools.ant.types.Reference r) -
assertPathNotSet
-
validate
protected void validate()validate required parameters before starting execution- Throws:
org.apache.tools.ant.BuildException
- , if build is impossible
-
updateClasspath
private void updateClasspath() -
updateBndFiles
private void updateBndFiles() -
addFilesFrom
-