blob: afe445c69179c3f28beb40501b143bb62f22770d (
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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
|
# Copyright 1999-2025 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
JAVA_PKG_IUSE="doc source test"
JAVA_TESTING_FRAMEWORKS="junit-4"
MAVEN_ID="com.google.inject:guice:7.0.0"
inherit java-pkg-2 java-pkg-simple
DESCRIPTION="Guice is a lightweight dependency injection framework for Java 6 and above"
HOMEPAGE="https://github.com/google/guice"
# Currently we bundle these binary versions used only for tests, we don't install it.
TV="1.1.3" # with 1.4.4 there is an 'ambiguous' problem in EnhancedTest.
SRC_URI="https://github.com/google/${PN}/archive/${PV}.tar.gz -> ${P}.tar.gz
test? (
https://repo1.maven.org/maven2/com/google/truth/truth/${TV}/truth-${TV}.jar
https://repo1.maven.org/maven2/com/google/truth/extensions/truth-java8-extension/${TV}/truth-java8-extension-${TV}.jar
)"
S="${WORKDIR}/${P}/core"
LICENSE="Apache-2.0"
SLOT="0"
KEYWORDS="amd64 arm64"
CP_DEPEND="
dev-java/aopalliance:1
dev-java/injection-api:0
>=dev-java/asm-9.8-r1:0
>=dev-java/error-prone-annotations-2.41.0:0
>=dev-java/guava-33.4.8:0
dev-java/jsr305:0
"
DEPEND="
${CP_DEPEND}
>=virtual/jdk-1.8:*
test? (
>=dev-java/guava-testlib-33.4.8:0
dev-java/jakarta-inject-tck:0
dev-java/osgi-core:0
)
"
RDEPEND="
${CP_DEPEND}
>=virtual/jre-1.8:*
"
DOCS=( ../{COPYING,{CONTRIBUTING,README}.md} )
PATCHES=(
# this test passes with jdk 21 and lower
"${FILESDIR}/guice-7.0.0-skipFailingTest.patch"
)
JAVA_AUTOMATIC_MODULE_NAME="com.google.guice"
JAVA_SRC_DIR="src"
JAVA_TEST_GENTOO_CLASSPATH="guava-testlib jakarta-inject-tck junit-4 osgi-core"
JAVA_TEST_RESOURCE_DIRS="test"
JAVA_TEST_SRC_DIR="test"
src_prepare() {
default #780585
java-pkg-2_src_prepare
# line 99, pom.xml
rm test/com/googlecode/guice/OSGiContainerTest.java || die "remove OSGITest"
}
src_test() {
JAVAC_ARGS="-parameters"
# it needs java8-extension and the older versions
JAVA_GENTOO_CLASSPATH_EXTRA=":${DISTDIR}/truth-${TV}.jar"
JAVA_GENTOO_CLASSPATH_EXTRA+=":${DISTDIR}/truth-java8-extension-${TV}.jar"
# exclude tests not run by mvn test
JAVA_TEST_EXCLUDES=(
com.google.inject.AllTests
com.google.inject.ScopesTest
com.google.inject.TypeConversionTest
)
# line 111, pom.xml
JAVA_TEST_EXTRA_ARGS=(
-Dguice_custom_class_loading=ANONYMOUS
-XX:+UnlockDiagnosticVMOptions
-XX:+ShowHiddenFrames
)
java-pkg-simple_src_test
}
|