Skip to content

Commit

Permalink
[MINOR] sort dependencise before check (#808)
Browse files Browse the repository at this point in the history
  • Loading branch information
ruanwenjun authored Mar 10, 2022
1 parent caaa7a4 commit e5bf731
Showing 1 changed file with 22 additions and 3 deletions.
25 changes: 22 additions & 3 deletions tools/third-party-dependencies/check-dependencies.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,24 @@
# limitations under the License.
#

# ********************************************************************
# This script used to check the dependencies are all in our exception.
# This will not check the license legality
# ********************************************************************

# Used to store the tmp files.
decompress_conf='build/tmp'
self_modules_txt='tools/third-party-dependencies/self-modules.txt'
# store all dependencies from our binary jar.
all_dependencies_txt='tools/third-party-dependencies/all-dependencies.txt'
third_party_dependencies_txt='tools/third-party-dependencies/third-party-dependencies.txt'
# store all our known dependencies
known_third_party_dependencies_txt='tools/third-party-dependencies/known-dependencies.txt'

# Below files is generated by this script.
# store all EventMesh self module's name.
self_modules_txt='tools/third-party-dependencies/self-modules.txt'
# store all third part dependencies
third_party_dependencies_txt='tools/third-party-dependencies/third-party-dependencies.txt'

mkdir $decompress_conf || true
tar -zxf build/EventMesh*.tar.gz -C $decompress_conf

Expand All @@ -32,5 +44,12 @@ find "$decompress_conf" -name "*.jar" -exec basename {} \; | uniq | sort > "$all
grep -wvf "$self_modules_txt" "$all_dependencies_txt" | uniq | sort > "$third_party_dependencies_txt"

# If the check is success it will return 0
diff -w -B "$third_party_dependencies_txt" "$known_third_party_dependencies_txt"
sort "$known_third_party_dependencies_txt" | diff - "$third_party_dependencies_txt"

if [ $? -eq 0 ]
then
echo "Dependencies check success"
else
echo "Dependencies check failed, please check if you add unknown dependencies"
exit 1
fi

0 comments on commit e5bf731

Please sign in to comment.