From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) by finch.gentoo.org (Postfix) with ESMTP id F1E7A1384B4 for ; Fri, 4 Dec 2015 23:01:52 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id D02AEE0896; Fri, 4 Dec 2015 23:01:51 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 57007E0896 for ; Fri, 4 Dec 2015 23:01:51 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id EE8AA340AA7 for ; Fri, 4 Dec 2015 23:01:48 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 3B570C78 for ; Fri, 4 Dec 2015 23:01:47 +0000 (UTC) From: "James Le Cuirot" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "James Le Cuirot" Message-ID: <1449270098.3a57ade8bf9d44d13317237dcc8345eb522e80b4.chewi@gentoo> Subject: [gentoo-commits] repo/gentoo:master commit in: dev-java/stringtemplate/files/, dev-java/stringtemplate/ X-VCS-Repository: repo/gentoo X-VCS-Files: dev-java/stringtemplate/files/3.2.1-test-fixes.patch dev-java/stringtemplate/stringtemplate-3.2.1-r1.ebuild X-VCS-Directories: dev-java/stringtemplate/files/ dev-java/stringtemplate/ X-VCS-Committer: chewi X-VCS-Committer-Name: James Le Cuirot X-VCS-Revision: 3a57ade8bf9d44d13317237dcc8345eb522e80b4 X-VCS-Branch: master Date: Fri, 4 Dec 2015 23:01:47 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Archives-Salt: 19dd5181-6f9b-47f7-9cc3-1376ae6fa734 X-Archives-Hash: c78675cce481b336626ee48ae07b2619 commit: 3a57ade8bf9d44d13317237dcc8345eb522e80b4 Author: James Le Cuirot gentoo org> AuthorDate: Fri Dec 4 22:57:32 2015 +0000 Commit: James Le Cuirot gentoo org> CommitDate: Fri Dec 4 23:01:38 2015 +0000 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=3a57ade8 dev-java/stringtemplate: Rewrite, EAPI bump, test fixes wrt bug #405057 Package-Manager: portage-2.2.26 .../stringtemplate/files/3.2.1-test-fixes.patch | 53 ++++++++++++++++++ .../stringtemplate/stringtemplate-3.2.1-r1.ebuild | 62 ++++++++++++++++++++++ 2 files changed, 115 insertions(+) diff --git a/dev-java/stringtemplate/files/3.2.1-test-fixes.patch b/dev-java/stringtemplate/files/3.2.1-test-fixes.patch new file mode 100644 index 0000000..fd625ab --- /dev/null +++ b/dev-java/stringtemplate/files/3.2.1-test-fixes.patch @@ -0,0 +1,53 @@ +https://github.com/antlr/stringtemplate3/pull/3 + +--- test/org/antlr/stringtemplate/test/TestStringTemplate.java.orig 2015-09-18 22:04:18.131902875 +0100 ++++ test/org/antlr/stringtemplate/test/TestStringTemplate.java 2015-09-18 22:04:21.651848456 +0100 +@@ -36,6 +36,10 @@ + import java.text.SimpleDateFormat; + import java.util.*; + ++import org.junit.FixMethodOrder; ++import org.junit.runners.MethodSorters; ++ ++@FixMethodOrder(MethodSorters.NAME_ASCENDING) + public class TestStringTemplate extends TestCase { + static final String newline = System.getProperty("line.separator"); + +@@ -87,7 +91,7 @@ + assertEquals(expecting,I.toString()); + } + +- public void testNoGroupLoader() throws Exception { ++ public void testAaaNoGroupLoader() throws Exception { + // this also tests the group loader + StringTemplateErrorListener errors = new ErrorBuffer(); + String tmpdir = System.getProperty("java.io.tmpdir"); +@@ -2214,8 +2218,12 @@ + s.add("2"); + s.add("3"); + st.setAttribute("items", s); +- expecting = "
  • 3
  • 2
  • 1
  • "; +- assertEquals(expecting, st.toString()); ++ String[] split = st.toString().split("(){1,2}"); ++ Arrays.sort(split); ++ assertEquals("", split[0]); ++ assertEquals("1", split[1]); ++ assertEquals("2", split[2]); ++ assertEquals("3", split[3]); + } + + public void testDumpMapAndSet() throws Exception { +@@ -2235,8 +2243,11 @@ + s.add("2"); + s.add("3"); + st.setAttribute("items", s); +- expecting = "3,2,1"; +- assertEquals(expecting, st.toString()); ++ String[] split = st.toString().split(","); ++ Arrays.sort(split); ++ assertEquals("1", split[0]); ++ assertEquals("2", split[1]); ++ assertEquals("3", split[2]); + } + + public class Connector3 { diff --git a/dev-java/stringtemplate/stringtemplate-3.2.1-r1.ebuild b/dev-java/stringtemplate/stringtemplate-3.2.1-r1.ebuild new file mode 100644 index 0000000..1179a5b --- /dev/null +++ b/dev-java/stringtemplate/stringtemplate-3.2.1-r1.ebuild @@ -0,0 +1,62 @@ +# Copyright 1999-2015 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Id$ + +EAPI="5" + +JAVA_PKG_IUSE="doc source" + +inherit eutils java-pkg-2 java-pkg-simple + +DESCRIPTION="A Java template engine" +HOMEPAGE="http://www.stringtemplate.org/" +SRC_URI="https://github.com/antlr/${PN}3/archive/${PV}.tar.gz -> ${P}.tar.gz" +LICENSE="BSD" +SLOT="0" +KEYWORDS="~amd64 ~arm ~ppc ~ppc64 ~x86 ~amd64-linux ~x86-linux ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris" +IUSE="test" + +CDEPEND=">=dev-java/antlr-2.7.7-r7:0" + +RDEPEND="${CDEPEND} + >=virtual/jre-1.6" + +DEPEND="${CDEPEND} + >=virtual/jdk-1.6 + test? ( >=dev-java/junit-4.11:4 )" + +S="${WORKDIR}/${P}" +JAVA_GENTOO_CLASSPATH="antlr" +JAVA_SRC_DIR="src" + +java_prepare() { + # https://github.com/antlr/stringtemplate3/pull/3 + epatch "${FILESDIR}/${PV}-test-fixes.patch" + + java-pkg_clean +} + +src_compile() { + local G; for G in action template angle.bracket.template eval group interface; do # from build.xml + antlr -o src/org/antlr/stringtemplate/language/{,${G}.g} || die + done + + java-pkg-simple_src_compile +} + +src_install() { + java-pkg-simple_src_install + dodoc {CHANGES,README}.txt +} + +src_test() { + cd test || die + local CP=".:${S}/${PN}.jar:$(java-pkg_getjars junit-4,${JAVA_GENTOO_CLASSPATH})" + + local TESTS=$(find * -name "Test*.java") + TESTS="${TESTS//.java}" + TESTS="${TESTS//\//.}" + + ejavac -classpath "${CP}" $(find -name "*.java") + ejunit4 -classpath "${CP}" ${TESTS} +}