diff options
Diffstat (limited to 'dev-java/jmock')
-rw-r--r-- | dev-java/jmock/Manifest | 1 | ||||
-rw-r--r-- | dev-java/jmock/jmock-2.12.0.ebuild | 98 |
2 files changed, 99 insertions, 0 deletions
diff --git a/dev-java/jmock/Manifest b/dev-java/jmock/Manifest index 461e7589a929..c8a558e7e845 100644 --- a/dev-java/jmock/Manifest +++ b/dev-java/jmock/Manifest @@ -1,2 +1,3 @@ DIST jmock-1.2.0-jars.zip 153214 BLAKE2B 2c40696229018406f3b60559013b73b5331c223da6e2743830c4c9b8b728484b1ebed8fb347c240f50f6936c2fd1e4ee85b754315682047a87a14414effc3a48 SHA512 5290f1d14cbc3d0f223bdaf59716b037dbc021c8f39a3784d13af8d8be3edbddc5e2eb4754b80e78ae954daf12889210183e7e11c110012b4d9320344efe19da +DIST jmock-2.12.0.tar.gz 111963 BLAKE2B d4b8c8c4ca68ed8dae3b4906e3163fa5e8e8ea8f4b993386d7fa605e0188dd43462550ae4833ab9dbfe68c24e15cf6d19a6f444ca57f666fdfe8b29734fd32f7 SHA512 b1ba12981e7379f5b07a29749c7640906c02f72f52158921d0ac02abf69c9c8c2dc753f4462ff0afa5807852a06f59a6da9ed9357ae7dc0303b0377a0e3da854 DIST jmock-2.6.1-jars.zip 1249841 BLAKE2B 87861dad7151000e1397a54d0ded7e49c3fd81fca64afd74d6176436f336be5b5e89f73be8c124cf086798f74aef4972303137529113e3c85ba93353f95e3a42 SHA512 7cd1d2e89dceb31c68ad3f702ad937b5de6ec77cc37e94be7aa53db2fc61d11aa40ec5aab225a3eeeba5064ad8384f10413ac05a9df97102c8e63f4209ea149e diff --git a/dev-java/jmock/jmock-2.12.0.ebuild b/dev-java/jmock/jmock-2.12.0.ebuild new file mode 100644 index 000000000000..56d262a4cbfe --- /dev/null +++ b/dev-java/jmock/jmock-2.12.0.ebuild @@ -0,0 +1,98 @@ +# Copyright 1999-2022 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +# Skeleton command: +# java-ebuilder --generate-ebuild --workdir . --pom jmock/pom.xml --download-uri https://github.com/jmock-developers/jmock-library/archive/2.12.0.tar.gz --slot 2 --keywords "~amd64 ~arm64 ~ppc64 ~x86" --ebuild jmock-2.12.0.ebuild + +EAPI=8 + +JAVA_PKG_IUSE="doc source test" +MAVEN_ID="org.jmock:jmock:2.12.0" +JAVA_TESTING_FRAMEWORKS="junit-4" + +inherit java-pkg-2 java-pkg-simple + +DESCRIPTION="An expressive Mock Object library for Test Driven Development" +HOMEPAGE="http://jmock.org/" +SRC_URI="https://github.com/${PN}-developers/${PN}-library/archive/${PV}.tar.gz -> ${P}.tar.gz" + +LICENSE="BSD" +SLOT="2" +KEYWORDS="~amd64 ~arm64 ~ppc64 ~x86" + +DEPEND=" + dev-java/asm:9 + dev-java/bsh:0 + dev-java/hamcrest:0 + >=virtual/jdk-1.8:* + test? ( + dev-java/findbugs-annotations:0 + dev-java/jaxws-api:0 + ) +" + +RDEPEND=">=virtual/jre-1.8:*" + +S="${WORKDIR}/jmock-library-${PV}" + +JAVA_TEST_GENTOO_CLASSPATH=" + findbugs-annotations + jaxws-api + junit-4 +" +JAVA_TEST_SRC_DIR="jmock/src/test/java" + +src_prepare() { + default + # We have "signed.jar" directly in ${S}, not in "../testjar/target/". + sed \ + -e 's:\.\.\/testjar\/target\/\(signed.jar\):\1:' \ + -i jmock/src/test/java/org/jmock/test/unit/lib/JavaReflectionImposteriserTests.java || die +} + +src_compile() { + if use test; then + einfo "Compiling testjar" + JAVA_SRC_DIR="testjar/src/main/java" + JAVA_CLASSPATH_EXTRA="findbugs-annotations" + JAVA_JAR_FILENAME="signed.jar" + java-pkg-simple_src_compile + cp {,un}signed.jar || die + JAVA_GENTOO_CLASSPATH_EXTRA+=":signed.jar:unsigned.jar" + rm -r target || die + fi + + einfo "Compiling jmock.jar" + JAVA_SRC_DIR="jmock/src/main/java" + JAVA_CLASSPATH_EXTRA=" + asm-9 + bsh + hamcrest + " + JAVA_JAR_FILENAME="jmock.jar" + java-pkg-simple_src_compile + + # Code generation according to jmock/pom.xml#L73-L90 + "$(java-config -J)" \ + -cp $(java-config --with-dependencies --classpath asm:9):${PN}.jar \ + org.jmock.ExpectationsCreator + + # Update jmock.jar with updated Expectations.class + jar ufv jmock.jar -C target/classes org/jmock/Expectations.class || die +} + +src_test() { + # ${S}/pom.xml#L131-L143 + pushd jmock/src/test/java || die + local JAVA_TEST_RUN_ONLY=$(find * \ + \( -wholename "**/*Test.java" \ + -o -wholename '**/*Tests.java' \)\ + ! -wholename "**/Failing*TestCase.java" \ + ! -wholename "**/VerifyingTestCaseTests$*" \ + ! -wholename "**/Abstract*Test.java" \ + ) + popd + JAVA_TEST_RUN_ONLY="${JAVA_TEST_RUN_ONLY//.java}" + JAVA_TEST_RUN_ONLY="${JAVA_TEST_RUN_ONLY//\//.}" + java-pkg-simple_src_test +} |