Skip to content

Commit

Permalink
Provide script to help upgrade embedded copy of ASM
Browse files Browse the repository at this point in the history
  • Loading branch information
mcculls committed Nov 13, 2022
1 parent ee4fb78 commit b8ec082
Showing 1 changed file with 37 additions and 0 deletions.
37 changes: 37 additions & 0 deletions bin/update_asm.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
#*******************************************************************************
# Copyright (c) 2022-present Sonatype, Inc. and others.
# All rights reserved. This program and the accompanying materials
# are made available under the terms of the Eclipse Public License v1.0
# which accompanies this distribution, and is available at
# http://www.eclipse.org/legal/epl-v10.html
#
# Contributors:
# Stuart McCulloch - initial API and implementation
#*******************************************************************************
#!/bin/sh
set -e

TAG=$1

if [[ ! "${TAG}" =~ ^ASM_[0-9A-Z_]+$ ]]
then
echo "Usage: update_asm.sh <tag>"
exit 1
fi

SRC=asm-${TAG}/asm/src/main/java/org/objectweb/asm
DST=org.eclipse.sisu.inject/src/org/eclipse/sisu/space/asm/

rm ${DST}/*.java
curl -s https://gitlab.ow2.org/asm/asm/-/archive/${TAG}/asm-${TAG}.zip | jar x ${SRC}

for f in ${SRC}/*.java
do
sed -e "s@org/objectweb/asm@org/eclipse/sisu/space/asm@" \
-e "s@org\.objectweb\[email protected]@" \
$f > ${DST}/`basename $f`
done

rm -r ${SRC}/*
rmdir -p ${SRC}

0 comments on commit b8ec082

Please sign in to comment.