2020-05-07 10:21:39 +00:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
2023-02-28 17:22:17 +00:00
|
|
|
# This script generates a list of dependencies for the main project and its
|
|
|
|
# sub-projects defined using Gradle config files. It parses Gradle output of
|
|
|
|
# 'dependencies' and 'buildEnvironment` tasks using AWK.
|
|
|
|
|
|
|
|
set -Eeuo pipefail
|
2020-05-07 10:21:39 +00:00
|
|
|
|
|
|
|
GIT_ROOT=$(cd "${BASH_SOURCE%/*}" && git rev-parse --show-toplevel)
|
2024-10-29 06:09:50 +00:00
|
|
|
GRADLE_REPORTS_DIR="${GIT_ROOT}/android/build/reports/dependency-graph-snapshots"
|
2023-02-28 17:22:17 +00:00
|
|
|
# Gradle needs to be run in 'android' subfolder.
|
2022-07-25 20:38:41 +00:00
|
|
|
cd "${GIT_ROOT}/android"
|
2020-05-07 10:21:39 +00:00
|
|
|
|
2023-02-28 17:22:17 +00:00
|
|
|
# Show Gradle log in case of failure.
|
|
|
|
GRADLE_LOG_FILE='/tmp/gradle.log'
|
|
|
|
function show_gradle_log() { cat "${GRADLE_LOG_FILE}" >&2; }
|
|
|
|
trap show_gradle_log ERR
|
2020-05-07 10:21:39 +00:00
|
|
|
|
2024-10-29 06:09:50 +00:00
|
|
|
./gradlew -I init.gradle \
|
|
|
|
--dependency-verification=off \
|
|
|
|
--no-configuration-cache --no-configure-on-demand \
|
|
|
|
:ForceDependencyResolutionPlugin_resolveAllDependencies > "${GRADLE_LOG_FILE}" 2>&1
|
2020-05-07 10:21:39 +00:00
|
|
|
|
2024-10-29 06:09:50 +00:00
|
|
|
# skip org.webkit:android-jsc, its provided by react-native
|
|
|
|
# remove when new architecture is enabled
|
|
|
|
jq -r '.[].dependency | select(startswith("org.webkit:android-jsc") | not)' "${GRADLE_REPORTS_DIR}/dependency-resolution.json"
|