diff options
author | V3n3RiX <venerix@koprulu.sector> | 2022-07-22 20:47:41 +0100 |
---|---|---|
committer | V3n3RiX <venerix@koprulu.sector> | 2022-07-22 20:47:41 +0100 |
commit | 5deadca7219297a3c1f90eca00544a00e33efdbc (patch) | |
tree | 1cf7fc930e051b39dbd0d7921edad5f94f729500 /dev-java/byte-buddy | |
parent | 614dee2f9d146b148d9c54dd480e7df81ba2f3a7 (diff) |
gentoo auto-resync : 22:07:2022 - 20:47:41
Diffstat (limited to 'dev-java/byte-buddy')
-rw-r--r-- | dev-java/byte-buddy/Manifest | 2 | ||||
-rw-r--r-- | dev-java/byte-buddy/byte-buddy-1.12.12.ebuild | 176 |
2 files changed, 178 insertions, 0 deletions
diff --git a/dev-java/byte-buddy/Manifest b/dev-java/byte-buddy/Manifest index 6299c3ba969d..40ebca6945aa 100644 --- a/dev-java/byte-buddy/Manifest +++ b/dev-java/byte-buddy/Manifest @@ -1,3 +1,5 @@ DIST byte-buddy-1.12.10-sources.jar 1331398 BLAKE2B 8732ac81514de40d3d2ffd67ddca05ab9b8a5d0a7f240ee4591fd02b41f410f9e834f389aa898829fbae6082e14a090f87052f537b2b6293c7f8f98d4a5d0583 SHA512 15cb4330598d9259afa29aac0317f8e0e003eb76fb26052bba0714ad30453db721938be7d46fcc6a0c7bbe124bffe68dfee6fcf11a3e4030e99ef01d0ae3d461 +DIST byte-buddy-1.12.12.tar.gz 149937318 BLAKE2B 1a1bd0de97b47ace4c64649da3ae80dcb421a4d46e9b4f66e121accad94a99a2b81fa9aeaca99ae14cf1ef56feff5248d5700d6b056d490563bbc7ae9f07ace9 SHA512 bd8dc5b86ce456d5a907dd23643233bb001c15df5419aeed177d3b4f8054ab172d13244d0b3fef734e8232dfdd9339745d8112fa69e0be566b62459c198bf67a EBUILD byte-buddy-1.12.10.ebuild 1375 BLAKE2B 3d215a54ae80086b7e1a3f1a523546131c3a24db57106d13ef3d7f010a78e6a316bd01e10619c3b00c5a8fea84cad6cd942bca132b5e5fee9716d4645655fb0f SHA512 8e299b9c4ca17244c695e69ea50e7e40dbe6ef3eae116363c080ca4c3d4cae01411a1af9eb253973be3b50c1d51d78eb33d2ecc5c518a6a93ff21b93ac8c7d22 +EBUILD byte-buddy-1.12.12.ebuild 6645 BLAKE2B 1c791641004695ae56721b0b34d190477fbb08bb0eadb2d5688d495f2f57bcf2ccb1d9ebba6d77a0efcd252bb00ae875f3b3398f047bd678e00c49e63f0360be SHA512 a47a9b13cc084e550255fa6cd5afe34f2c8ce6ad5312419d90fa917596e5ee61e99d4e5c9697b762683e2987a02e19eb99e5de2f44afc069a25a22b353ab6a02 MISC metadata.xml 440 BLAKE2B ef73e69de33dc6bbea38c81b8744fad5ce4764644d9cc6168d7c0f175856e30c3a577ffc597f25f8caf26bacfd80663b55eddde047a346fcb582d883269233b9 SHA512 b27c92e768c2783c90c8b4693c3265a9533a09abe76b2b3bd54e3865d270eed91414fcd89513bc30feb0243ea21f63d354b907b74eb18e98f899811101a6c956 diff --git a/dev-java/byte-buddy/byte-buddy-1.12.12.ebuild b/dev-java/byte-buddy/byte-buddy-1.12.12.ebuild new file mode 100644 index 000000000000..6a3353c6c3d1 --- /dev/null +++ b/dev-java/byte-buddy/byte-buddy-1.12.12.ebuild @@ -0,0 +1,176 @@ +# Copyright 1999-2022 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.12.tar.gz --slot 0 --keywords "~amd64 ~arm ~arm64 ~ppc64 ~x86" --ebuild byte-buddy-1.12.12.ebuild + +EAPI=8 + +JAVA_PKG_IUSE="doc source test" +MAVEN_ID="net.bytebuddy:byte-buddy-agent:1.12.12" +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/${PN}/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}/${PN}-${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.12/byte-buddy-agent/pom.xml#L132-L165 + cat > byte-buddy-agent/src/main/java/module-info.java <<-EOF + 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 + + 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 +} + +src_compile() { + einfo "Compiling byte-buddy-agent.jar" + JAVA_SRC_DIR="byte-buddy-agent/src/main/java" + JAVA_RESOURCE_DIRS="byte-buddy-agent/src/main/resources" + JAVA_JAR_FILENAME="byte-buddy-agent.jar" + java-pkg-simple_src_compile + JAVA_GENTOO_CLASSPATH_EXTRA+=":byte-buddy-agent.jar" + rm -r target || die + +# For pkgdiff to compare the content of module-info.class +# mkdir -p META-INF/versions/9 || die +# cp target/classes/module-info.class META-INF/versions/9/ || die +# jar -uf byte-buddy.jar -C . META-INF/versions/9/module-info.class || die + + einfo "Compiling byte-buddy-dep.jar" + JAVA_SRC_DIR="byte-buddy-dep/src/main/java" + JAVA_RESOURCE_DIRS="byte-buddy-dep/src/main/resources" + JAVA_JAR_FILENAME="byte-buddy-dep.jar" + java-pkg-simple_src_compile + JAVA_GENTOO_CLASSPATH_EXTRA+=":byte-buddy-dep.jar" + rm -r target || die + + if use doc; then + einfo "Compiling javadocs" + JAVA_SRC_DIR=( + "byte-buddy-agent/src/main/java" + "byte-buddy-dep/src/main/java" + ) + JAVA_JAR_FILENAME="ignoreme.jar" + java-pkg-simple_src_compile + fi +} + +src_test() { + JAVA_TEST_GENTOO_CLASSPATH="junit-4,mockito-4" + + # einfo "Setting -Djava.library.path" + # This would work only after manually adding libjnidispatch.so to /usr/share/jna-4/lib/jna.jar, + # done with ( jar -uf /usr/share/jna-4/lib/jna.jar -C . com/sun/jna/linux-x86-64/libjnidispatch ) +# JAVA_TEST_EXTRA_ARGS=( -Djava.library.path+="$(java-config -i jna-4)" com.sun.jna.Native ) + # Otherwise fails with: + # Exception in thread "main" java.lang.UnsatisfiedLinkError: Native library (com/sun/jna/linux-x86-64/libjnidispatch.so) not found in resource path + + einfo "Testing byte-buddy-agent" + JAVA_TEST_SRC_DIR="byte-buddy-agent/src/test/java" + # Native library (com/sun/jna/linux-x86-64/libjnidispatch.so) not found in resource path + JAVA_TEST_EXCLUDES=( net.bytebuddy.agent.VirtualMachineAttachmentTest ) + java-pkg-simple_src_test + + einfo "Testing byte-buddy-dep" + JAVA_TEST_SRC_DIR="byte-buddy-dep/src/test/java" + JAVA_TEST_RESOURCE_DIRS="byte-buddy-dep/src/test/resources" + + # what "mvn test" does with java 17 is: + # Tests run: 9836, Failures: 0, Errors: 0, Skipped: 0 + + # 1) testTypeVariableTypeAnnotationRuntimeRetention[0](net.bytebuddy.implementation.attribute.MethodAttributeAppenderForInstrumentedMethodTest) + # org.mockito.exceptions.verification.NoInteractionsWanted: + # -- + # 2) testTypeVariableTypeAnnotationRuntimeRetention[1](net.bytebuddy.implementation.attribute.MethodAttributeAppenderForInstrumentedMethodTest) + # org.mockito.exceptions.verification.NoInteractionsWanted: + # -- + # 3) testAnnotationClassFileRetention(net.bytebuddy.implementation.attribute.TypeAttributeAppenderForInstrumentedTypeDifferentiatingTest) + # org.mockito.exceptions.verification.NoInteractionsWanted: + # -- + # 4) testAnnotationByteCodeRetention(net.bytebuddy.implementation.attribute.TypeAttributeAppenderForInstrumentedTypeDifferentiatingTest) + # org.mockito.exceptions.verification.NoInteractionsWanted: + # -- + # 5) testAnnotationClassFileRetention(net.bytebuddy.implementation.attribute.TypeAttributeAppenderForInstrumentedTypeTest) + # org.mockito.exceptions.verification.NoInteractionsWanted: + # -- + # 6) testAnnotationByteCodeRetention(net.bytebuddy.implementation.attribute.TypeAttributeAppenderForInstrumentedTypeTest) + # org.mockito.exceptions.verification.NoInteractionsWanted: + # -- + # 7) testChildSecond(net.bytebuddy.pool.TypePoolDefaultHierarchyTest) + # org.mockito.exceptions.verification.NoInteractionsWanted: + # -- + # 8) testNoParameterNameAndModifiers(net.bytebuddy.pool.TypePoolDefaultMethodDescriptionTest) + # java.lang.AssertionError: + # -- + # 9) testSimpleApplication(net.bytebuddy.description.type.TypeInitializerTest) + # org.mockito.exceptions.verification.NoInteractionsWanted: + # -- + # 10) testRedefinitionChunkedOneFailsResubmit(net.bytebuddy.agent.builder.AgentBuilderDefaultTest) + # org.mockito.exceptions.verification.NoInteractionsWanted: + JAVA_TEST_EXCLUDES+=( + net.bytebuddy.implementation.attribute.MethodAttributeAppenderForInstrumentedMethodTest + net.bytebuddy.implementation.attribute.TypeAttributeAppenderForInstrumentedTypeDifferentiatingTest + net.bytebuddy.implementation.attribute.TypeAttributeAppenderForInstrumentedTypeTest + net.bytebuddy.pool.TypePoolDefaultHierarchyTest + net.bytebuddy.pool.TypePoolDefaultMethodDescriptionTest + net.bytebuddy.description.type.TypeInitializerTest + net.bytebuddy.agent.builder.AgentBuilderDefaultTest + ) + java-pkg-simple_src_test +} + +src_install() { + java-pkg_dojar "byte-buddy-agent.jar" + java-pkg_dojar "byte-buddy-dep.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-dep/src/main/java/*" + fi +} |