Chromium Code Reviews| Index: runtime/observatory/maintainers/snapshot_dependencies.sh |
| diff --git a/runtime/observatory/maintainers/snapshot_dependencies.sh b/runtime/observatory/maintainers/snapshot_dependencies.sh |
| new file mode 100755 |
| index 0000000000000000000000000000000000000000..456c42618e91ea7e3a65d40299a8bddfc2dc6c36 |
| --- /dev/null |
| +++ b/runtime/observatory/maintainers/snapshot_dependencies.sh |
| @@ -0,0 +1,63 @@ |
| +#!/bin/sh |
| + |
| +# This script will create a deep snapshot of all Observatory package |
| +# dependencies. The output will be in observatory_pub_packages which |
| +# then should be committed to third_party/observatory_pub_packages. |
| + |
| + |
| +PUBSPEC_INPUT="pubspec.template" |
| +PUBSPEC_OUTPUT="pubspec.yaml" |
| +PACKAGES_INPUT="packages" |
| +PACKAGES_OUTPUT="observatory_pub_packages" |
| + |
| +if [ ! -d "../maintainers" ]; then |
| + echo "Please run this script from the maintainers directory" |
| + exit |
| +fi |
| + |
| +if [ ! -f $PUBSPEC_INPUT ]; then |
| + echo "Cannot find $PUBSPEC_INPUT" |
| + exit |
| +fi |
| + |
| +# Cleanup leftovers |
| +rm -f $PUBSPEC_OUTPUT |
| +rm -rf $PACKAGES_INPUT |
| +rm -rf $PACKAGES_OUTPUT |
| + |
| +# Setup for pub get run |
| +cp $PUBSPEC_INPUT $PUBSPEC_OUTPUT |
| + |
| +# Run pub get |
| +pub get |
| + |
| +# Prepare for output |
| +mkdir $PACKAGES_OUTPUT |
| + |
| +OUTPUT_BASE=`realpath $PACKAGES_OUTPUT` |
| +# Copy necessary files |
| +pushd $PACKAGES_INPUT > /dev/null |
| +for i in *; do |
| + ACTUAL_PATH=`realpath $i` |
| + mkdir $OUTPUT_BASE/$i |
| + mkdir $OUTPUT_BASE/$i/lib |
| + #grep "^name\|^version" $ACTUAL_PATH/../pubspec.yaml > $OUTPUT_BASE/$i/pubspec.yaml |
|
turnidge
2015/01/05 21:05:55
Commented line (you noticed this yourself)
Cutch
2015/01/05 21:20:19
Done.
|
| + cp $ACTUAL_PATH/../pubspec.yaml $OUTPUT_BASE/$i/pubspec.yaml |
| + rsync -Lr $ACTUAL_PATH/* $OUTPUT_BASE/$i/lib |
| +done |
| +popd > /dev/null |
| + |
| +echo '***' |
| +echo 'Dumping package dependencies:': |
| +echo '' |
| +echo 'dependency_overrides:' |
| +pushd $PACKAGES_OUTPUT > /dev/null |
| +for i in *; do |
| + echo -e " $i:\n path: ../../third_party/$PACKAGES_OUTPUT/$i" |
| +done |
| +popd > /dev/null |
| +echo '' |
| +echo '***' |
| +echo -n 'Now run: rsync -a --delete observatory_pub_packages/ ' |
| +echo '~/workspace/dart-third_party/observatory_pub_packages/' |
| +echo '***' |