junit-4.12-r1.ebuild 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. # Copyright 1999-2017 Gentoo Foundation
  2. # Distributed under the terms of the GNU General Public License v2
  3. EAPI=5
  4. MY_PN="${PN}${PV%%.*}"
  5. MY_P="${MY_PN}-r${PV}"
  6. JAVA_PKG_IUSE="doc source"
  7. inherit java-pkg-2 java-pkg-simple
  8. DESCRIPTION="Simple framework to write repeatable tests"
  9. SRC_URI="https://github.com/${PN}-team/${MY_PN}/archive/r${PV}.tar.gz -> ${MY_P}.tar.gz"
  10. HOMEPAGE="http://junit.org/"
  11. LICENSE="EPL-1.0"
  12. SLOT="4"
  13. KEYWORDS="amd64 ~arm ppc64 x86 ~amd64-fbsd ~x86-fbsd ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~sparc-solaris ~x64-solaris ~x86-solaris"
  14. IUSE="examples"
  15. CDEPEND="dev-java/hamcrest-core:1.3"
  16. RDEPEND=">=virtual/jre-1.6
  17. ${CDEPEND}"
  18. DEPEND=">=virtual/jdk-1.6
  19. ${CDEPEND}"
  20. S="${WORKDIR}/${MY_P}"
  21. JAVA_SRC_DIR="src/main/java"
  22. JAVA_GENTOO_CLASSPATH="hamcrest-core-1.3"
  23. java_prepare() {
  24. rm -v lib/*.jar || die
  25. }
  26. src_compile() {
  27. java-pkg-simple_src_compile
  28. java-pkg_addres ${PN}.jar src/main/resources
  29. }
  30. src_install() {
  31. java-pkg-simple_src_install
  32. dodoc {acknowledgements,{LEGACY_,}CODING_STYLE,NOTICE,to-do}.txt {CONTRIBUTING,README,doc/ReleaseNotes${PV}}.md
  33. use examples && java-pkg_doexamples src/test/java/org/junit/samples
  34. }
  35. src_test() {
  36. cd src/test/java || die
  37. local CP=".:../resources:${S}/${PN}.jar:$(java-pkg_getjars ${JAVA_GENTOO_CLASSPATH})"
  38. ejavac -cp "${CP}" -d . $(find * -name "*.java")
  39. java -cp "${CP}" -Djava.awt.headless=true org.junit.runner.JUnitCore junit.tests.AllTests || die "Running junit failed"
  40. }