Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[MINOR] sort dependencise before check #808

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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