This is a legacy repo, check https://github.com/scala/scala-asm for the current one.
This repository contains a fork of the ASM Java bytecode manipulation and analysis framework for the Scala compiler.
The package name is changed to scala.tools.asm
.
There is a small number of other patches applied to the original sources.
Note that this fork only contains a subset of the source files of the ASM repository.
Longer-term, we plan to retire this fork and move to stock ASM. See issue #4 for details.
When upgrading to a new ASM release, we always import the unmodified source files and re-apply all our patches on top. This makes it easy to see how our fork differs from the official release.
The current sources are based on the following version of ASM (browse tags here):
Version 5.1, SVN r1798, tags/ASM_5_1
Previous ASM Upgrade PR: scala/scala-asm#11
Start by deleting all source files and copy the ones from the latest ASM release.
The original ASM sources are in an SVN repository, which is mirrored here: https://github.com/lrytz/asm-legacy-svn-clone. You can use this mirror, your own git-svn mirror, or the original SVN repository to grab the sources of a new ASM version. A description how to work with the git-svn clone is here: lrytz/asm-legacy-svn-clone#1.
Excluded Files (don't copy):
package.html
filesorg/objectweb/asm/commons
, but keepCodeSizeEvaluator.java
org/objectweb/asm/optimizer
org/objectweb/asm/xml
Take a look at the previous PR that upgraded ASM (see above). Follow the upgrade procedure in the same way.
The re-packaging and cleanup commits can be applied using the following commands:
- convert line endings (there are some
CRLF
)
find src -name '*.java' | xargs dos2unix
- change package clauses
find src -name '*.java' | xargs sed -i '' -e 's/package org\.objectweb\.asm/package scala.tools.asm/'
- update imports
find src -name '*.java' | xargs sed -i '' -e 's/import org\.objectweb\.asm/import scala.tools.asm/'
- update
@links
,@associates
find src -name '*.java' | xargs sed -i '' -e 's/@link org\.objectweb\.asm/@link scala.tools.asm/'
find src -name '*.java' | xargs sed -i '' -e 's/@associates org\.objectweb\.asm/@associates scala.tools.asm/'
- remove trailing whitespace
find src -name '*.java' | xargs sed -i '' -e 's/[ ]*$//'
Cherry-pick the actual changes that we have in our fork:
- Include the commits labelled
[asm-cherry-pick]
in the previous upgrade PR - Include the changes to
src
that were added since the last upgrade, and label them[asm-cherry-pick]
Update the "Current Version" section of this README.