Package aQute.bnd.ant

Class BaseTask

java.lang.Object
org.apache.tools.ant.ProjectComponent
org.apache.tools.ant.Task
aQute.bnd.ant.BaseTask
All Implemented Interfaces:
Report, Reporter, Cloneable
Direct Known Subclasses:
BndTask, DeployTask, EclipseTask, ExpandPropertiesTask, PackageTask, PrepareTask, ProjectBuildOrderTask, ProjectTask, ReleaseTask, RunBundlesTask, RunconfigToDistributionTask, TestTask, WrapTask

public class BaseTask extends org.apache.tools.ant.Task implements Reporter
  • Field Details

    • logger

      private static final org.slf4j.Logger logger
    • reporter

      ReporterAdapter reporter
    • errors

      List<String> errors
    • warnings

      List<String> warnings
    • progress

      List<String> progress
    • pedantic

      boolean pedantic
    • trace

      boolean trace
    • onfail

      String onfail
    • properties

      final List<org.apache.tools.ant.taskdefs.Property> properties
    • workspaceProps

      final List<org.apache.tools.ant.taskdefs.Property> workspaceProps
    • messages

      final AntMessages messages
    • exceptions

      boolean exceptions
  • Constructor Details

    • BaseTask

      public BaseTask()
  • Method Details

    • report

      protected boolean report()
    • report

      protected boolean report(Reporter reporter)
    • getFile

      public static File getFile(File base, String file)
    • split

      protected List<String> split(String dependsOn, String string)
    • join

      protected String join(Collection<?> classpath, String string)
    • isPedantic

      public boolean isPedantic()
      Description copied from interface: Reporter
      The provider of the reporter wants pedantic reporting, meaning every possible warning should be reported.
      Specified by:
      isPedantic in interface Reporter
      Returns:
      if this is a pedantic reporter.
    • setPedantic

      public void setPedantic(boolean pedantic)
    • setTrace

      public void setTrace(boolean trace)
    • isTrace

      public boolean isTrace()
    • trace

      @Deprecated public void trace(String s, Object... args)
      Deprecated.
      Use SLF4J Logger.debug instead.
      Description copied from interface: Reporter
      Create a warning. Implementations must ensure that the given args are not prevented from garbage collecting. The args must have a proper toString method.
      Specified by:
      trace in interface Reporter
      Parameters:
      s - The format of the error
      args - The arguments of the error
    • addProperty

      public void addProperty(org.apache.tools.ant.taskdefs.Property property)
    • addWsproperty

      public void addWsproperty(org.apache.tools.ant.taskdefs.Property property)
    • isExceptions

      public boolean isExceptions()
    • setExceptions

      public void setExceptions(boolean exceptions)
    • getLocation

      public Report.Location getLocation(String msg)
      Description copied from interface: Report
      Return the errors for the given error or warning. Can return null.
      Specified by:
      getLocation in interface Report
      Parameters:
      msg - The message
      Returns:
      null or the location of the message
    • isOk

      public boolean isOk()
      Description copied from interface: Report
      Check if this report has any relevant errors that should make the run associated with this report invalid. I.e. if this returns false then the run should be disregarded.
      Specified by:
      isOk in interface Report
      Returns:
      true if this run should be disregarded due to errors
    • exception

      public Reporter.SetLocation exception(Throwable t, String format, Object... args)
      Description copied from interface: Reporter
      Dedicated message for an exception.
      Specified by:
      exception in interface Reporter
      Parameters:
      t - The exception
      format - The format of the message
      args - The arguments
    • error

      public Reporter.SetLocation error(String s, Object... args)
      Description copied from interface: Reporter
      Create an error. Implementations must ensure that the given args are not prevented from garbage collecting. The args must have a proper toString method.
      Specified by:
      error in interface Reporter
      Parameters:
      s - The format of the error
      args - The arguments of the error
      Returns:
      a SetLocation to set the location
    • getErrors

      public List<String> getErrors()
      Description copied from interface: Report
      Return the errors. This list must not be changed and may be immutable.
      Specified by:
      getErrors in interface Report
      Returns:
      the errors
    • getWarnings

      public List<String> getWarnings()
      Description copied from interface: Report
      Return the warnings. This list must not be changed and may be immutable.
      Specified by:
      getWarnings in interface Report
      Returns:
      the warnings
    • progress

      @Deprecated public void progress(float progress, String s, Object... args)
      Deprecated.
      Use SLF4J Logger.info() instead.
      Description copied from interface: Reporter
      Create a warning. Implementations must ensure that the given args are not prevented from garbage collecting. The args must have a proper toString method.
      Specified by:
      progress in interface Reporter
      Parameters:
      progress - A value between 0 and 1 indicating the progress. 0 is starting and >=1 is done.
      s - The format of the error
      args - The arguments of the error
    • warning

      public Reporter.SetLocation warning(String s, Object... args)
      Description copied from interface: Reporter
      Create a warning. Implementations must ensure that the given args are not prevented from garbage collecting. The args must have a proper toString method.
      Specified by:
      warning in interface Reporter
      Parameters:
      s - The format of the error
      args - The arguments of the error
      Returns:
      a SetLocation to set the location