summaryrefslogtreecommitdiff
path: root/dev-java/jakarta-mail-api/jakarta-mail-api-2.1.3.ebuild
blob: 211be5f49336271da26a353855e8f142c7e8fe85 (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 1999-2024 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.3"
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 arm64 ppc64"

DEPEND="
	dev-java/jakarta-activation-api:2
	>=virtual/jdk-11:*
	test? (
		dev-java/angus-activation: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() {
	# bug #853151 - copying from target/classes as a workaraound
	# handing of module-info.java in java-pkg-simple_src_test seems not aware of target/classes
	mkdir -p generated-test/jakarta/mail || die
	cp -r {target/classes,generated-test}/jakarta/mail/event || die
	cp -r {target/classes,generated-test}/jakarta/mail/util || die
	cp -r target/classes/jakarta/mail/Provider* generated-test/jakarta/mail || 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
}