java-ant-2.eclass
Description
Eclass for Ant-based Java packages. Provides support for both automatic and
manual manipulation of build.xml files. Should be inherited after
java-pkg-2
or java-pkg-opt-2
eclass.
Functions
- java-ant-2_src_configure
-
src_configure
rewrites thebuild.xml
files automatically, unless EAPI is undefined, 0 or 1. - java-ant_bsfix_files <path/to/first/build.xml> [path/to/second.build.xml ...]
-
Attempts to fix named build files.
Affected by variables:
-
JAVA_PKG_BSFIX_SOURCE_TAGS
-
JAVA_PKG_BSFIX_TARGET_TAGS
-
JAVA_ANT_REWRITE_CLASSPATH
-
JAVA_ANT_JAVADOC_INPUT_DIRS
: Where we can find java sources for javadoc input. Can be a space separated list of directories -
JAVA_ANT_BSFIX_EXTRA_ARGS
: You can use this to pass extra variables to the rewriter if you know what you are doing.
If
JAVA_ANT_JAVADOC_INPUT_DIRS
is set, we will turn on the adding of a basicjavadoc
target to the ant'sbuild.xml
with thejavadoc xml-rewriter
feature. Then we will setEANT DOC TARGET
to the addedjavadoc
target.NOTE: the variable
JAVA_ANT_JAVADOC_OUTPUT_DIR
points where we will generate the javadocs. This is a read-only variable, don't change it. -
- java-ant_bsfix_one <path/to/build.xml>
-
Attempts to fix named build file.
Affected by variables:
-
JAVA_PKG_BSFIX_SOURCE_TAGS
-
JAVA_PKG_BSFIX_TARGET_TAGS
-
- java-ant_rewrite-classpath [path/to/build.xml]
-
Adds
classpath="${gentoo.classpath}"
to specified build file.Affected by:
-
JAVA_ANT_CLASSPATH_TAGS
Parameter defaults to
build.xml
when not specified -
- java-ant_ignore-system-classes [path/to/build.xml]
-
Makes the available task ignore classes in the system classpath Parameter defaults to
build.xml
when not specified - java-ant_xml-rewrite <xml rewriter arguments>
-
Run the right xml-rewrite binary with the given arguments
- java-ant_rewrite-bootclasspath <version> [path/to/build.xml] [prepend] [append]
-
Adds
bootclasspath
to javac-like tasks inbuild.xml
filled with jars ofabootclasspath
package of given version.Affected by:
-
JAVA_PKG_BSFIX_TARGET_TAGS
- the tags of javac tasks
Parameters:
-
<version>
- the version ofbootclasspath
(e.g. 1.5),auto
forbootclasspath
of the current JDK -
[path/to/build.xml]
- path to desiredbuild.xml
file, defaults tobuild.xml
-
[prepend]
(optional) - what to prepend thebootclasspath
with (to override) -
[append]
(optional) - what to append to thebootclasspath
-
Variables
- WANT_ANT_TASKS
-
An
${IFS}
separated list of ant tasks.Ebuild can specify this variable before inheriting
java-ant-2.eclass
to determineANT_TASKS
it needs. They will be automatically translated toDEPEND
variable andANT_TASKS
variable.JAVA_PKG_FORCE_ANT_TASKS
can overrideANT_TASKS
set byWANT_ANT_TASKS
, but not theDEPEND
due to caching.Ebuilds that need to depend conditionally on certain tasks and specify them differently for different
eant
calls can't use this simplified approach. You also cannot specify version or anything else thanant-*
.WANT_ANT_TASKS="ant-junit ant-trax"
- JAVA_ANT_DISABLE_ANT_CORE_DEP
-
Setting this variable non-empty before inheriting
java-ant-2
disables addingdev-java/ant-core
intoDEPEND
. - JAVA_PKG_BSFIX = ${JAVA_PKG_BSFIX:-"on"}
-
Should we attempt to 'fix' ant build files to include the source/target attributes when calling
javac
? - JAVA_PKG_BSFIX_ALL = ${JAVA_PKG_BSFIX_ALL:-"yes"}
-
If we're fixing build files, should we try to fix all the ones we can find?
- JAVA_PKG_BSFIX_NAME = ${JAVA_PKG_BSFIX_NAME:-"build.xml"}
-
Filename of build files to fix/search for
- JAVA_PKG_BSFIX_TARGET_TAGS = ${JAVA_PKG_BSFIX_TARGET_TAGS:-"javac xjavac javac.preset"}
-
Targets to fix the
source
attribute in - JAVA_PKG_BSFIX_SOURCE_TAGS = ${JAVA_PKG_BSFIX_SOURCE_TAGS:-"javadoc javac xjavac javac.preset"}
-
Targets to fix the
target
attribute in - JAVA_ANT_CLASSPATH_TAGS = "javac xjavac"
-
Targets to add the
classpath
attribute to - JAVA_ANT_IGNORE_SYSTEM_CLASSES
-
When set,
<available>
Ant tasks are rewritten to ignore Ant's runtime classpath.
Reporting Bugs
Please report bugs via https://bugs.gentoo.org/