This document lists changes made to the NetBeans
Ant module APIs. Please ask on the nbdev@netbeans.org
mailing list if you have any questions.
Fuller descriptions of all changes can be found below (follow links).
Not all deprecations are listed here, assuming that the deprecated APIs continue to essentially work. For a full deprecation list, please consult the Javadoc.
IntrospectedInfo
no longer serializable
AntProjectCookie
no longer guaranteed serializable
ant/nblib/*.jar
changed to use antlib.xml
AntTargetExecutor.Env
AntTargetExecutor.Env
AntTargetExecutor.Env.setConcealedProperties
TargetLister.Script
is now returning information about parse exception
TargetLister.Target.getOriginatingScript
AntSession.getProperties
AntSession.getIO
AntScriptUtils
IntrospectedInfo
no longer serializable
TargetLister
AntProjectCookie
no longer guaranteed serializable
AntOutputStream
should be passed URL
not FileObject
ActionUtils
AntOutputStream.formatMessage
AutomaticExtraClasspathProvider
ant/nblib/*.jar
changed to use antlib.xml
IntrospectedInfo.getTags(String)
added
IntrospectedInfo.getKnownInfo()
added
These API specification versions may be used to indicate that a module requires a certain API feature in order to function. For example, if you see here a feature you need which is labelled 1.20, your manifest should contain in its main attributes the line:
OpenIDE-Module-Module-Dependencies: org.apache.tools.ant.module/3 > 1.20
AntTargetExecutor.Env
AntTargetExecutor.Env
AntTargetExecutor.Env.setConcealedProperties
TargetLister.Script
is now returning information about parse exception
TargetLister.Target.getOriginatingScript
AntSession.getProperties
AntSession.getIO
AntScriptUtils
IntrospectedInfo
no longer serializable
TargetLister
AntProjectCookie
no longer guaranteed serializable
AntOutputStream
should be passed URL
not FileObject
ActionUtils
AntOutputStream.formatMessage
AutomaticExtraClasspathProvider
ant/nblib/*.jar
changed to use antlib.xml
IntrospectedInfo.getTags(String)
added
IntrospectedInfo.getKnownInfo()
added
org.apache.tools.ant.module.api.support.ActionUtils
AntTargetExecutor.Env.setConcealedProperties
ActionUtils
org.apache.tools.ant.module.spi.AntEvent
org.apache.tools.ant.module.spi.AntLogger
org.apache.tools.ant.module.spi.AntOutputStream
AntOutputStream
should be passed URL
not FileObject
AntOutputStream.formatMessage
org.apache.tools.ant.module.api.AntProjectCookie
AntProjectCookie
no longer guaranteed serializable
org.apache.tools.ant.module.api.support.AntScriptUtils
AntScriptUtils
org.apache.tools.ant.module.spi.AntSession
AntTargetExecutor.Env.setConcealedProperties
AntSession.getProperties
AntSession.getIO
org.apache.tools.ant.module.api.AntTargetCookie
org.apache.tools.ant.module.api.AntTargetExecutor
AntTargetExecutor.Env
AntTargetExecutor.Env
AntTargetExecutor.Env.setConcealedProperties
org.apache.tools.ant.module.spi.AutomaticExtraClasspathProvider
AutomaticExtraClasspathProvider
org.apache.tools.ant.module.api.DefinitionRegistry
org.apache.tools.ant.module.api.IntrospectedInfo
IntrospectedInfo
no longer serializable
IntrospectedInfo.getTags(String)
added
IntrospectedInfo.getKnownInfo()
added
org.apache.tools.ant.module.api.support.TargetLister
TargetLister.Script
is now returning information about parse exception
TargetLister.Target.getOriginatingScript
TargetLister
org.apache.tools.ant.module.spi.TaskStructure
AntTargetExecutor.Env
AntTargetExecutor
; made by: tzezula
Added a method AntTargetExecutor.Env.setUserAction
to mark an execution as user / non-user.
The executions marked as user actions are registered in the UI support
org.netbeans.spi.project.ui.support.BuildExecutionSupport
. By default the execution is an user action.
AntTargetExecutor.Env
AntTargetExecutor
; made by: tzezula
When the IDE is set to the automatic close tabs mode the tabs created by the previous
run of the AntTargetExecutor
are closed by successive run.
Added a support to override this behavior.
AntTargetExecutor.Env.setConcealedProperties
ActionUtils
AntTargetExecutor
AntSession
; made by: tzezula
Added ability to hide property values. Such properties can be used to pass passwords from the IDE keyring to ant scripts.
TargetLister.Script
is now returning information about parse exception
TargetLister
; made by: mkozeny; issues:
#57677
TargetLister.Script
constructor is now returning information about parse exception, when parsing of document fails.
TargetLister.Target.getOriginatingScript
TargetLister
; made by: jglick; issues:
#207192
Added ability to get originating script for a Target
.
AntSession.getProperties
AntSession
; made by: jglick; issues:
#206161
Added ability to get user properties defined for a build.
AntSession.getIO
AntSession
; made by: jglick; issues:
#124366
Added ability to get the underlying InputOutput
object for advanced formatting.
AntScriptUtils
AntScriptUtils
; made by: jglick; issues:
#136597
Added a new convenience class for getting some common information from Ant scripts.
AntEvent
; made by: jglick; issues:
#128778
The AntEvent
methods getProperty
and
getPropertyNames
can now work with Ant references
as well as plain properties. This is critical for loggers which
wish to inspect e.g. the runtime value of a classpath given as:
<classpath refid="my.cp"/>
which otherwise would be inaccessible.
Properties of the same name take precedence over references, so only code which relied on a property name not being set would see different behavior.
IntrospectedInfo
no longer serializable
IntrospectedInfo
; made by: jglick; issues:
#87114
As part of a switch to the Preferences API, this class no longer needs to be serialized.
Any clients which were attempting to serialize IntrospectedInfo
objects will no longer be able to. No one should have been doing this to
begin with; the class was offered to API clients for inspection in a given
Ant session, but serialization was handled by the Ant module implementation.
AutomaticExtraClasspathProvider
; made by: jtulach; issues:
#77489
AutomaticExtraClasspathProvider
can now be
created in a declarative way. So libraries that wish to
provide such Ant extension may just do it in declarative
way without depending on AutomaticExtraClasspathProvider
class.
You may now extend the Ant main node's context menu using the
layer context Loaders/text/x-ant+xml/Actions
.
ActionUtils
; made by: tzezula; issues:
#51132
The current ActionUtils.antIncludeList (FileObject[] files, FileObject dir) generates a recursive include list for directories. The API change introduces new ActionUtils.antIncludeList (FileObject[] files, FileObject dir, boolean recursive) which generates either recursive or non recursive include depending on the value of the recursive parameter. The old method is bridged into the new one.
AntLogger
AntSession
AntEvent
TaskStructure
AntOutputStream
; made by: jglick; issues:
#42525
Added a new SPI for influencing the logging behavior of Ant. See Javadoc for details.
AntOutputStream
was obsoleted by this change.
TargetLister
TargetLister
; made by: jglick; issues:
#21728
#36320
#42901
The TargetLister
class was added to make it easier
to implement target-related UI without needing to duplicate logic
relating to <import>
.
AntProjectCookie
no longer guaranteed serializable
AntProjectCookie
; made by: jglick
AntProjectCookie
used to be serializable. This was
used to persist build script information associated with service
types. Now that these types are gone, the raison d'être for the
serializability is also gone.
Incompatible for anyone expecting to serialize them.
AntOutputStream
should be passed URL
not FileObject
AntOutputStream
; made by: jglick; issues:
#42666
Formerly AntOutputStream
was passed a FileObject
parameter in writeLine
. However that was potentially
inefficient as it required a FileObject
to be created for
each hyperlink, if it was never activated. The former writeLine
method has been deprecated and subclasses should now override the new
variant that takes URL
(and should return true
).
Old subclasses of AntOutputStream
should continue
to work unmodified. But new subclasses which override the new
method taking URL must return true
so that the
old method is not called. The old method is now non-final but
cannot be called. The new method is non-final but should be
treated as abstract.
ActionUtils
ActionUtils
; made by: jglick
The utility class ActionUtils
was added to help
implement actions based on Ant targets. Previously it was in
the Ant Project SPI.
AntOutputStream.formatMessage
AntOutputStream
; made by: jglick
This method is no longer called due to changes in how Ant output formatting is handled, so it is deprecated.
AutomaticExtraClasspathProvider
AutomaticExtraClasspathProvider
; made by: jglick
A new SPI interface
AutomaticExtraClasspathProvider
was added in
order to make it possible to include bundled libraries such
as junit.jar
in Ant's main classpath without
user intervention.
ant/nblib/*.jar
changed to use antlib.xml
ant/nblib/*.jar
taskdef (or typedef) JARs must now
be named according to the code name base of the module, and must
define their tasks (or types etc.) using the standard
antlib.xml
syntax rather than
META-INF/taskdefs.properties
and/or
META-INF/typedefs.properties
.
IntrospectedInfo.getTags(String)
added
IntrospectedInfo
; made by: jglick; issues:
#37111
IntrospectedInfo
now keeps information about the tag values
represented by EnumeratedAttribute
subclasses, so it is not
necessary to load the runtime class just for this information.
IntrospectedInfo
org.apache.tools.ant.module.api.DefinitionRegistry
org.apache.tools.ant.module.api.AntTargetCookie
; made by: jglick; issues:
#20211
The Ant module was partially refactored to permit the actual Ant installation to be user-selectable and modifiable at runtime, plus to use an independent class loader with its own classpath for running Ant in. This necessitated some structural changes in the public APIs.
Modules which registered automatic task definitions will need to be
changed to use the new API. Typically such tasks run only inside the
NetBeans VM, do not need a <taskdef>, and make use
of API calls into NetBeans modules. Other uses of the Ant module—for
example, calls to AntTargetExecutor
—are unlikely to
be affected by the change.
There are several incompatible changes here:
All previously deprecated methods and classes were removed as a cleanup measure.
Registration of VM-internal (NetBeans-specific) tasks changed.
Rather than using DefinitionRegistry
and Lookup,
task JARs are placed in a well-known location.
Modules depending on the Ant module can no longer refer to Ant classes directly, i.e. they are no longer exported from the Ant module class loader.
IntrospectedInfo.scanProject
changed its
parameter from Project
to Map
.
The major release version changed from 2 to 3. Modules which are unaffected by the above changes may elect to depend on either version: org.apache.tools.ant.module/2-3.
AntTargetExecutor
; made by: dkonecny
AntOutputStream
; made by: dkonecny
file_name : line_column : error_description
it will parse the information and finds FileObject for the file_name.
IntrospectedInfo.getKnownInfo()
added
IntrospectedInfo
; made by: jglick
AntProjectCookie
; made by: dkonecny; issues:
#24213