Files
verified-commit[bot] a290bf28c3 chore(release): update flutter dependencies in version.json for 3.35.1 (#371)
Co-authored-by: verified-commit[bot] <180343340+verified-commit[bot]@users.noreply.github.com>
Co-authored-by: Eligio Mariño <22875166+gmeligio@users.noreply.github.com>
2025-08-17 18:36:51 +02:00

30 lines
1.5 KiB
Bash
Executable File

#!/usr/bin/env sh
# TODO: Update all versions used in android.yml from version.json, like NDK, CMake, etc.
# Path to the JSON and YAML files
version_file_path="./config/version.json"
test_file_path="./test/android.yml"
temp_file_path="./test/temp.yml"
# Extracting the version value from the version.json file
android_cmdline_tools_version=$(cue eval -e 'android.cmdlineTools.version' "$version_file_path" | tr -d '"')
android_cmdline_tools_test_expected_content="Pkg.Revision=$android_cmdline_tools_version
Pkg.Path=cmdline-tools;$android_cmdline_tools_version
Pkg.Desc=Android SDK Command-line Tools"
android_ndk_version=$(cue eval -e 'android.ndk.version' "$version_file_path" | tr -d '"')
android_sdk_build_tools_version=$(cue eval -e 'android.buildTools.version' "$version_file_path" | tr -d '"')
# Check if the version value is not empty
if [ -z "$android_cmdline_tools_version" ]; then
echo "Error: Version not found in $version_file_path"
exit 1
fi
# Update the version YAML file using cue
cue export config/android.cue -l input: ./test/android.yml -t android_cmdline_tools_version="$android_cmdline_tools_version" -t android_cmdline_tools_test_expected_content="$android_cmdline_tools_test_expected_content" -t android_ndk_version="$android_ndk_version" -t android_sdk_build_tools_version="$android_sdk_build_tools_version" -e output --out yaml >"$temp_file_path"
mv "$temp_file_path" "$test_file_path"
# Write progress
echo "Updated $test_file_path with android_cmdline_tools_version=$android_cmdline_tools_version, android_ndk_version=$android_ndk_version"