how-to-create-gradle-dependencies-list.txt 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. ### Updating Gradle Dependencies
  2. If additional Android dependencies are required by the project's build, then
  3. the Gradle build will fail due to missing dependencies. To find out what the
  4. missing dependencies are take the following steps.
  5. For tor-onion-proxy-library and tor-android-service, replace the following line
  6. in the respective project build file:
  7. $GRADLE_HOME/gradle-4.10.2/bin/gradle --offline --no-daemon -P androidplugin=3.1.0 -Dmaven.repo.local=$gradle_repo assembleRelease -x lint
  8. with
  9. $GRADLE_HOME/gradle-4.10.2/bin/gradle --debug --no-daemon -P androidplugin=3.1.0 assembleRelease -x lint
  10. For the firefox project, comment out the following line in the project's build file:
  11. export GRADLE_MAVEN_REPOSITORIES="file://$rootdir/[% c('input_files_by_name/gradle-dependencies') %]"
  12. Also modify the gradle flags to include the debug option so the download logs will show up:
  13. export GRADLE_FLAGS="--no-daemon --debug"
  14. then allow network access during the build by setting
  15. var/container/disable_network/build to 0 in rbm.conf, and rerun the build.
  16. Dependent artifacts will show up as downloads in the logs. You can pull out
  17. these dependencies into a list with the following command (replacing
  18. "firefox-android-armv7.log" with the build log file name of the actual project):
  19. `cat logs/firefox-android-armv7.log | grep "Performing HTTP" | grep -o "https://.*" | sort | uniq > download-attempts.txt`
  20. The download-attempts.txt file contains all the attempted downloads, so we need to find out which ones failed
  21. `cat logs/firefox-android-armv7.log | grep "Resource missing" | grep -o "https:.*[^]]" | sort | uniq > download-fails.txt`
  22. Now take the intersection. This removes failures from attempts, leaving just successful downloads
  23. `sort download-attempts.txt download-fails.txt | uniq -u | rev | sort -t/ -u -k1,4 | rev | sort > download-urls.txt`
  24. You will then need to add the new dependency URLs and SHA-256 values into the
  25. projects/$project/gradle-dependencies-list.txt file. The format of this file is
  26. pipe delimited
  27. sha256sum | url
  28. Finally, in the project's config file increment the
  29. var/gradle_dependencies_version and make sure to restore the project's build
  30. file back to original.
  31. It may also be the case that you wish to clean up old versions of the artifacts.
  32. For this you will need to run the build with a
  33. gradle-dependencies-list.txt file containing only the headers. Make sure to also
  34. comment the GRADLE_MAVEN_REPOSITORIES line from the project's build file. You
  35. can now proceed to reconstruct the list as given above.