3 # Copyright (c) 2019 Pantheon Technologies, s.r.o. and others. All rights reserved.
5 # This program and the accompanying materials are made available under the
6 # terms of the Eclipse Public License v1.0 which accompanies this distribution,
7 # and is available at http://www.eclipse.org/legal/epl-v10.html
9 # Simple script to check consistency of the shaded artifact. It is by no means perfect,
10 # but it's better than nothing.
14 # nite@nitebug : ~/netconf/netconf/shaded-exificient-jar $ mvn clean install
15 # nite@nitebug : ~/netconf/netconf/shaded-exificient-jar $ mkdir x
16 # nite@nitebug : ~/netconf/netconf/shaded-exificient-jar $ cd x
17 # nite@nitebug : ~/netconf/netconf/shaded-exificient-jar/x $ rm -rf * && unzip ../target/shaded-exificient-jar-*-SNAPSHOT.jar && ../check_jar.sh .
20 if [ ! -d "$1" ]; then
21 echo "Directory $root does not exist"
25 if [ ! -f check_strings1.txt ]; then
26 echo "Looking for strings ..."
27 find "$root" -name \*.class | xargs strings | sort -u | fgrep shaded/ | sed 's/;/ /g' | sed "s/'//g"> check_strings1.txt
28 rm -f check_strings2.txt
31 if [ ! -f check_strings2.txt ]; then
32 echo "Splitting strings ..."
33 sort -u check_strings1.txt | xargs -n1 | fgrep shaded/ | sort -u > check_strings2.txt
34 rm -f check_strings3.txt
37 if [ ! -f check_strings3.txt ]; then
38 echo "Cleaning strings ..."
39 sed 's#.*shaded/##' check_strings2.txt | sort -u > check_strings3.txt
42 for i in `cat check_strings3.txt`; do
45 count=`find "$root/org/opendaylight/netconf/shaded/$dir" -name $name\* -printf . | wc -c`
46 if [ $count -eq 0 ]; then
49 find "$root" -name \*.class | xargs fgrep -l "$i"