Skip to content

Commit

Permalink
added script for finding out which Ditto artifacts are missing from t…
Browse files Browse the repository at this point in the history
…he ditto-bom

Signed-off-by: Thomas Jaeckle <thomas.jaeckle@bosch.io>
  • Loading branch information
thjaeckle committed Feb 16, 2021
1 parent 2c239de commit 494cba5
Showing 1 changed file with 35 additions and 0 deletions.
35 changes: 35 additions & 0 deletions bom/checkBomCompleteness.sh
@@ -0,0 +1,35 @@
#!/bin/sh
#
# Copyright (c) 2021 Contributors to the Eclipse Foundation
#
# See the NOTICE file(s) distributed with this work for additional
# information regarding copyright ownership.
#
# This program and the accompanying materials are made available under the
# terms of the Eclipse Public License 2.0 which is available at
# http://www.eclipse.org/legal/epl-2.0
#
# SPDX-License-Identifier: EPL-2.0
#
cd ../

mvn dependency:list -DincludeGroupIds=org.eclipse.ditto -Dsort=true -DoutputFile=dependencies.txt
find . -name dependencies.txt|while read i; do cat $i;done|grep 'org.eclipse.ditto:' |tr -d '[:blank:]'|sed -e 's/(optional)//' -e 's/:compile.*/:compile/'|awk -F ':' '{print $2}'|sort|uniq > bom/ditto-modules.txt

# Cleanup temp files
find . -name dependencies.txt|while read i; do rm $i;done

cd bom/
echo "Checking for missing dependencies from BOM. If no lines appear below, all dependencies were included. Missing from BOM are:"

while read p; do
if grep -Fq "<artifactId>$p" pom.xml
then
# do nothing
printf ""
else
echo "org.eclipse.ditto:$p is not present in pom!"
fi
done <ditto-modules.txt

rm ditto-modules.txt

0 comments on commit 494cba5

Please sign in to comment.