dev-java/openjfx: drop old
[gentoo.git] / dev-java / jsoup / jsoup-1.8.3.ebuild
1 # Copyright 1999-2018 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI="5"
5
6 JAVA_PKG_IUSE="doc source test"
7
8 inherit java-pkg-2 java-pkg-simple
9
10 MY_PV="${PV}a"
11 MY_P="${PN}-${PN}-${MY_PV}"
12
13 DESCRIPTION="Java HTML parser that makes sense of real-world HTML soup"
14 HOMEPAGE="https://jsoup.org/"
15 SRC_URI="https://github.com/jhy/${PN}/archive/${PN}-${MY_PV}.zip"
16
17 LICENSE="MIT"
18 SLOT="0"
19 KEYWORDS="amd64 x86 ~amd64-linux"
20
21 IUSE=""
22
23 RDEPEND=">=virtual/jre-1.6"
24 DEPEND=">=virtual/jdk-1.6
25         test? ( dev-java/junit:4 )"
26
27 S="${WORKDIR}/${MY_P}"
28
29 JAVA_SRC_DIR="src/main/java"
30
31 java_prepare() {
32         rm pom.xml || die
33         mkdir -p target/classes/org/jsoup/nodes/ || die
34         cp src/main/java/org/jsoup/nodes/*.properties target/classes/org/jsoup/nodes/ || die
35 }
36
37 src_test() {
38         testcp="${S}/${PN}.jar:$(java-pkg_getjars junit-4):target/tests"
39
40         mkdir target/tests || die
41         ejavac -cp "${testcp}" -d target/tests $(find src/test/java -name "*.java")
42         cp -r src/test/resources/* target/tests || die
43
44         tests=$(find target/tests -name "*Test.class" \
45                         | sed -e 's/target\/tests\///g' -e "s/\.class//" -e "s/\//./g" \
46                         | grep -vP '\$');
47         ejunit4 -cp "${testcp}" ${tests}
48 }