Merge modular branch

This commit is contained in:
Mikolaj Izdebski 2021-05-14 17:26:39 +02:00
commit 97bf5ed7c4
7 changed files with 100 additions and 182 deletions

62
.gitignore vendored
View File

@ -5,6 +5,68 @@
/noarch
/objectweb-asm-*.tar.gz
/objectweb-asm-*/
/archive.tar.gz
/asm-6.2.pom
/asm-analysis-6.2.pom
/asm-commons-6.2.pom
/asm-test-6.2.pom
/asm-tree-6.2.pom
/asm-util-6.2.pom
/asm-xml-6.2.pom
/objectweb-asm-6.2.tar.gz
/objectweb-asm-6.2.1.tar.gz
/asm-6.2.1.pom
/asm-analysis-6.2.1.pom
/asm-commons-6.2.1.pom
/asm-test-6.2.1.pom
/asm-tree-6.2.1.pom
/asm-util-6.2.1.pom
/asm-xml-6.2.1.pom
/objectweb-asm-7.0.tar.gz
/objectweb-asm-7.0/
/asm-7.0.pom
/asm-analysis-7.0.pom
/asm-commons-7.0.pom
/asm-test-7.0.pom
/asm-tree-7.0.pom
/asm-util-7.0.pom
/objectweb-asm-7.1.tar.gz
/asm-7.1.pom
/asm-analysis-7.1.pom
/asm-commons-7.1.pom
/asm-test-7.1.pom
/asm-tree-7.1.pom
/asm-util-7.1.pom
/objectweb-asm-7.1/
/objectweb-asm-7.2.tar.gz
/asm-7.2.pom
/asm-analysis-7.2.pom
/asm-commons-7.2.pom
/asm-test-7.2.pom
/asm-tree-7.2.pom
/asm-util-7.2.pom
/objectweb-asm-7.3.1.tar.gz
/asm-7.3.1.pom
/asm-analysis-7.3.1.pom
/asm-commons-7.3.1.pom
/asm-test-7.3.1.pom
/asm-tree-7.3.1.pom
/asm-util-7.3.1.pom
/objectweb-asm-8.0.1.tar.gz
/asm-8.0.1.pom
/asm-analysis-8.0.1.pom
/asm-commons-8.0.1.pom
/asm-test-8.0.1.pom
/asm-tree-8.0.1.pom
/asm-util-8.0.1.pom
/objectweb-asm-9.0.tar.gz
/asm-9.0.pom
/asm-analysis-9.0.pom
/asm-commons-9.0.pom
/asm-test-9.0.pom
/asm-tree-9.0.pom
/asm-util-9.0.pom
/objectweb-asm-9.1.tar.gz
/asm-9.1.pom
/asm-analysis-9.1.pom
/asm-commons-9.1.pom

View File

