Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Luc Bourlier
committed
Jul 17, 2014
1 parent
b1110ec
commit a351610
Showing
3 changed files
with
170 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
#!/bin/bash -xe | ||
##### | ||
# | ||
##### | ||
# $1 result file | ||
# $2 partern to exclude. '/' chars have to be escaped: '\/' | ||
##### | ||
|
||
RESULT_FILE="$1" | ||
EXCL_PATTERN="$2" | ||
|
||
# clear the file | ||
echo -n "" > ${RESULT_FILE} | ||
|
||
for CLASSFILE in $(find . -name '*.class') | ||
do | ||
# for each .class file in the hierarchy | ||
CLASSNAME=${CLASSFILE#*classes/} | ||
CLASSNAME=${CLASSNAME%.class} | ||
CLASSNAME=${CLASSNAME//\//.} | ||
|
||
# extract binary references | ||
javap -v ${CLASSFILE} | grep '= \(Methodref\|Class\)' | awk "/org\/scalaide\// && !/${EXCL_PATTERN}/ {print \$6\" ${CLASSNAME}\"}" >> ${RESULT_FILE} | ||
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
|
||
--- for one project | ||
find . -name '*.scala' | xargs grep 'scalaide.*\.internal' | awk -F ': *import ' '{imp[$2] = imp[$2]$1"\n"} END {for (i in imp) {print ">>>> "i" :\n"imp[i];}}' | ||
|
||
|
||
--- per project | ||
find . -name '*.scala' | xargs grep 'scalaide.*\.internal' | awk -F ': *import ' 'BEGIN {RS="(\r\n|\n)"} {print $2" "substr($1, 3)}' | ||
|
||
--- grouped list, but not correctly ordered | ||
sort play.internal scalatest.internal search.internal worksheet.internal | awk '{imp[$1] = imp[$1]" "$2"\n"} END {for (i in imp) {print ">>>> "i" :\n"imp[i];}}' | ||
|
||
--- grouped list, with the right order | ||
cat play.internal scalatest.internal search.internal worksheet.internal | awk '\ | ||
{ | ||
imp[$1] = imp[$1]" "$2"\n" | ||
} | ||
|
||
END { | ||
k = 1 | ||
for (i in imp) { | ||
keys[k++] = i | ||
} | ||
|
||
isort(keys, k) | ||
|
||
for (i = 1; i <= k ; i++) { | ||
print ">>>> "keys[i]" :\n"imp[keys[i]] | ||
} | ||
} | ||
|
||
#insertion sort of A[1..n] | ||
function isort( A, n, i, j, hold) | ||
{ | ||
for( i = 2 ; i <= n ; i++) | ||
{ | ||
hold = A[j = i] | ||
while ( A[j-1] > hold ) | ||
{ j-- ; A[j+1] = A[j] } | ||
A[j] = hold | ||
} | ||
# sentinel A[0] = "" will be created if needed | ||
} | ||
' | ||
|
||
--- grouped list, with the right order, as csv | ||
cat play.internal scalatest.internal search.internal worksheet.internal | awk '\ | ||
{ | ||
imp[$1] = imp[$1]" , "$2"\n" | ||
} | ||
|
||
END { | ||
k = 1 | ||
for (i in imp) { | ||
keys[k++] = i | ||
} | ||
|
||
isort(keys, k) | ||
|
||
for (i = 1; i <= k ; i++) { | ||
print ">>>> "keys[i]" \n"imp[keys[i]] | ||
} | ||
} | ||
|
||
#insertion sort of A[1..n] | ||
function isort( A, n, i, j, hold) | ||
{ | ||
for( i = 2 ; i <= n ; i++) | ||
{ | ||
hold = A[j = i] | ||
while ( A[j-1] > hold ) | ||
{ j-- ; A[j+1] = A[j] } | ||
A[j] = hold | ||
} | ||
# sentinel A[0] = "" will be created if needed | ||
} | ||
' | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
#!/bin/bash -xe | ||
|
||
WITH_VERSION_IN_NAME=false | ||
case $1 in | ||
--with-version-in-name ) | ||
WITH_VERSION_IN_NAME=true | ||
shift | ||
;; | ||
esac | ||
|
||
VERSION=$1 | ||
DEST_FOLDER=$2 | ||
|
||
function genLibrary () { | ||
cd scala-library | ||
cat > library.properties << EOF | ||
# To test library with a 2.10.x version number | ||
version.number=${VERSION} | ||
copyright.string=Copyright 2002-2011, LAMP/EPFL | ||
EOF | ||
|
||
local JAR_NANE="" | ||
if $WITH_VERSION_IN_NAME | ||
then | ||
JAR_NAME="scala-library_${VERSION}.jar" | ||
else | ||
JAR_NAME="scala-library.jar" | ||
fi | ||
|
||
zip -r ${JAR_NAME} library.properties META-INF/ scala/ | ||
|
||
cp ${JAR_NAME} ${DEST_FOLDER} | ||
|
||
cd .. | ||
} | ||
|
||
function gen () { | ||
ID=$1 | ||
|
||
mkdir -p scala-${ID} | ||
cd scala-${ID} | ||
cat > ${ID}.properties << EOF | ||
version.number=${VERSION} | ||
EOF | ||
|
||
local JAR_NANE="" | ||
if $WITH_VERSION_IN_NAME | ||
then | ||
JAR_NAME="scala-${ID}_${VERSION}.jar" | ||
else | ||
JAR_NAME="scala-${ID}.jar" | ||
fi | ||
|
||
zip ${JAR_NAME} ${ID}.properties | ||
|
||
cp ${JAR_NAME} ${DEST_FOLDER} | ||
|
||
cd .. | ||
} | ||
|
||
mkdir -p ${DEST_FOLDER} | ||
|
||
genLibrary | ||
gen compiler | ||
gen reflect | ||
gen swing | ||
gen actor | ||
|