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_configurerewrites thebuild.xmlfiles 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_DIRSis set, we will turn on the adding of a basicjavadoctarget to the ant'sbuild.xmlwith thejavadoc xml-rewriterfeature. Then we will setEANT DOC TARGETto the addedjavadoctarget.NOTE: the variable
JAVA_ANT_JAVADOC_OUTPUT_DIRpoints 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.xmlwhen 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.xmlwhen 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
bootclasspathto javac-like tasks inbuild.xmlfilled with jars ofabootclasspathpackage of given version.Affected by:
-
JAVA_PKG_BSFIX_TARGET_TAGS- the tags of javac tasks
Parameters:
-
<version>- the version ofbootclasspath(e.g. 1.5),autoforbootclasspathof the current JDK -
[path/to/build.xml]- path to desiredbuild.xmlfile, defaults tobuild.xml -
[prepend](optional) - what to prepend thebootclasspathwith (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.eclassto determineANT_TASKSit needs. They will be automatically translated toDEPENDvariable andANT_TASKSvariable.JAVA_PKG_FORCE_ANT_TASKScan overrideANT_TASKSset byWANT_ANT_TASKS, but not theDEPENDdue to caching.Ebuilds that need to depend conditionally on certain tasks and specify them differently for different
eantcalls 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-2disables addingdev-java/ant-coreintoDEPEND. - 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
sourceattribute in - JAVA_PKG_BSFIX_SOURCE_TAGS = ${JAVA_PKG_BSFIX_SOURCE_TAGS:-"javadoc javac xjavac javac.preset"}
-
Targets to fix the
targetattribute in - JAVA_ANT_CLASSPATH_TAGS = "javac xjavac"
-
Targets to add the
classpathattribute 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/