# 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" src_unpack() { mkdir ${S} cd ${S} 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" export CLASSPATH="${CLASSPATH}:${S}/lib/junit.jar:${classes}" cd src/java einfo "Compiling source files..." javac -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 -nowarn -d ${testclasses} `find -name "*.java"` \ || die "Failed to compile ${i}" cd ${testclasses} einfo "Running tests..." ewarn " Note that if this process does not have access to X, some " ewarn " of these tests may fail with errors." java junit.textui.TestRunner com.gargoylesoftware.base.GSMainTestSuite 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"` || die "Failed to build documentation" fi } src_install() { cd ${S} java-pkg_dojar lib/${PN}.jar dodoc *.txt use doc && dohtml -r docs }