diff options
| author | Volkmar W. Pogatzki <gentoo@pogatzki.net> | 2023-10-12 13:07:32 +0200 |
|---|---|---|
| committer | Miroslav Šulc <fordfrog@gentoo.org> | 2025-09-25 13:19:22 +0200 |
| commit | 0eeebaf0348d55de8911b5632416255e13805eb1 (patch) | |
| tree | fdf80661aac150a7e34226d591f46096b012cf28 /dev-java | |
| parent | f85e06ced5b943b8900aa4d8c32d1669b0f22fa8 (diff) | |
| download | gentoo-0eeebaf0348d55de8911b5632416255e13805eb1.tar.gz gentoo-0eeebaf0348d55de8911b5632416255e13805eb1.tar.bz2 gentoo-0eeebaf0348d55de8911b5632416255e13805eb1.zip | |
dev-java/guice: add 7.0.0
- switches to default slot
- bundles pre-built jars of truth{,-java8-extension}-1.1.3
- skips one test which would otherwise fail with jdk 25 or higher
Signed-off-by: Volkmar W. Pogatzki <gentoo@pogatzki.net>
Part-of: https://github.com/gentoo/gentoo/pull/43492
Closes: https://github.com/gentoo/gentoo/pull/43492
Signed-off-by: Miroslav Šulc <fordfrog@gentoo.org>
Diffstat (limited to 'dev-java')
| -rw-r--r-- | dev-java/guice/Manifest | 3 | ||||
| -rw-r--r-- | dev-java/guice/files/guice-7.0.0-skipFailingTest.patch | 35 | ||||
| -rw-r--r-- | dev-java/guice/guice-7.0.0.ebuild | 94 |
3 files changed, 132 insertions, 0 deletions
diff --git a/dev-java/guice/Manifest b/dev-java/guice/Manifest index 0f624b6899a8..44fcbcc3c36f 100644 --- a/dev-java/guice/Manifest +++ b/dev-java/guice/Manifest @@ -1 +1,4 @@ DIST guice-5.1.0.tar.gz 650452 BLAKE2B 66c56b8605d189a3a6834a1de9ba6b7c6600583dfefa7808ae0b0b71d7f07746811a76326fc3ff56f2fd0d377f7bc3eb04d1c996ab2289eb48dff91d2f12b5f0 SHA512 b9719f07725c3188b8b903c8eee74ef59397f85f7452e38ef8ba2b3b66a56cef427d4dcee4e5d9c4033404a2f5cdadc2d40b6f7076b4c08fe1ec109910206e6a +DIST guice-7.0.0.tar.gz 662679 BLAKE2B a1eafc582d48c85fb61ed76d99cfa72fad8a503cb0c656b8db336be3ad3ec48b947ea2c952e39e6d3184f1791842ba5f27c28fd993f7b6dae4109cf7b7fed766 SHA512 777ca2bd06ab83f0167f194a84be293f33bbcbcd6cce449ecf98440c0d9f0f396791a7cbb5df262a41f21e07b94d0c58fda93d34d2f6d7bfe8c22a503d35f185 +DIST truth-1.1.3.jar 243021 BLAKE2B a59149038c62ef5dd352b13d4b393e1b7715fbafe5ed86ec2d16d722c738a31dcdca10132fc73b17b367ac4309e5407ba2e489f8d4c8fbca60ce5f35ae75d1e3 SHA512 f29a9fb070aff8a32358a7b6c8998c0095de5d8d68afa7f7bac759c7050309deff929e767657ecbbefd96163460f10255ca01bc567ab30df4834b9d916a4fae8 +DIST truth-java8-extension-1.1.3.jar 18122 BLAKE2B ca73ece34d5011e414e7603999287c37193fe69b19d72d181208cb943306a657a1506961404d2d44c4085fad1debcd7167031e5fafc932a03fe37a00085cb437 SHA512 7dbab8c67144b1fa16a23105d7c56b87b6936c92b7599fd7af24c4ce595c29d08ac1ba87f7786791bd64fe715ebfe96bf09a010bc2a6dc1844e61657c0a798c1 diff --git a/dev-java/guice/files/guice-7.0.0-skipFailingTest.patch b/dev-java/guice/files/guice-7.0.0-skipFailingTest.patch new file mode 100644 index 000000000000..c954de1e98f8 --- /dev/null +++ b/dev-java/guice/files/guice-7.0.0-skipFailingTest.patch @@ -0,0 +1,35 @@ +There was 1 failure: +1) testInterceptedMethodThrows(com.google.inject.MethodInterceptionTest) +org.junit.ComparisonFailure: expected:<invoke[]> but was:<invoke[Static]> + at org.junit.Assert.assertEquals(Assert.java:117) + at org.junit.Assert.assertEquals(Assert.java:146) + at com.google.inject.MethodInterceptionTest.testInterceptedMethodThrows(MethodInterceptionTest.java:311) + at java.base/java.lang.invoke.LambdaForm$DMH/0x000000003e09c000.invokeVirtual(LambdaForm$DMH) + at java.base/java.lang.invoke.LambdaForm$MH/0x000000003e09c800.invoke(LambdaForm$MH) + at java.base/java.lang.invoke.Invokers$Holder.invokeExact_MT(Invokers$Holder) + +FAILURES!!! +Tests run: 992, Failures: 1 + +Failure happens only with jdk 25 and higher. +With openjdk 21 the test passes. + +--- a/test/com/google/inject/MethodInterceptionTest.java ++++ b/test/com/google/inject/MethodInterceptionTest.java +@@ -53,6 +53,7 @@ import jakarta.inject.Named; + import org.aopalliance.intercept.MethodInterceptor; + import org.aopalliance.intercept.MethodInvocation; + import org.junit.Before; ++import org.junit.Ignore; + import org.junit.Test; + import org.junit.runner.RunWith; + import org.junit.runners.JUnit4; +@@ -283,7 +284,7 @@ public class MethodInterceptionTest { + assertSame(interceptor, extractedBinding.getInterceptors().get(0)); + } + +- @Test ++ @Test @Ignore + public void testInterceptedMethodThrows() throws Exception { + Injector injector = + Guice.createInjector( diff --git a/dev-java/guice/guice-7.0.0.ebuild b/dev-java/guice/guice-7.0.0.ebuild new file mode 100644 index 000000000000..6b3b13a973c4 --- /dev/null +++ b/dev-java/guice/guice-7.0.0.ebuild @@ -0,0 +1,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" + +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 +} |
