-
Notifications
You must be signed in to change notification settings - Fork 156
Expand file tree
/
Copy pathrunjapicmp.sh
More file actions
executable file
·56 lines (43 loc) · 1.69 KB
/
runjapicmp.sh
File metadata and controls
executable file
·56 lines (43 loc) · 1.69 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
#!/bin/bash
set -u # run with unset flag error so that missing parameters cause build failure
set -e # error out on any failed commands
#set -x # echo all commands used for debugging purposes
BASELINE=1.0.0
JAPICMP_VERSION=0.21.2
WD=$(mktemp -d)
echo Working in $WD
function classpath() {
local IFS=':'
shift
echo "$*"
}
curl -s https://repo1.maven.org/maven2/com/github/siom79/japicmp/japicmp/${JAPICMP_VERSION}/japicmp-${JAPICMP_VERSION}-jar-with-dependencies.jar > ${WD}/japicmp.jar
newjars=($(find ${PWD}/*/build/libs -name org.eclipse.lsp4j*.jar -not -name \*sources.jar -not -name \*javadoc.jar))
names=()
oldjars=()
pushd ${WD}
# We need to iterate twice, once to download all the oldjars first, then to run japicmp
# with the classpath containing all the downloaded files
for newjar in ${newjars[@]}
do
name=$(echo $newjar | sed -es,.*/,, -es,-.*\.jar,,)
names+=($name)
oldjar=${name}-${BASELINE}.jar
oldjars+=($oldjar)
curl -s https://repo1.maven.org/maven2/org/eclipse/lsp4j/${name}/${BASELINE}/${name}-${BASELINE}.jar > ${oldjar}
done
for i in ${!newjars[@]}
do
newjar=${newjars[$i]}
oldjar=${oldjars[$i]}
name=${names[$i]}
mkdir -p japicmp-report/
java -jar japicmp.jar --html-file japicmp-report/${name}.html --only-modified --ignore-missing-classes -n ${newjar} --new-classpath $(classpath ${newjars[@]}) -o ${oldjar} --old-classpath $(classpath org.eclipse.*)
zip -u japicmp-report.zip japicmp-report/${name}.html
done
popd
mkdir -p build/p2-repository/
cp ${WD}/japicmp-report.zip build/p2-repository/
cd build/p2-repository/ && unzip japicmp-report.zip
echo
echo Reports complete and have been saved in build/p2-repository/japicmp-report.zip