@ -1,26 +0,0 @@
From feff2c9f3e5bc3a9900ac0ce7dfb9e9c2ce3e505 Mon Sep 17 00:00:00 2001
From: Mat Booth <mat.booth@redhat.com>
Date: Fri, 19 Feb 2021 15:36:30 +0000
Subject: [PATCH] Catch CompileException in test
---
asm-util/src/test/java/org/objectweb/asm/util/ASMifierTest.java | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/asm-util/src/test/java/org/objectweb/asm/util/ASMifierTest.java b/asm-util/src/test/java/org/objectweb/asm/util/ASMifierTest.java
index b097b58..adfde2c 100644
--- a/asm-util/src/test/java/org/objectweb/asm/util/ASMifierTest.java
+++ b/asm-util/src/test/java/org/objectweb/asm/util/ASMifierTest.java
@@ -107,8 +107,8 @@ public class ASMifierTest extends AsmTest {
}
private static byte[] compile(final String name, final String source) throws IOException {
- Parser parser = new Parser(new Scanner(name, new StringReader(source)));
try {
+ Parser parser = new Parser(new Scanner(name, new StringReader(source)));
UnitCompiler unitCompiler = new UnitCompiler(parser.parseCompilationUnit(), ICLASS_LOADER);
return unitCompiler.compileUnit(true, true, true)[0].toByteArray();
} catch (CompileException e) {
--
2.28.0

View File

@ -1,57 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.ow2</groupId>
<artifactId>ow2</artifactId>
<version>1.5</version>
</parent>
<groupId>org.ow2.asm</groupId>
<artifactId>asm-all</artifactId>
<version>@VERSION@</version>
<dependencies>
<dependency>
<groupId>org.ow2.asm</groupId>
<artifactId>asm</artifactId>
<version>@VERSION@</version>
</dependency>
<dependency>
<groupId>org.ow2.asm</groupId>
<artifactId>asm-analysis</artifactId>
<version>@VERSION@</version>
</dependency>
<dependency>
<groupId>org.ow2.asm</groupId>
<artifactId>asm-commons</artifactId>
<version>@VERSION@</version>
</dependency>
<dependency>
<groupId>org.ow2.asm</groupId>
<artifactId>asm-tree</artifactId>
<version>@VERSION@</version>
</dependency>
<dependency>
<groupId>org.ow2.asm</groupId>
<artifactId>asm-util</artifactId>
<version>@VERSION@</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>3.1.1</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>

View File

@ -6,15 +6,15 @@ version="$(sed -n 's/Version:\s*//p' *.spec)"
gittag="ASM_${version//./_}"
# RETRIEVE
wget "https://gitlab.ow2.org/asm/asm/repository/${gittag}/archive.tar.gz#/${name}-${version}.tar.gz" -O "${name}-${version}.orig.tar.gz"
wget "https://gitlab.ow2.org/asm/asm/-/archive/${gittag}/asm-${gittag}.tar.gz" -O "${name}-${version}.orig.tar.gz"
rm -rf tarball-tmp
mkdir tarball-tmp
cd tarball-tmp
tar xf "../${name}-${version}.orig.tar.gz"
pushd tarball-tmp
tar -xzf "../${name}-${version}.orig.tar.gz"
# Rename dir not to contain commit
mv asm-${gittag}-* ${name}-${version}
mv asm-${gittag} ${name}-${version}
# CLEAN TARBALL
# Remove all jar files
@ -23,6 +23,6 @@ find -name '*.jar' -delete
find */asm{,-analysis,-commons} -name '*.class' -delete
rm -r */gradle
tar cf "../${name}-${version}.tar.gz" -I 'gzip -9' *
cd ..
tar -czf "../${name}-${version}.tar.gz" *
popd
rm -r tarball-tmp "${name}-${version}.orig.tar.gz"

View File

@ -1,12 +1,11 @@
%bcond_without junit5
%bcond_without osgi
%bcond_with bootstrap
Name: objectweb-asm
Version: 9.1
Release: 1%{?dist}
Summary: Java bytecode manipulation and analysis framework
License: BSD
URL: http://asm.ow2.org/
URL: https://asm.ow2.org/
BuildArch: noarch
# ./generate-tarball.sh
@ -18,35 +17,12 @@ Source4: https://repo1.maven.org/maven2/org/ow2/asm/asm-commons/%{version
Source5: https://repo1.maven.org/maven2/org/ow2/asm/asm-test/%{version}/asm-test-%{version}.pom
Source6: https://repo1.maven.org/maven2/org/ow2/asm/asm-tree/%{version}/asm-tree-%{version}.pom
Source7: https://repo1.maven.org/maven2/org/ow2/asm/asm-util/%{version}/asm-util-%{version}.pom
# We still want to create an "all" uberjar, so this is a custom pom to generate it
# TODO: Fix other packages to no longer depend on "asm-all" so we can drop this
Source8: asm-all.pom
# The source contains binary jars that cannot be verified for licensing and could be proprietary
Source9: generate-tarball.sh
# Move a statement that can throw a CompileException inside a try-catch block
# for that exception. Upstream has fixed this another way with a large code
# refactor that seems inappropriate to backport.
Patch1: 0001-Catch-CompileException-in-test.patch
Source9: generate-tarball.sh
BuildRequires: maven-local
BuildRequires: mvn(org.apache.felix:maven-bundle-plugin)
BuildRequires: mvn(org.apache.maven.plugins:maven-shade-plugin)
BuildRequires: mvn(org.ow2:ow2:pom:)
%if %{with junit5}
BuildRequires: mvn(org.codehaus.janino:commons-compiler)
BuildRequires: mvn(org.codehaus.janino:janino)
BuildRequires: mvn(org.junit.jupiter:junit-jupiter-api)
BuildRequires: mvn(org.junit.jupiter:junit-jupiter-engine)
BuildRequires: mvn(org.junit.jupiter:junit-jupiter-params)
BuildRequires: mvn(org.apache.maven.surefire:surefire-junit-platform)
%endif
%if %{with osgi}
# asm-all needs to be in pluginpath for BND. If this self-dependency
# becomes a problem then ASM core will have to be build from source
# with javac before main maven build, just like bnd-module-plugin
BuildRequires: objectweb-asm >= 6
%if %{with bootstrap}
BuildRequires: javapackages-bootstrap
%endif
# Explicit javapackages-tools requires since asm-processor script uses
@ -67,65 +43,16 @@ Summary: API documentation for %{name}
This package provides %{summary}.
%prep
%autosetup -p1
%setup -q
# A custom parent pom to aggregate the build
cp -p %{SOURCE1} pom.xml
%if %{without junit5}
%pom_disable_module asm-test
%endif
# Insert poms into modules
for pom in asm asm-analysis asm-commons asm-test asm-tree asm-util; do
cp -p $RPM_SOURCE_DIR/${pom}-%{version}.pom $pom/pom.xml
%if %{with osgi}
if [ "$pom" != "asm-test" ] ; then
# Make into OSGi bundles
bsn="org.objectweb.${pom//-/.}"
%pom_xpath_inject pom:project "<packaging>bundle</packaging>" $pom
%pom_add_plugin org.apache.felix:maven-bundle-plugin:3.5.0 $pom \
" <extensions>true</extensions>
<configuration>
<instructions>
<Bundle-SymbolicName>$bsn</Bundle-SymbolicName>
<Bundle-RequiredExecutionEnvironment>JavaSE-1.8</Bundle-RequiredExecutionEnvironment>
<_removeheaders>Bnd-LastModified,Build-By,Created-By,Include-Resource,Require-Capability,Tool</_removeheaders>
<_pluginpath>$(pwd)/tools/bnd-module-plugin/bnd-module-plugin.jar, $(find-jar objectweb-asm/asm-all)</_pluginpath>
<_plugin>org.objectweb.asm.tools.ModuleInfoBndPlugin;</_plugin>
</instructions>
</configuration>"
fi
%endif
%pom_remove_parent $pom
done
# Fix junit5 configuration
%if %{with junit5}
%pom_add_dep org.junit.jupiter:junit-jupiter-engine:5.7.0:test asm asm-analysis asm-commons asm-tree asm-util
%pom_add_dep org.junit.jupiter:junit-jupiter-params:5.7.0:test asm asm-analysis asm-commons asm-tree asm-util
%pom_add_plugin org.apache.maven.plugins:maven-surefire-plugin:2.22.0 asm asm-analysis asm-commons asm-test asm-tree asm-util
%pom_add_dep org.ow2.asm:asm-test:%{version}:test asm asm-analysis asm-commons asm-tree asm-util
%pom_add_dep org.ow2.asm:asm-util:%{version}:test asm-commons
%pom_add_dep org.codehaus.janino:janino:2.7.8:test asm-util
%pom_add_dep org.codehaus.janino:commons-compiler:2.7.8:test asm-util
%endif
# Disable tests that use unlicensed class files
sed -i -e '/testToByteArray_computeMaxs_largeSubroutines/i@org.junit.jupiter.api.Disabled("missing class file")' \
asm/src/test/java/org/objectweb/asm/ClassWriterTest.java
sed -i -e '/testAnalyze_mergeWithJsrReachableFromTwoDifferentPaths/i@org.junit.jupiter.api.Disabled("missing class file")' \
asm-analysis/src/test/java/org/objectweb/asm/tree/analysis/AnalyzerWithBasicInterpreterTest.java
sed -i -e '/testAllMethods_issue317586()/i@org.junit.jupiter.api.Disabled("missing class file")' \
asm-commons/src/test/java/org/objectweb/asm/commons/LocalVariablesSorterTest.java
# Remove failing test SerialVersionUidAdderTest due to missing class files
rm asm-commons/src/test/java/org/objectweb/asm/commons/SerialVersionUidAdderTest.java
# Insert asm-all pom
mkdir -p asm-all
sed 's/@VERSION@/%{version}/g' %{SOURCE8} > asm-all/pom.xml
# Compat aliases
%mvn_alias :asm-all org.ow2.asm:asm-debug-all
# No need to ship the custom parent pom
%mvn_package :asm-aggregator __noinstall
@ -133,17 +60,7 @@ sed 's/@VERSION@/%{version}/g' %{SOURCE8} > asm-all/pom.xml
%mvn_package :asm-test __noinstall
%build
# Must compile bnd plugin first, which is used to generate Java 9 module-info.class files
pushd tools/bnd-module-plugin
javac -sourcepath ../../asm/src/main/java/ -cp $(build-classpath aqute-bnd) $(find -name *.java)
jar cf bnd-module-plugin.jar -C src/main/java org
popd
%if %{with junit5}
%mvn_build -- -Dmaven.compiler.source=1.8 -Dmaven.compiler.target=1.8
%else
%mvn_build -f -- -Dmaven.compiler.source=1.8 -Dmaven.compiler.target=1.8
%endif
%install
%mvn_install
@ -158,12 +75,18 @@ popd
%license LICENSE.txt
%changelog
* Fri May 14 2021 Marian Koncek <mkoncek@redhat.com> - 9.1-1
- Update to upstream version 9.1
* Fri Feb 19 2021 Mat Booth <mat.booth@redhat.com> - 9.1-1
- Update to latest upstream release
* Tue Jan 26 2021 Fedora Release Engineering <releng@fedoraproject.org> - 8.0.1-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild
* Fri Sep 25 2020 Marian Koncek <mkoncek@redhat.com> - 9.0-1
- Update to upstream version 9.0
* Fri Aug 14 2020 Jerry James <loganjerry@gmail.com> - 8.0.1-1
- Version 8.0.1
- Add 0002-Catch-CompileException-in-test.patch to fix compilation of a test
@ -175,6 +98,9 @@ popd
* Sat Jul 11 2020 Jiri Vanek <jvanek@redhat.com> - 7.3.1-3
- Rebuilt for JDK-11, see https://fedoraproject.org/wiki/Changes/Java11
* Mon Jun 22 2020 Marian Koncek <mkoncek@redhat.com> - 8.0.1-1
- Update to upstream version 8.0.1
* Wed May 06 2020 Mat Booth <mat.booth@redhat.com> - 7.3.1-2
- Revert an upstream change to prevent breaking API change
@ -184,9 +110,24 @@ popd
* Wed Jan 29 2020 Fedora Release Engineering <releng@fedoraproject.org> - 7.0-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild
* Tue Jan 21 2020 Marian Koncek <mkoncek@redhat.com> - 7.3.1-1
- Update to upstream version 7.3.1
* Tue Nov 05 2019 Mikolaj Izdebski <mizdebsk@redhat.com> - 7.2-2
- Mass rebuild for javapackages-tools 201902
* Thu Oct 17 2019 Marian Koncek <mkoncek@redhat.com> - 7.2-1
- Update to upstream version 7.2
* Thu Jul 25 2019 Fedora Release Engineering <releng@fedoraproject.org> - 7.0-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild
* Fri May 24 2019 Mikolaj Izdebski <mizdebsk@redhat.com> - 7.1-2
- Mass rebuild for javapackages-tools 201901
* Mon May 06 2019 Severin Gehwolf <sgehwolf@redhat.com> - 7.1-1
- Update to latest upstream 7.1 release.
* Fri Feb 01 2019 Fedora Release Engineering <releng@fedoraproject.org> - 7.0-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild

View File

@ -13,9 +13,7 @@
<module>asm</module>
<module>asm-analysis</module>
<module>asm-commons</module>
<module>asm-test</module>
<module>asm-tree</module>
<module>asm-util</module>
<module>asm-all</module>
</modules>
</project>

View File

@ -1,4 +1,4 @@
SHA512 (objectweb-asm-9.1.tar.gz) = c5cff60acc0fc31842e397abff376e9061c5431fbfba8c0a24fd54ac654bb78382fdb30142b76cf87e87c43f89167ea36a2fd2320583de2b26a19e8abdde4772
SHA512 (objectweb-asm-9.1.tar.gz) = 4cce236397f963e8b707136164c370cfbb1d5167a03545d413f91751df3197ccfeee9f1f34943a77fbb9713ba002e5c9ecf6ddc65adfe6f821304ad6a4fa26f6
SHA512 (asm-9.1.pom) = 9bdc46e2ee6721d9228b2ae9518a118b38f9cb35cfbf2a0a885f439b6cd8705cd62d6502fb1d6bb83523a1fc0b5d18832a0e231dc9ed4e0ca7fbd83bbf595061
SHA512 (asm-analysis-9.1.pom) = f94b222e6ea2c964bde42785e43d82dc8ac4d07ad1b8748c6ee0e66ca70a5e3ee2dce0338ada8928b93929436bfc3227d5e2f73573caad67dd57e1bd612c9eec
SHA512 (asm-commons-9.1.pom) = ea17ae1dc7f732cb87d0bab9d68035b088577ed32b6fca3c70386f56feebbdd467dabe997e27134f8ad7c2133187af763b9c3aad696cce2ba36cf68f3f09b760