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
-
public class BndTask extends BaseTask
This file is the bnd main task for ant.
To define the task library, load property from
build.bndand 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
Report.Location
-
Nested classes/interfaces inherited from interface aQute.service.reporter.Reporter
Reporter.SetLocation
-
-
Field Summary
Fields Modifier and Type Field Description (package private) java.io.Filebasedirprivate org.apache.tools.ant.types.PathbndfilePath(package private) java.util.List<java.io.File>classpathprivate booleanclasspathDirectlySetprivate org.apache.tools.ant.types.PathclasspathReference(package private) java.lang.Stringcommand(package private) booleaneclipse(package private) static java.io.File[]EMPTY_FILES(package private) booleanexceptions(package private) booleanfailok(package private) java.util.List<java.io.File>files(package private) booleaninheritprivate static org.slf4j.Loggerlogger(package private) java.io.Fileoutput(package private) booleanprint(package private) java.util.List<java.io.File>sourcepath(package private) booleantest(package private) java.io.FiletestDir
-
Constructor Summary
Constructors Constructor Description BndTask()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description (package private) voidaddAll(java.util.List<java.io.File> list, java.lang.String files, java.lang.String separator)voidaddBndfiles(org.apache.tools.ant.types.Path path)voidaddClasspath(org.apache.tools.ant.types.Path path)private voidaddFilesFrom(org.apache.tools.ant.types.Path path, java.util.List<java.io.File> files)private voidassertPathNotSet(org.apache.tools.ant.types.Path path, java.lang.String message)private org.apache.tools.ant.types.PathcreatePath(org.apache.tools.ant.types.Reference r)voidexecute()private voidexecuteBackwardCompatible()(package private) booleanisFailok()(package private) booleanisPrint()voidsetBasedir(java.io.File basedir)Set the base directory of the project.voidsetBndfilePath(org.apache.tools.ant.types.Reference reference)voidsetClasspath(java.lang.String value)voidsetClasspathref(org.apache.tools.ant.types.Reference reference)voidsetCommand(java.lang.String command)voidsetDestFile(java.io.File output)voidsetEclipse(boolean eclipse)voidsetFailok(boolean failok)voidsetFiles(java.lang.String files)voidsetInherit(boolean inherit)voidsetOutput(java.io.File output)(package private) voidsetPrint(boolean print)voidsetSourcepath(java.lang.String sourcepath)voidsetTestDir(java.io.File testDir)(package private) java.io.File[]toFiles(java.util.List<java.io.File> files, java.lang.String what)private voidupdateBndFiles()private voidupdateClasspath()protected voidvalidate()validate required parameters before starting execution-
Methods 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
-
-
-
-
Field Detail
-
logger
private static final org.slf4j.Logger logger
-
command
java.lang.String command
-
basedir
java.io.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
java.util.List<java.io.File> files
-
classpath
java.util.List<java.io.File> classpath
-
sourcepath
java.util.List<java.io.File> sourcepath
-
output
java.io.File output
-
testDir
java.io.File testDir
-
eclipse
boolean eclipse
-
inherit
boolean inherit
-
EMPTY_FILES
static java.io.File[] EMPTY_FILES
-
-
Method Detail
-
execute
public void execute() throws org.apache.tools.ant.BuildException- Overrides:
executein classorg.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-
-
executeBackwardCompatible
private void executeBackwardCompatible() throws org.apache.tools.ant.BuildException- Throws:
org.apache.tools.ant.BuildException
-
setFiles
public void setFiles(java.lang.String files)
-
addAll
void addAll(java.util.List<java.io.File> list, java.lang.String files, java.lang.String separator)
-
setClasspath
public void setClasspath(java.lang.String value)
-
setEclipse
public void setEclipse(boolean eclipse)
-
isFailok
boolean isFailok()
-
setFailok
public void setFailok(boolean failok)
-
isPrint
boolean isPrint()
-
setPrint
void setPrint(boolean print)
-
setSourcepath
public void setSourcepath(java.lang.String sourcepath)
-
toFiles
java.io.File[] toFiles(java.util.List<java.io.File> files, java.lang.String what)
-
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)
-
createPath
private org.apache.tools.ant.types.Path createPath(org.apache.tools.ant.types.Reference r)
-
assertPathNotSet
private void assertPathNotSet(org.apache.tools.ant.types.Path path, java.lang.String message)
-
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
private void addFilesFrom(org.apache.tools.ant.types.Path path, java.util.List<java.io.File> files)
-
-