summaryrefslogtreecommitdiff
blob: 2b36a365fe8583dcd76c2935540ed4c48441942b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
# Copyright 2023 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

EAPI=8

JAVA_PKG_IUSE="doc source test"
MAVEN_ID="org.apache.felix:org.apache.felix.gogo.runtime:${PV}"
JAVA_TESTING_FRAMEWORKS="junit-4"

inherit java-pkg-2 java-pkg-simple verify-sig

DESCRIPTION="Apache Felix Gogo Runtime"
HOMEPAGE="https://felix.apache.org/documentation/subprojects/apache-felix-gogo.html"
SRC_URI="mirror://apache/felix/org.apache.${PN//-/.}-${PV}-source-release.tar.gz -> ${P}.tar.gz
	verify-sig? ( https://dlcdn.apache.org/felix/org.apache.${PN//-/.}-${PV}-source-release.tar.gz.asc -> ${P}.tar.gz.asc )"
S="${WORKDIR}/org.apache.felix.gogo.runtime-${PV}"

LICENSE="Apache-2.0"
SLOT="0"
KEYWORDS="~amd64"

CP_DEPEND="
	dev-java/osgi-annotation:0
	dev-java/osgi-cmpn:8
	dev-java/osgi-core:0
"
DEPEND="${CP_DEPEND}
	>=virtual/jdk-1.8:*
	test? (
		dev-java/mockito:2
	)
"
RDEPEND="${CP_DEPEND}
	>=virtual/jre-1.8:*
"

BDEPEND="verify-sig? ( sec-keys/openpgp-keys-apache-felix )"
VERIFY_SIG_OPENPGP_KEY_PATH="${BROOT}/usr/share/openpgp-keys/felix.apache.org.asc"

JAVA_SRC_DIR="src/main/java"
JAVA_TEST_EXCLUDES=(
	#Invalid test class No runnable methods
	org.apache.felix.gogo.runtime.TestEvaluate
)
JAVA_TEST_GENTOO_CLASSPATH="
	junit-4
	mockito-2
"
JAVA_TEST_SRC_DIR="src/test/java"

src_test() {
	local vm_version="$(java-config -g PROVIDES_VERSION)"
	if ver_test "${vm_version}" -lt 11; then
		java-pkg-simple_src_test
	else
		# There was 1 failure:
		# 1) testPipe(org.apache.felix.gogo.runtime.TestParser)
		# org.junit.ComparisonFailure: expected:<[def]> but was:<[]>
		#         at org.junit.Assert.assertEquals(Assert.java:117)
		#         at org.junit.Assert.assertEquals(Assert.java:146)
		#         at org.apache.felix.gogo.runtime.TestParser.testPipe(TestParser.java:152)
		einfo "Tests would fail with Java 11 or higher"
	fi
}