Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 92095 - added functionality to java-pkg.eclass for useflags and ant
Summary: added functionality to java-pkg.eclass for useflags and ant
Status: RESOLVED LATER
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Eclasses (show other bugs)
Hardware: All Linux
: High enhancement (vote)
Assignee: Java team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-05-10 02:32 UTC by Josh Nichols (RETIRED)
Modified: 2005-12-04 20:10 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Josh Nichols (RETIRED) gentoo-dev 2005-05-10 02:32:20 UTC
I've been working on some java ebuilds recently, and in src_compile functions, I have often seen code like:
        local antflags="jar" 
	if use jikes; then
		antflags="${antflags} -Dbuild.compiler=jikes"
	fi

	if use doc; then
		antflags="${antflags} javadoc"
	fi

	if use junit; then
		antflags="${antflags} test-all"
	fi

Now, I was thinking, it would be nice to have something similar to use_enable and use_with, that one can use with econf / ./configure

I don't think there is quite the variety of useflags that will come into play, so I think there could be specific functions for specific useflags, such as jikes, junit, and doc.

My suggestion would be to have functions such as (which were based on use_enable/use_with:

use_jikes() {
	local FLAG="jikes"
	if useq ${FLAG}; then
		echo "-Dbuild.compiler=jikes"
	fi
	return 0;
}

use_junit() {
	local FLAG="junit"
	local TARGET="${1:-test}"
	if useq "junit"; then
		echo "${TARGET}"
	fi
	return 0;
}

use_doc() {
	local TARGET=${1:-javadoc}
	if  useq "doc"; then
		echo "${TARGET}"
	fi
	return 0;
}

This would allow you to (assuming the right targets are there):

 ant ${use_jikes) $(use_junit) $(use_doc)

And even this would fairly common, so maybe something like eant could be effectively call the above funciton.

Reproducible: Always
Steps to Reproduce:
Comment 1 Josh Nichols (RETIRED) gentoo-dev 2005-12-04 20:10:34 UTC
This functionality exists more or less in axxo-overlay, so eventually it'll make
its way into portage.