2022-01-11 14:55:21 -08:00
|
|
|
# This script checks the shadow jar to ensure that we only have allowed classes being exposed through the jar
|
2022-01-20 00:48:09 -08:00
|
|
|
jarFiles=$(find build/libs -name "datahub-client*.jar" | grep -v sources | grep -v javadoc)
|
|
|
|
for jarFile in ${jarFiles}; do
|
|
|
|
jar -tvf $jarFile |\
|
2022-01-11 17:45:31 -08:00
|
|
|
grep -v "datahub/shaded" |\
|
|
|
|
grep -v "META-INF" |\
|
|
|
|
grep -v "com/linkedin" |\
|
|
|
|
grep -v "com/datahub" |\
|
|
|
|
grep -v "datahub" |\
|
|
|
|
grep -v "entity-registry" |\
|
|
|
|
grep -v "pegasus/" |\
|
|
|
|
grep -v "legacyPegasusSchemas/" |\
|
|
|
|
grep -v " com/$" |\
|
2022-01-20 00:48:09 -08:00
|
|
|
grep -v "git.properties" |\
|
|
|
|
grep -v "client.properties"
|
2022-01-11 17:45:31 -08:00
|
|
|
|
2022-01-11 14:55:21 -08:00
|
|
|
if [ $? -ne 0 ]; then
|
2022-01-20 00:48:09 -08:00
|
|
|
echo "✅ No unexpected class paths found in ${jarFile}"
|
2022-01-11 14:55:21 -08:00
|
|
|
else
|
2022-01-20 00:48:09 -08:00
|
|
|
echo "💥 Found unexpected class paths in ${jarFile}"
|
2022-01-11 14:55:21 -08:00
|
|
|
exit 1
|
|
|
|
fi
|
2022-01-20 00:48:09 -08:00
|
|
|
done
|
|
|
|
exit 0
|