-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move 3rd party license check into separate bash scripts
The functionality for creating the list of 3rd party dependencies and checking their licenses using the Eclipse Dash tool has been moved into a distinct bash script so that it can be used more easily in a local workspace.
- Loading branch information
1 parent
9c10d55
commit 6437fc6
Showing
2 changed files
with
48 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
#!/bin/bash | ||
deps_file=${DEPS_FILE:-"DEPS.txt"} | ||
dash_jar=${DASH_JAR:-"/tmp/dash.jar"} | ||
dash_summary=${DASH_SUMMARY:-"DASH_SUMMARY.txt"} | ||
project=${PROJECT:-"automotive.uprotocol"} | ||
token=$1 | ||
|
||
echo "creating 3rd party dependency list..." | ||
cargo tree -e no-build,no-dev --prefix none --no-dedupe \ | ||
| sed -n '2~1p' \ | ||
| sort -u \ | ||
| grep -v '^[[:space:]]*$' \ | ||
| sed -E 's|([^ ]+) v([^ ]+).*|crate/cratesio/-/\1/\2|' \ | ||
> "$deps_file" | ||
|
||
if [[ ! -r "$dash_jar" ]]; then | ||
echo "Eclipse Dash JAR file [${dash_jar}] not found, downloading latest version from GitHub..." | ||
wget_bin=$(which wget) | ||
if [[ -z "$wget_bin" ]]; then | ||
echo "wget command not available on path" | ||
exit 127 | ||
else | ||
wget --quiet -O "$dash_jar" "https://repo.eclipse.org/service/local/artifact/maven/redirect?r=dash-licenses&g=org.eclipse.dash&a=org.eclipse.dash.licenses&v=LATEST" | ||
echo "successfully downloaded Eclipse Dash JAR to ${dash_jar}" | ||
fi | ||
fi | ||
|
||
if [[ -n "$token" ]]; then | ||
additional_args="-review -token $token -project $project" | ||
else | ||
additional_args="" | ||
fi | ||
echo "checking 3rd party licenses..." | ||
java -jar "$dash_jar" -timeout 60 -batch 90 -summary "$dash_summary" $additional_args "$deps_file" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters