gentoo/dev-java/jopt-simple/jopt-simple-4.3.ebuild

49 lines
1.1 KiB
Bash
Raw Normal View History

# Copyright 1999-2012 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: $
EAPI=2
COMMIT="6be54be"
JAVA_PKG_IUSE="doc source"
inherit java-pkg-2 java-pkg-simple
DESCRIPTION="A Java library for parsing command line options"
HOMEPAGE="http://pholser.github.com/jopt-simple/"
SRC_URI="https://github.com/pholser/${PN}/tarball/${P} -> ${P}.tar.gz"
LICENSE="MIT"
SLOT="0"
KEYWORDS="~amd64 ~x86"
IUSE=""
RESTRICT="test" # Needs org.infinitest.toolkit.
RDEPEND=">=virtual/jre-1.5"
DEPEND=">=virtual/jdk-1.5
test? ( dev-java/junit:4 )"
S="${WORKDIR}/pholser-${PN}-${COMMIT}"
JAVA_SRC_DIR="src/main/java"
java_prepare() {
# Easier to use java-pkg-simple.
rm -v pom.xml || die
}
src_install() {
java-pkg-simple_src_install
dodoc README.md || die
}
src_test() {
local CP="${DIR}:${PN}.jar:$(java-pkg_getjars junit-4)"
local TESTS=$(find src/test/java -name "*Test.java")
TESTS="${TESTS//src\/test\/java\/}"
TESTS="${TESTS//.java}"
TESTS="${TESTS//\//.}"
mkdir -p target/test || die
ejavac -cp "${CP}" -d target/test $(find src/test/java -name "*.java")
ejunit4 -classpath "${CP}" ${TESTS}
}