summaryrefslogtreecommitdiff
path: root/libre/junit/PKGBUILD
blob: deaf34143937db72b488334e19e89f0ece8081e3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
# Maintainer (Arch): Guillaume ALAUX <Guillaume at Arch Linux dot org>
# Rationale: Arch version isn't built from source.
# Maintainer: Omar Vega Ramos <ovruni@gnu.org.pe>

pkgname=junit
_pkgname=junit5
pkgver=5.8.2
pkgrel=1.parabola1
pkgdesc='Simple JVM framework to write repeatable tests'
arch=('any')
url='http://www.junit.org/'
license=('EPL')
depends=('java-runtime' 'java-hamcrest')
makedepends=('apache-ant' 'jh')
source=("https://github.com/junit-team/${_pkgname}/archive/r${pkgver}.tar.gz")
sha512sums=('d4e7bf23aa736ab17badef59f690cb0040e438d31368c4727b1209c774a30e0cdfea7f206901eb5af3714c019893ac4768d16e8207219662d885c19a66955f7e')

# 
# _artifacts=(junit-bom
#           junit-jupiter
# 	    junit-jupiter-api
# 	    junit-jupiter-engine
# 	    junit-jupiter-migrationsupport
# 	    junit-jupiter-params
# 	    junit-platform-commons
# 	    junit-platform-console
# 	    junit-platform-console-standalone
# 	    junit-platform-engine
# 	    junit-platform-jfr
# 	    junit-platform-launcher
# 	    junit-platform-reporting
# 	    junit-platform-runner
# 	    junit-platform-suite
# 	    junit-platform-suite-api
# 	    junit-platform-suite-commons
# 	    junit-platform-suite-engine
# 	    junit-platform-testkit
# 	    junit-vintage-engine)
_artifacts=(
    # junit-jupiter-api
	    junit-jupiter-engine
	    junit-jupiter-migrationsupport
	    junit-jupiter-params
	    junit-platform-commons
	    junit-platform-console
	    junit-platform-engine
	    junit-platform-jfr
	    junit-platform-launcher
	    junit-platform-reporting
	    junit-platform-runner
	    junit-platform-suite-api
	    junit-platform-suite-commons
	    junit-platform-suite-engine
	    junit-platform-testkit
	    junit-vintage-engine)

prepare() {
  for artifact in ${_artifacts[@]}; do
    mkdir -p "${srcdir}/build/${artifact}/classes"
    mkdir -p "${srcdir}/source/${artifact}/"
  done
}

build() {
  cd "${srcdir}/${_pkgname}-r${pkgver}"

  # CLASSPATH="/usr/share/java/jsch.jar:/usr/share/java/jna.jar:/usr/share/java/jna-platform.jar:dist/*"
  # -cp $CLASSPATH
  for artifact in ${_artifacts[@]}; do
    javac -d "${srcdir}/build/${artifact}/classes" -encoding UTF-8 \
      $(find "${artifact}/src/main/java" -name \*.java)
    jar -cvf "dist/${_pkgname}.${artifact}.jar" -C "build/${artifact}/classes" .
  done

  javadoc -classpath $CLASSPATH -d "build/javadoc" -encoding UTF-8 \
    -sourcepath source/src/main/java -subpackages com
}

package() {
  cd "${srcdir}/${_pkgname}-r${pkgver}"

  # Install license file
  install -Dm644 LICENSE-junit.txt "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE.txt"

  # Install documentation
  install -d "${pkgdir}/usr/share/doc/${pkgname}"
  cp -r "${pkgname}${pkgver}/javadoc" "${pkgdir}/usr/share/doc/${pkgname}"

  export DESTDIR="$pkgdir"
  jh mvn-install ${pkgname} ${pkgname} ${pkgver} \
    pom.xml \
    "${pkgname}${pkgver}/${pkgname}-${pkgver}.jar" \
    "${pkgname}.jar"

  ln -s "/usr/share/java/${pkgname}.jar" \
    "${pkgdir}/usr/share/java/${pkgname}-${pkgver}.jar"
}