Skip to content

Commit 406f4d3

Browse files
committed
Add compliance checking script
Change-Id: I4ae63a968a4520052644abb5b1260a43ce188d57
1 parent f43b87a commit 406f4d3

2 files changed

Lines changed: 35 additions & 0 deletions

File tree

scripts/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
compat_reports

scripts/compare.sh

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
# Usage:
2+
# VERSION_1=1.2.1 VERSION_2=2.0.0-SNAPSHOT ./compare.sh
3+
#
4+
# Results:
5+
# See the compat_reports folder
6+
7+
# All FirebaseUI libraries
8+
LIBRARIES=( firebase-ui-auth firebase-ui-database firebase-ui-storage )
9+
10+
for LIB in "${LIBRARIES[@]}"
11+
do
12+
# Get AAR names
13+
VERSION_1_AAR="$LIB-$VERSION_1.aar"
14+
VERSION_2_AAR="$LIB-$VERSION_2.aar"
15+
16+
cp ~/.m2/repository/com/firebaseui/$LIB/$VERSION_1/$VERSION_1_AAR .
17+
cp ~/.m2/repository/com/firebaseui/$LIB/$VERSION_2/$VERSION_2_AAR .
18+
19+
# Unzip them into temp directories
20+
mkdir $VERSION_1 $VERSION_2
21+
22+
unzip -d $VERSION_1 $VERSION_1_AAR
23+
unzip -d $VERSION_2 $VERSION_2_AAR
24+
25+
# Compare them
26+
japi-compliance-checker --lib=$LIB \
27+
$VERSION_1/classes.jar $VERSION_2/classes.jar
28+
29+
# Remove AARs
30+
rm $VERSION_1_AAR $VERSION_2_AAR
31+
32+
# Remove unzipped
33+
rm -r $VERSION_1 $VERSION_2
34+
done

0 commit comments

Comments
 (0)