diff options
Diffstat (limited to 'libre/junit')
-rw-r--r-- | libre/junit/PKGBUILD | 66 | ||||
-rw-r--r-- | libre/junit/build.xml | 175 |
2 files changed, 209 insertions, 32 deletions
diff --git a/libre/junit/PKGBUILD b/libre/junit/PKGBUILD index 8b0682172..19cde0ec5 100644 --- a/libre/junit/PKGBUILD +++ b/libre/junit/PKGBUILD @@ -1,48 +1,50 @@ -# Maintainer: Luke Shumaker <lukeshu@sbcglobal.net> # 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 -pkgver=4.11 -pkgdesc="Automated testing framework for Java" -url="http://www.junit.org/" -license=('CPL') - -pkgrel=4.parabola1 +pkgver=4.12 +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' 'jakarta-oro' 'jh') - -source=("https://repo.parabola.nu/other/$pkgname/$pkgname-$pkgver.tar.gz") -md5sums=('cdaa9856761201de81a61aecb8cfcc9c') - -mksource=("$pkgname-$pkgver::git://github.com/junit-team/junit.git#tag=r$pkgver") -mkmd5sums=('SKIP') -mksource() { - cd "${srcdir}/${pkgname}-${pkgver}" - find . -name '*.jar' -delete +makedepends=('apache-ant' 'jh') +source=("https://github.com/junit-team/${pkgname}/archive/r${pkgver}.tar.gz" + "build.xml") +sha256sums=('61a16d8abf5a0d2d35a0c69a278e457a8b1f7b3726813c00c4775d39bce0dce4' + 'SKIP') + +prepare() { + cd "${srcdir}/${pkgname}-r${pkgver}" + rm -rv lib/*.jar + mv ../build.xml . + ln -sf /usr/share/java/hamcrest-core.jar lib/hamcrest-core-1.3.jar } build() { - cd "${srcdir}/${pkgname}-${pkgver}" + cd "${srcdir}/${pkgname}-r${pkgver}" - ln -sf /usr/share/java/jakarta-oro.jar build/lib/ - ln -sf /usr/share/java/hamcrest-core.jar lib/hamcrest-core-1.3.jar - - ant -Dversion-status='' jars - for artifact in junit junit-dep; do - sed \ - -e "s|@artifactID@|$artifact|" \ - -e "s|@version@|$pkgver|" \ - < build/maven/$artifact-pom-template.xml > $pkgname$pkgver/$artifact-$pkgver.pom - done + ant dist } package() { - cd "${srcdir}/${pkgname}-${pkgver}/${pkgname}${pkgver}" + 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 junit $pkgver junit-$pkgver.{pom,jar} junit-$pkgver.jar - jh mvn-install $pkgname junit-dep $pkgver junit-dep-$pkgver.pom - ln -s ${pkgname}-${pkgver}.jar ${pkgdir}/usr/share/java/${pkgname}.jar + 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" } diff --git a/libre/junit/build.xml b/libre/junit/build.xml new file mode 100644 index 000000000..2ad00a86c --- /dev/null +++ b/libre/junit/build.xml @@ -0,0 +1,175 @@ +<project name="junit" default="dist" basedir="." + xmlns:artifact="antlib:org.apache.maven.artifact.ant"> + <tstamp /> + <taskdef resource="net/sf/antcontrib/antcontrib.properties"/> + + <property file="${user.home}/.junit.properties" /> + <property name="src" value="src/main/java" /> + <property name="srcresources" location="src/main/resources" /> + <property name="target" location="target" /> + <property name="bin" location="${target}/main" /> + <property name="version-base" value="4.12" /> + <property name="version" value="${version-base}" /> + <property name="dist" value="junit${version}" /> + <property name="versionfile" value="${src}/junit/runner/Version.java" /> + <property name="testsrc" location="src/test/java" /> + <property name="testsresources" location="src/test/resources" /> + <property name="testbin" location="${target}/test/java" /> + <property name="unjarred" + value="**/*.jar, ${testfiles}, doc/**, README.html, .classpath, .project, cpl-v10.html" /> + + <property name="binjar" value="junit-${version}.jar" /> + <property name="srcjar" value="junit-${version}-sources.jar" /> + + <property name="javadocdir" location="${dist}/javadoc" /> + <property name="hamcrestlib" location="lib/hamcrest-core-1.3.jar" /> + + <target name="init"> + <tstamp/> + </target> + + <target name="versiontag" depends="init"> + <filter token="version" value="${version}" /> + + <copy + file="${versionfile}.template" + tofile="${versionfile}" + filtering="on" + overwrite="true" + /> + </target> + + <target name="clean"> + <!-- If two builds are made within a minute --> + <delete dir="${dist}" quiet="true" /> + <!-- Delete all previous temporary build artifacts --> + <delete dir="${target}" quiet="true" /> + </target> + + <macrodef name="junit_compilation"> + <attribute name="srcdir"/> + <attribute name="destdir"/> + <attribute name="classpath"/> + <sequential> + <mkdir dir="@{destdir}"/> + <javac + srcdir="@{srcdir}" + destdir="@{destdir}" + debug="on" + classpath="@{classpath}" + includeantruntime="false" + source="1.5" + target="1.5" + > + <compilerarg value="-Xlint:unchecked" /> + </javac> + </sequential> + </macrodef> + + <target name="build" depends="versiontag"> + <junit_compilation srcdir="${src}" destdir="${bin}" classpath="${hamcrestlib}"/> + <junit_compilation srcdir="${testsrc}" destdir="${testbin}" classpath="${hamcrestlib};${bin}"/> + </target> + + <target name="jars" depends="build"> + <mkdir dir="${dist}" /> + <jar + jarfile="${dist}/${srcjar}" + basedir="${src}" + excludes="${unjarred}, **/*.class" + /> + <jar + jarfile="${dist}/${binjar}" + basedir="${bin}" + excludes="${unjarred}, **/*.java, build.xml" + /> + </target> + + <target name="samples-and-tests"> + <copy todir="${dist}"> + <fileset dir="${testbin}" /> + <fileset dir="${testsrc}" /> + </copy> + </target> + + <target name="javadoc"> + <javadoc destdir="${javadocdir}" + author="false" + version="false" + use="false" + windowtitle="JUnit API" + stylesheetfile="src/main/javadoc/stylesheet.css" + > + <excludepackage name="junit.*" /> + <excludepackage name="org.junit.internal.*" /> + <excludepackage name="org.junit.experimental.theories.internal.*" /> + + <sourcepath location="${src}" /> + <link href="http://docs.oracle.com/javase/1.5.0/docs/api/" /> + + <classpath> + <pathelement location="${hamcrestlib}" /> + </classpath> + </javadoc> + </target> + + <target name="populate-dist" + depends="clean, build, jars, samples-and-tests, javadoc" + > + <copy todir="${dist}/doc"> + <fileset dir="doc"/> + </copy> + <copy file="README.md" tofile="${dist}/README.md" /> + <copy file="BUILDING" tofile="${dist}/BUILDING" /> + <copy file="epl-v10.html" tofile="${dist}/epl-v10.html" /> + <copy file="build.xml" tofile="${dist}/build.xml" /> + </target> + + <macrodef name="run-dist-tests"> + <!-- Runs the tests against the built jar files --> + <element name="extra-args" implicit="yes" /> + <sequential> + <java classname="org.junit.runner.JUnitCore" fork="yes" failonerror="true"> + <extra-args /> + <arg value="org.junit.tests.AllTests"/> + <classpath> + <pathelement location="${dist}" /> + <pathelement location="${dist}/${binjar}" /> + <pathelement location="${hamcrestlib}" /> + <pathelement location="${testsresources}" /> + </classpath> + </java> + </sequential> + </macrodef> + + <macrodef name="run-local-tests"> + <!-- Runs the tests against the local class files --> + <sequential> + <java classname="org.junit.runner.JUnitCore" fork="yes" failonerror="true"> + <arg value="org.junit.tests.AllTests"/> + <classpath> + <pathelement location="${bin}" /> + <pathelement location="${testbin}" /> + <pathelement location="${hamcrestlib}" /> + <pathelement location="${testsresources}" /> + </classpath> + </java> + </sequential> + </macrodef> + + <target name="test" depends="build"> + <run-local-tests /> + </target> + + <target name="dist" depends="populate-dist"> + <run-dist-tests> + <jvmarg value="-Dignore.this=ignored"/> + </run-dist-tests> + </target> + + <target name="profile" depends="populate-dist"> + <run-dist-tests> + <jvmarg value="-agentlib:hprof=cpu=samples"/> + </run-dist-tests> + </target> +</project> |