diff options
author | Volkmar W. Pogatzki <gentoo@pogatzki.net> | 2022-12-17 11:03:01 +0100 |
---|---|---|
committer | Florian Schmaus <flow@gentoo.org> | 2023-01-10 13:34:59 +0100 |
commit | f009c0f72f53cb67856eaa2ca7754537090de715 (patch) | |
tree | 4c68cf6531695611d5083086221bc55793f025d1 /dev-java | |
parent | dev-java/mockito: add 4.11.0 (diff) | |
download | gentoo-f009c0f72f53cb67856eaa2ca7754537090de715.tar.gz gentoo-f009c0f72f53cb67856eaa2ca7754537090de715.tar.bz2 gentoo-f009c0f72f53cb67856eaa2ca7754537090de715.zip |
dev-java/byte-buddy: add 1.12.21
Signed-off-by: Volkmar W. Pogatzki <gentoo@pogatzki.net>
Closes: https://github.com/gentoo/gentoo/pull/28269
Signed-off-by: Florian Schmaus <flow@gentoo.org>
Diffstat (limited to 'dev-java')
-rw-r--r-- | dev-java/byte-buddy/Manifest | 1 | ||||
-rw-r--r-- | dev-java/byte-buddy/byte-buddy-1.12.21.ebuild | 171 |
2 files changed, 172 insertions, 0 deletions
diff --git a/dev-java/byte-buddy/Manifest b/dev-java/byte-buddy/Manifest index e1bd929fde87..574c86acf6cb 100644 --- a/dev-java/byte-buddy/Manifest +++ b/dev-java/byte-buddy/Manifest @@ -1 +1,2 @@ DIST byte-buddy-1.12.18.tar.gz 1924438 BLAKE2B 278ac97d60e62c7d44142a01da94113b29b483bff532f08fca7e345f383a4ddf83cb8c4d0544bce1879bb26909d048a76562cd816c4e9cb06695127ed849f08c SHA512 637e041f97981b85cd13ffecb0de47206b5c99d8b98561561414d8a599f5d53a6e047ba3ad9bc88ca030125221df3ebe49d6eff18a4093f4027d8cbf34a483b0 +DIST byte-buddy-1.12.21.tar.gz 1931819 BLAKE2B 6b37b21d5f31c1564a3cc4d30870a7eca3c4c0512815db881a20602dc7ac970145dd9cc2bd6af4f2fdca0ff542b43dc675376c91f7ea7fdf3ea306112eba842b SHA512 9513caa9a5fc0924aea46e8de21ad2ad90320a582ad17be93f6305eb27f98d3af2c3fa09565083b5d97c0d9f0a1b0a9c7105738c4b65616e78bf2e7657c4ee76 diff --git a/dev-java/byte-buddy/byte-buddy-1.12.21.ebuild b/dev-java/byte-buddy/byte-buddy-1.12.21.ebuild new file mode 100644 index 000000000000..729dbe4351a9 --- /dev/null +++ b/dev-java/byte-buddy/byte-buddy-1.12.21.ebuild @@ -0,0 +1,171 @@ +# Copyright 1999-2023 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +# Skeleton command: +# java-ebuilder --generate-ebuild --workdir . --pom pom.xml --download-uri https://github.com/raphw/byte-buddy/archive/byte-buddy-1.12.21.tar.gz --slot 0 --keywords "~amd64 ~arm ~arm64 ~ppc64 ~x86" --ebuild byte-buddy-1.12.21.ebuild + +EAPI=8 + +JAVA_PKG_IUSE="doc source test" +MAVEN_PROVIDES="net.bytebuddy:byte-buddy-agent:1.12.21 net.bytebuddy:byte-buddy:1.12.21" +JAVA_TESTING_FRAMEWORKS="junit-4" + +inherit java-pkg-2 java-pkg-simple + +DESCRIPTION="Offers convenience for attaching an agent to the local or a remote VM" +HOMEPAGE="https://bytebuddy.net" +SRC_URI="https://github.com/raphw/byte-buddy/archive/${P}.tar.gz" + +LICENSE="Apache-2.0" +SLOT="0" +KEYWORDS="~amd64 ~arm ~arm64 ~ppc64 ~x86" + +DEPEND=" + >=virtual/jdk-11:* + dev-java/asm:9 + dev-java/findbugs-annotations:0 + dev-java/jna:4 + dev-java/jsr305:0 + test? ( + dev-java/mockito:4 + ) +" + +RDEPEND=">=virtual/jre-1.8:*" + +S="${WORKDIR}/byte-buddy-${P}" + +JAVA_CLASSPATH_EXTRA=" + asm-9 + findbugs-annotations + jsr305 + jna-4 +" + +src_prepare() { + default + # https://github.com/raphw/byte-buddy/blob/byte-buddy-1.12.20/byte-buddy-agent/pom.xml#L142-L176 + cat > byte-buddy-agent/src/main/java/module-info.java <<-EOF || die + module net.bytebuddy.agent { + requires java.instrument; + requires static jdk.attach; + requires static com.sun.jna; + requires static com.sun.jna.platform; + requires java.base; + exports net.bytebuddy.agent; + exports net.bytebuddy.agent.utility.nullability; + } + EOF + + # adjustment for recent mockito versions + sed \ + -e 's:verifyZeroInteractions:verifyNoInteractions:g' \ + -i byte-buddy-dep/src/test/java/net/bytebuddy/*.java \ + -i byte-buddy-dep/src/test/java/net/bytebuddy/*/*Test.java \ + -i byte-buddy-dep/src/test/java/net/bytebuddy/*/*/*Test.java \ + -i byte-buddy-dep/src/test/java/net/bytebuddy/*/*/*/*Test.java \ + -i byte-buddy-dep/src/test/java/net/bytebuddy/*/*/*/*/*Test.java \ + || die + + # instead of shading byte-buddy-dep we move it into byte-buddy. + mv byte-buddy{-dep,}/src/main/java || die "cannot move sources" + + # https://github.com/raphw/byte-buddy/blob/byte-buddy-1.12.20/byte-buddy/pom.xml#L159-L195 + local exports="$( \ + sed -n '/<packages.list.external>/,/<\/packages.list.external/p' \ + byte-buddy/pom.xml \ + | sed -e 's:^:exports :' -e 's:,:;:' \ + | grep -v 'packages.list.external\|shade' | tr -s '[:space:]' \ + )" || die + cat > byte-buddy/src/main/java/module-info.java <<-EOF || die + module net.bytebuddy { + requires static java.instrument; + requires static java.management; + requires static jdk.unsupported; + requires static net.bytebuddy.agent; + requires static com.sun.jna; + requires static com.sun.jna.platform; + requires java.base; + ${exports} + } + EOF +} + +src_compile() { + einfo "Compiling byte-buddy-agent.jar" + JAVA_JAR_FILENAME="byte-buddy-agent.jar" + JAVA_RESOURCE_DIRS="byte-buddy-agent/src/main/resources" + JAVA_SRC_DIR="byte-buddy-agent/src/main/java" + java-pkg-simple_src_compile + JAVA_GENTOO_CLASSPATH_EXTRA+=":byte-buddy-agent.jar" + rm -r target || die + + einfo "Compiling byte-buddy.jar" + JAVA_JAR_FILENAME="byte-buddy.jar" + JAVA_MAIN_CLASS="net.bytebuddy.build.Plugin\$Engine\$Default" + JAVA_RESOURCE_DIRS=() + JAVA_SRC_DIR="byte-buddy/src/main/java" + java-pkg-simple_src_compile + JAVA_GENTOO_CLASSPATH_EXTRA+=":byte-buddy.jar" + rm -r target || die + + if use doc; then + einfo "Compiling javadocs" + rm byte-buddy-agent/src/main/java/module-info.java || die + JAVA_SRC_DIR=( + "byte-buddy-agent/src/main/java" + "byte-buddy/src/main/java" + ) + JAVA_JAR_FILENAME="ignoreme.jar" + java-pkg-simple_src_compile + fi +} + +src_test() { + # instead of shading byte-buddy-dep we move it into byte-buddy. + mv byte-buddy{-dep,}/src/test || die "cannot move tests" + + # @Ignore one of 4 tests, https://bugs.gentoo.org/863386 + sed \ + -e '/import org.junit.Test/a import org.junit.Ignore;' \ + -e '/testIgnoreExistingField()/i @Ignore' \ + -i byte-buddy/src/test/java/net/bytebuddy/build/CachedReturnPluginOtherTest.java || die + + # @Ignore one of 39 tests, https://bugs.gentoo.org/863386 + sed \ + -e '/import org.junit.Test/a import org.junit.Ignore;' \ + -e '/testNoParameterNameAndModifiers()/i @Ignore' \ + -i byte-buddy/src/test/java/net/bytebuddy/description/method/AbstractMethodDescriptionTest.java || die + + JAVA_TEST_GENTOO_CLASSPATH="junit-4,mockito-4" + + einfo "Testing byte-buddy-agent" + # https://github.com/raphw/byte-buddy/issues/1321#issuecomment-1252776459 + JAVA_TEST_EXTRA_ARGS=( -Dnet.bytebuddy.test.jnapath="${EPREFIX}/usr/$(get_libdir)/jna-4/" ) + JAVA_TEST_SRC_DIR="byte-buddy-agent/src/test/java" + java-pkg-simple_src_test + + einfo "Testing byte-buddy" + JAVA_TEST_RESOURCE_DIRS=( byte-buddy/src/test/{resources,precompiled*} ) + JAVA_TEST_SRC_DIR="byte-buddy/src/test/java" + + JAVA_TEST_EXCLUDES=( + # all tests in this class fail, https://bugs.gentoo.org/863386 + net.bytebuddy.build.CachedReturnPluginTest + ) + java-pkg-simple_src_test +} + +src_install() { + java-pkg_dojar "byte-buddy-agent.jar" + java-pkg_dojar "byte-buddy.jar" + + if use doc; then + java-pkg_dojavadoc target/api + fi + + if use source; then + java-pkg_dosrc "byte-buddy-agent/src/main/java/*" + java-pkg_dosrc "byte-buddy/src/main/java/*" + fi +} |