# Copyright 1999-2004 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # $Header: /var/cvsroot/gentoo-x86/dev-java/hibernate/hibernate-2.1.6.ebuild,v 1.1 2004/08/11 14:47:35 voxus Exp $ inherit java-pkg DESCRIPTION="A collection of classes that are helpful when writing JUnit test cases." SRC_URI="mirror://sourceforge/${PN}/${P}.zip" HOMEPAGE="http://gsbase.sourceforge.net" LICENSE="GSBASE-1.0" SLOT="0" KEYWORDS="~amd64" RDEPEND=" >=virtual/jre-1.4 dev-java/junit " DEPEND=">=virtual/jdk-1.4 " IUSE="doc junit jikes" S=${WORKDIR} src_unpack() { unpack ${A} rm -r docs/apidocs/* cd lib rm *.jar java-pkg_jar-from junit } src_compile() { classes="${S}/build/classes" testclasses="${S}/build/test" mkdir -p ${classes} mkdir -p ${testclasses} javac_cmd="javac" use jikes && javac_cmd="jikes -bootclasspath ${JAVA_HOME}/jre/lib/rt.jar" CLASSPATH="${CLASSPATH}:${S}/lib/junit.jar:${classes}" cd src/java einfo "Compiling source files..." ${javac_cmd} -classpath ${CLASSPATH} -nowarn -d ${classes} \ `find -name "*.java"` || die "Failed to compile ${i}" cd ${S} if use junit ; then cd src/test einfo "Compiling test source files..." ${javac_cmd} -classpath ${CLASSPATH} -nowarn -d ${testclasses} \ `find -name "*.java"` || die "Failed to compile ${i}" cd ${testclasses} einfo "Running tests..." # Note that the tests in the gui package and in the # DocumentUtilTest require access to X. These are not # run, as X is not normally accessable to the effective user # running portage (root or portage). for i in `find -name "*Test.class" | sed -e "s/\.\///g" \ -e "s/\.class//g" -e "s/\//./g" -e "/gui/d" \ -e "/DocumentUtilTest/d"` ; do java junit.textui.TestRunner $i || die "jUnit test failed" done fi einfo "Building jar file..." cd ${S} jar cf lib/${PN}.jar -C ${classes} . || die "Failed to build jar file" if use doc ; then cd ${S} einfo "Building documentation..." javadoc -quiet -d docs/apidocs -sourcepath src/java \ `find src/java/com -type d | sed -e "s/src\/java\///g" \ -e "s/\//./g" -e "/com$/d" -e "/software$/d" -e "/base$/d"`\ || die "Failed to build documentation" fi } src_install() { java-pkg_dojar lib/${PN}.jar dodoc *.txt use doc && dohtml -r docs }