1 # Copyright 1999-2018 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
6 JAVA_PKG_IUSE="examples source test" # doc
8 inherit java-pkg-2 java-ant-2
12 DESCRIPTION="Commons component to validate user input, or data input"
13 HOMEPAGE="http://commons.apache.org/validator/"
14 SRC_URI="mirror://apache/commons/validator/source/${P}-src.tar.gz"
18 KEYWORDS="amd64 ppc64 x86"
20 RDEPEND=">=virtual/jre-1.4
21 >=dev-java/commons-digester-1.6:0
22 >=dev-java/commons-collections-3.1:0
23 >=dev-java/commons-logging-1.0.4:0
24 dev-java/commons-beanutils:1.7"
26 DEPEND=">=virtual/jdk-1.4
27 test? ( dev-java/junit:0 )
30 S="${WORKDIR}/${MY_P}"
33 epatch "${FILESDIR}"/validator-1.4.build.xml.patch
35 JAVA_ANT_CLASSPATH_TAGS="javac java" java-ant_rewrite-classpath
37 echo "commons-digester.jar=$(java-pkg_getjars commons-digester)" >> build.properties
38 echo "commons-beanutils.jar=$(java-pkg_getjars commons-beanutils-1.7)" >> build.properties
39 echo "commons-logging.jar=$(java-pkg_getjar commons-logging commons-logging.jar)" >> build.properties
40 echo "commons-collections.jar=$(java-pkg_getjars commons-collections)" >> build.properties
43 EANT_JAVA_REWRITE_CLASSPATH="true"
44 EANT_GENTOO_CLASSPATH="commons-beanutils-1.7,commons-collections"
45 EANT_TEST_GENTOO_CLASSPATH="${EANT_GENTOO_CLASSPATH},commons-digester,commons-logging,junit"
47 EANT_BUILD_TARGET="compile"
48 EANT_EXTRA_ARGS="-Dskip.download=true"
51 java-pkg-2_src_compile
52 jar -cf ${PN}.jar -C target/classes/ . || die "Could not create jar."
55 eant compile.tests ${EANT_EXTRA_ARGS} -Dgentoo.classpath="$(java-pkg_getjars --build-only --with-dependencies ${EANT_TEST_GENTOO_CLASSPATH})"
56 jar -cf ${PN}-test.jar -C target/tests/ . || die "Could not create test jar."
60 # Missing test suite org.apache.commons.validator.ValidatorTestSuite; therefore, tests can't be ran.
61 # See https://issues.apache.org/jira/browse/VALIDATOR-323 for a bug report about this.
65 echo "junit.jar=$(java-pkg_getjars junit)" >> build.properties
66 eant test ${EANT_EXTRA_ARGS} -Dgentoo.classpath="$(java-pkg_getjars --build-only --with-dependencies ${EANT_TEST_GENTOO_CLASSPATH}):${PN}.jar:${PN}-test.jar"
70 java-pkg_dojar ${PN}.jar
72 dodoc NOTICE.txt RELEASE-NOTES.txt
74 # Docs are no longer generated, as they have commented them out;
75 # probably on purpose, since this is the start of a new branch.
76 # use doc && java-pkg_dojavadoc dist/docs/apidocs
77 use examples && java-pkg_doexamples src/example
78 use source && java-pkg_dosrc src/main/java/*