fetch-gradle-dependencies 919 B

1234567891011121314151617181920
  1. #!/bin/bash
  2. set -e
  3. # Bug 28117: setting LC_ALL=C is causing wget to fail downloading some URLs
  4. unset LC_ALL
  5. cd "[% dest_dir %]"
  6. m2dir="$(mktemp -d)"
  7. [% USE artifacts = datafile(c('basedir') _ '/projects/' _ project _ '/gradle-dependencies-list.txt', delim = '|') %]
  8. [% FOREACH artifact = artifacts %]
  9. artifact_path=$(echo "[% artifact.url %]" | sed 's|^https://[^/]\+/||')
  10. artifact_filename=$(basename "$artifact_path")
  11. artifact_dirname=$(dirname "$artifact_path")
  12. [% GET c("urlget", { filename => 'downloaded_file', URL => artifact.url}); %]
  13. echo "[% artifact.sha256sum %] downloaded_file" | sha256sum -c
  14. mkdir -p "$m2dir/$artifact_dirname"
  15. mv -f downloaded_file "$m2dir/$artifact_dirname/$artifact_filename"
  16. [% END -%]
  17. echo "Finished downloading gradle dependencies"
  18. mkdir -p "[% dest_dir %]"
  19. mv -f "$m2dir" "[% dest_dir %]/gradle-dependencies-[% c("var/gradle_dependencies_version") %]"