Gentoo Archives: gentoo-commits

From: Florian Schmaus <flow@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-java/ant-ivy/
Date: Tue, 05 Apr 2022 09:01:35
Message-Id: 1649149284.db3aaa98f9cc425b339f97ba8bc0491f921eefda.flow@gentoo
1 commit: db3aaa98f9cc425b339f97ba8bc0491f921eefda
2 Author: Volkmar W. Pogatzki <gentoo <AT> pogatzki <DOT> net>
3 AuthorDate: Fri Apr 1 10:10:23 2022 +0000
4 Commit: Florian Schmaus <flow <AT> gentoo <DOT> org>
5 CommitDate: Tue Apr 5 09:01:24 2022 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=db3aaa98
7
8 dev-java/ant-ivy: Switch to httpcomponents-client, restrict to jdk:1.8
9
10 dev-java/httpcomponents-client was in
11 slot 4 of dev-java/commons-httpclient before.
12
13 Restrict to jdk:1.8 as it would fail with jdk-17
14 src/java/org/apache/ivy/util/FileUtil.java:49: error: cannot find symbol
15 import static java.util.jar.Pack200.newUnpacker;
16
17 Package-Manager: Portage-3.0.30, Repoman-3.0.3
18 Signed-off-by: Volkmar W. Pogatzki <gentoo <AT> pogatzki.net>
19 Closes: https://github.com/gentoo/gentoo/pull/24848
20 Signed-off-by: Florian Schmaus <flow <AT> gentoo.org>
21
22 dev-java/ant-ivy/ant-ivy-2.5.0-r1.ebuild | 184 +++++++++++++++++++++++++++++++
23 1 file changed, 184 insertions(+)
24
25 diff --git a/dev-java/ant-ivy/ant-ivy-2.5.0-r1.ebuild b/dev-java/ant-ivy/ant-ivy-2.5.0-r1.ebuild
26 new file mode 100644
27 index 000000000000..cb8092656c67
28 --- /dev/null
29 +++ b/dev-java/ant-ivy/ant-ivy-2.5.0-r1.ebuild
30 @@ -0,0 +1,184 @@
31 +# Copyright 1999-2022 Gentoo Authors
32 +# Distributed under the terms of the GNU General Public License v2
33 +
34 +EAPI=8
35 +
36 +JAVA_PKG_IUSE="doc source test"
37 +MAVEN_ID="org.apache.ivy:ivy:2.5.0"
38 +JAVA_TESTING_FRAMEWORKS="junit-4"
39 +
40 +inherit java-pkg-2 java-pkg-simple java-osgi
41 +
42 +DESCRIPTION="Ivy is a free java based dependency manager"
43 +HOMEPAGE="https://ant.apache.org/ivy/"
44 +SRC_URI="mirror://apache/ant/ivy/${PV}/apache-ivy-${PV}-src.tar.gz"
45 +
46 +LICENSE="Apache-2.0"
47 +SLOT="2"
48 +KEYWORDS="~amd64 ~ppc64 ~x86"
49 +
50 +PROPERTIES="test_network"
51 +RESTRICT="test"
52 +
53 +CDEPEND="
54 + dev-java/ant-core:0
55 + dev-java/bcpg:0
56 + dev-java/bcprov:0
57 + dev-java/httpcomponents-client
58 + dev-java/commons-vfs:2
59 + dev-java/httpcore:0
60 + dev-java/jakarta-oro:2.0
61 + dev-java/jsch:0
62 + dev-java/jsch-agent-proxy:0
63 + test? (
64 + dev-java/ant-junit:0
65 + dev-java/ant-junit4:0
66 + dev-java/ant-junitlauncher:0
67 + dev-java/ant-testutil:0
68 + dev-java/hamcrest-core:1.3
69 + dev-java/hamcrest-library:1.3
70 + dev-java/xmlunit:1
71 + )"
72 +
73 +# Restrict to jdk:1.8 since java.util.jar.Pack200 was removed.
74 +DEPEND="${CDEPEND}
75 + virtual/jdk:1.8"
76 +RDEPEND="${CDEPEND}
77 + virtual/jre:1.8"
78 +
79 +DOCS=( LICENSE NOTICE README.adoc )
80 +
81 +S="${WORKDIR}/apache-ivy-${PV}"
82 +
83 +JAVA_GENTOO_CLASSPATH="ant-core,bcpg,bcprov,httpcomponents-client-4,commons-vfs-2,httpcore,jakarta-oro-2.0,jsch,jsch-agent-proxy"
84 +JAVA_MAIN_CLASS="org.apache.ivy.Main"
85 +JAVA_SRC_DIR="src/java"
86 +JAVA_RESOURCE_DIRS="resources/java"
87 +
88 +JAVA_TEST_GENTOO_CLASSPATH="ant-junit,ant-junit4,ant-junitlauncher,ant-testutil,hamcrest-core-1.3,hamcrest-library-1.3,junit-4,xmlunit-1"
89 +JAVA_TEST_SRC_DIR="test-src/java"
90 +JAVA_TEST_RESOURCE_DIRS="test"
91 +JAVA_GENTOO_CLASSPATH_EXTRA="ant-ivy.jar:test.jar:custom-resolver.jar"
92 +
93 +# according to 57,60 build-release.xml
94 +# https://github.com/apache/ant-ivy/commit/c0c8df492d2312c983f50cfdc5841e18177f6f7b
95 +JAVA_TEST_EXTRA_ARGS="-Divy.cache.ttl.default=1s -Dskip.download=true -Divy.home=/tmp -D/offline=true"
96 +
97 +# Several tests require a certain treatment to "generate-bundles":
98 +# https://github.com/apache/ant-ivy/blob/48234fc5ede85a865eb874a96c08472ce1751fd1/build.xml#L426-L428
99 +# <ant dir="${basedir}/test/test-repo" target="generate-bundles"/>
100 +#
101 +# The procedure is coded in https://github.com/apache/ant-ivy/blob/48234fc5ede85a865eb874a96c08472ce1751fd1/test/test-repo/build.xml#L19-L71
102 +# but appears too difficult to be reprodused with 'java-pkg-simple.eclass'.
103 +# So the failing tests will be excluded, saved for a later attempt.
104 +#
105 +# Not excluding any test classes results in "Tests run: 1109, Failures: 98"
106 +# Excluding those test classes listed below leads to "OK (812 tests)"
107 +JAVA_TEST_EXCLUDES=(
108 + # https://github.com/apache/ant-ivy/blob/083e3f685c1fe29092e59c63b87e81d31fc9babe/build.properties#L56
109 + # test.class.pattern = *Test
110 + "org.apache.ivy.ant.testutil.AntTaskTestCase" # not in scope
111 + "org.apache.ivy.core.TestPerformance" # not in scope
112 + "org.apache.ivy.util.TestXmlHelper" # not in scope
113 + "org.apache.ivy.TestFixture" # not in scope
114 + "org.apache.ivy.TestHelper" # not in scope
115 + # https://github.com/apache/ant-ivy/blob/48234fc5ede85a865eb874a96c08472ce1751fd1/build.xml#L412-L420
116 + # <exclude name="**/Abstract*Test.java"/>
117 + "org.apache.ivy.util.url.AbstractURLHandlerTest"
118 + "org.apache.ivy.plugins.resolver.AbstractDependencyResolverTest"
119 + "org.apache.ivy.plugins.matcher.AbstractPatternMatcherTest"
120 + # following excluded tests cause test failures
121 + "org.apache.ivy.ant.BuildOBRTaskTest" # Tests run: 3, Failures: 2
122 + "org.apache.ivy.core.deliver.DeliverTest" # Tests run: 1, Failures: 1
123 + "org.apache.ivy.core.module.descriptor.IvyMakePomTest" # Tests run: 1, Failures: 1
124 + "org.apache.ivy.core.settings.XmlSettingsParserTest" # Tests run: 29, Failures: 1
125 + "org.apache.ivy.osgi.core.AggregatedOSGiResolverTest" # Tests run: 3, Failures: 1
126 + "org.apache.ivy.osgi.obr.OBRResolverTest" # Tests run: 16, Failures: 16
127 + "org.apache.ivy.osgi.repo.BundleRepoTest" # Tests run: 4, Failures: 3
128 + "org.apache.ivy.plugins.parser.m2.PomModuleDescriptorParserTest" # Tests run: 46, Failures: 1
129 + "org.apache.ivy.plugins.parser.xml.XmlModuleDescriptorParserTest" # Tests run: 44, Failures: 7
130 + "org.apache.ivy.plugins.parser.xml.XmlModuleDescriptorWriterTest" # Tests run: 10, Failures: 1
131 + "org.apache.ivy.plugins.parser.xml.XmlModuleUpdaterTest" # Tests run: 14, Failures: 3
132 + "org.apache.ivy.plugins.resolver.JarResolverTest" # Tests run: 3, Failures: 3
133 + # following excluded tests can pass if run individually
134 + "org.apache.ivy.ant.IvyConfigureTest" # OK (14 tests)
135 + "org.apache.ivy.IvyTest" # OK (1 test)
136 + "org.apache.ivy.MainTest" # OK (12 tests)
137 + "org.apache.ivy.plugins.report.XmlReportWriterTest" # OK (3 tests)
138 + "org.apache.ivy.plugins.resolver.BintrayResolverTest" # OK (12 tests)
139 + "org.apache.ivy.plugins.resolver.ChainResolverTest" # OK (15 tests)
140 + "org.apache.ivy.plugins.resolver.FileSystemResolverTest" # OK (27 tests)
141 + "org.apache.ivy.plugins.resolver.IBiblioMavenSnapshotsResolutionTest" # OK (1 test)
142 + "org.apache.ivy.plugins.resolver.IvyRepResolverTest" # OK (3 tests)
143 + "org.apache.ivy.plugins.resolver.Maven2LocalTest" # OK (2 tests)
144 + "org.apache.ivy.plugins.resolver.PackagerResolverTest" # OK (3 tests)
145 + "org.apache.ivy.plugins.resolver.URLResolverTest" # OK (5 tests)
146 + "org.apache.ivy.plugins.trigger.LogTriggerTest" # OK (3 tests)
147 + # Without PROPERTIES="test_network", the following test cause additional failures.
148 + "org.apache.ivy.core.settings.OnlineXmlSettingsParserTest"
149 +# "org.apache.ivy.osgi.updatesite.UpdateSiteAndIbiblioResolverTest"
150 + "org.apache.ivy.osgi.updatesite.UpdateSiteLoaderTest"
151 +# "org.apache.ivy.plugins.resolver.IBiblioResolverTest"
152 +# "org.apache.ivy.plugins.resolver.MirroredURLResolverTest"
153 + "org.apache.ivy.util.url.ArtifactoryListingTest"
154 +# "org.apache.ivy.util.url.BasicURLHandlerTest"
155 +# "org.apache.ivy.util.url.HttpclientURLHandlerTest"
156 +)
157 +
158 +src_prepare() {
159 + default
160 +
161 + mkdir --parents "${JAVA_RESOURCE_DIRS}/META-INF" || die
162 + pushd "${JAVA_RESOURCE_DIRS}"
163 + cp "${S}"/{NOTICE,LICENSE} META-INF/ || die
164 + cp -r "${S}"/src/java/* . || die
165 +
166 + # DEPRECATED: 'ivyconf' element is deprecated, use 'ivysettings' instead
167 + # according to 210,221 build.xml and still in the upstream .jar file
168 + cp org/apache/ivy/core/settings/ivy{settings,conf}-local.xml || die
169 + cp org/apache/ivy/core/settings/ivy{settings,conf}-default-chain.xml || die
170 + cp org/apache/ivy/core/settings/ivy{settings,conf}-main-chain.xml || die
171 + cp org/apache/ivy/core/settings/ivy{settings,conf}-public.xml || die
172 + cp org/apache/ivy/core/settings/ivy{settings,conf}-shared.xml || die
173 + cp org/apache/ivy/core/settings/ivy{settings,conf}.xml || die
174 +
175 + find . -type f -name '*.java' -exec rm -rf {} + || die
176 + popd || die
177 +}
178 +
179 +src_test() {
180 + # https://github.com/apache/ant-ivy/blob/48234fc5ede85a865eb874a96c08472ce1751fd1/build.xml#L396-L407
181 + # name="build-custom-resolver-jar"
182 + JAVA_SRC_DIR="test/custom-classpath"
183 + JAVA_JAR_FILENAME="test/java/org/apache/ivy/core/settings/custom-resolver.jar"
184 + java-pkg-simple_src_compile
185 +
186 + # Without "license.xml" the tests won't even start. "Tests run: 1109, Failures: 318"
187 + jar -cf test.jar \
188 + -C test/java org/apache/ivy/plugins/parser/xml/license.xml \
189 + -C test/java org/apache/ivy/plugins/parser/m2/license.xml || die
190 +
191 + # Reduce number of failures to "Tests run: 1109, Failures: 98"
192 + jar -uf "test.jar" -C test/java . || die
193 +
194 + # Separate *.java files from test resources
195 + # https://github.com/apache/ant-ivy/blob/48234fc5ede85a865eb874a96c08472ce1751fd1/build.xml#L389-L393
196 + mkdir test-src || die
197 + cp -r test/java test-src/ || die
198 + find test -type f -name '*.java' -exec rm -rf {} + || die
199 +
200 + # https://github.com/apache/ant-ivy/blob/48234fc5ede85a865eb874a96c08472ce1751fd1/build.xml#L430-L438
201 + # name="prepare-test-jar-repositories"
202 + mkdir test/jar-repos || die
203 + jar -cfM "test/jar-repos/jarrepo1.jar" -C test/repositories/1 . || die
204 +# jar -cfM "test/jar-repos/jarrepo1_subdir.jar" -C test/repositories 1/**/*/ || die
205 +
206 + java-pkg-simple_src_test
207 +}
208 +
209 +src_install() {
210 + default
211 + java-osgi_dojar-fromfile "ant-ivy.jar" "META-INF/MANIFEST.MF" "ant-ivy"
212 + use doc && java-pkg_dojavadoc target/api
213 + use source && java-pkg_dosrc src/*
214 +}