Revert "dev-java/tomcat-servlet-api: removed obsolete versions"
[gentoo.git] / dev-java / classmate / classmate-1.2.0.ebuild
1 # Copyright 1999-2018 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI=6
5
6 JAVA_PKG_IUSE="doc source test"
7
8 inherit java-pkg-2 java-pkg-simple
9
10 DESCRIPTION="Zero-dependency Java library for accurately introspecting type information"
11 HOMEPAGE="https://github.com/cowtowncoder/java-classmate/"
12 SRC_URI="https://github.com/cowtowncoder/java-classmate/archive/${P}.tar.gz"
13
14 LICENSE="Apache-2.0"
15 SLOT="0"
16 KEYWORDS="~amd64 ~x86"
17
18 RDEPEND="
19         >=virtual/jre-1.6"
20
21 DEPEND="
22         >=virtual/jdk-1.6
23         test? ( dev-java/junit:4 )"
24
25 S="${WORKDIR}/java-${PN}-${P}"
26
27 JAVA_SRC_DIR="src/main/java"
28
29 src_prepare() {
30         default
31         rm -v pom.xml \
32                 src/test/java/com/fasterxml/classmate/AnnotationsTest.java || die
33 }
34
35 src_test() {
36         testcp="${S}/${PN}.jar:$(java-pkg_getjars junit-4):target/tests"
37
38         mkdir target/tests || die
39         ejavac -cp "${testcp}" -d target/tests $(find src/test/java -name "*.java")
40
41         tests=$(find target/tests -name "*Test.class" -not -name "BaseTest.class" \
42                         | sed -e 's/target\/tests\///g' -e "s/\.class//" -e "s/\//./g" \
43                         | grep -vP '\$');
44         ejunit4 -cp "${testcp}" ${tests}
45 }