summaryrefslogtreecommitdiff
blob: 9a5fec2d653a0230341691ca58073501d3365f6f (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
65
66
67
68
# Copyright 1999-2023 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

EAPI=8

JAVA_PKG_IUSE="doc source test"
MAVEN_ID="jakarta.mail:jakarta.mail-api:2.1.1"
JAVA_TESTING_FRAMEWORKS="junit-4"

inherit java-pkg-2 java-pkg-simple

DESCRIPTION="Jakarta Mail API 2.1 Specification API"
HOMEPAGE="https://jakartaee.github.io/mail-api/"
SRC_URI="https://github.com/jakartaee/mail-api/archive/${PV}.tar.gz -> ${P}.tar.gz"
S="${WORKDIR}/mail-api-${PV}/api"

LICENSE="EPL-1.0 EPL-2.0 GPL-2-with-classpath-exception"
SLOT="0"
KEYWORDS="amd64 ~arm arm64 ppc64 x86"

DEPEND="
	dev-java/jakarta-activation-api:2
	>=virtual/jdk-11:*
	test? (
		>=dev-java/angus-activation-1.0.0-r1:0
	)
"

RDEPEND=">=virtual/jre-1.8:*"

DOCS=( ../{CONTRIBUTING,NOTICE,README}.md )

JAVA_CLASSPATH_EXTRA="jakarta-activation-api-2"
JAVA_SRC_DIR="src/main/"

JAVA_TEST_GENTOO_CLASSPATH="junit-4,angus-activation"
JAVA_TEST_RESOURCE_DIRS="src/test/resources"
JAVA_TEST_SRC_DIR="src/test/java"

src_test() {
	rm src/test/java/module-info.java || die

	# There was 1 failure:
	# 1) doesNotExist(jakarta.mail.util.FactoryFinderTest)
	# java.lang.NullPointerException
	#         at jakarta.mail.util.FactoryFinderTest.doesNotExist(FactoryFinderTest.java:55)
	sed \
		-e '/import org.junit.Test/a import org.junit.Ignore;' \
		-e '/doesNotExist/i @Ignore' \
		-i src/test/java/jakarta/mail/util/FactoryFinderTest.java || die

	# These tests need to run separately, otherwise would fail
	JAVA_TEST_EXCLUDES=(
		jakarta.mail.internet.ContentDispositionNoStrictTest
		jakarta.mail.internet.WindowsFileNamesTest
		jakarta.mail.internet.AppleFileNamesTest
	)
	java-pkg-simple_src_test

	JAVA_TEST_RUN_ONLY="jakarta.mail.internet.ContentDispositionNoStrictTest"
	java-pkg-simple_src_test

	JAVA_TEST_RUN_ONLY="jakarta.mail.internet.WindowsFileNamesTest"
	java-pkg-simple_src_test

	JAVA_TEST_RUN_ONLY="jakarta.mail.internet.AppleFileNamesTest"
	java-pkg-simple_src_test
}