fix(ci): 添加阿里云 Maven 镜像解决网络不可达问题

This commit is contained in:
2026-03-17 23:44:54 +08:00
parent 544a7ea156
commit 6ba24c59aa

View File

@@ -140,6 +140,43 @@ jobs:
reactNativeArchitectures=arm64-v8a
EOF
# Add Aliyun Maven mirror to settings.gradle
sed -i '1a\
pluginManagement {\
repositories {\
google()\
mavenCentral()\
gradlePluginPortal()\
maven { url "https://maven.aliyun.com/repository/public" }\
maven { url "https://maven.aliyun.com/repository/google" }\
maven { url "https://maven.aliyun.com/repository/central" }\
maven { url "https://maven.aliyun.com/repository/gradle-plugin" }\
}\
}\
\
dependencyResolutionManagement {\
repositoriesMode.set(RepositoriesMode.PREFER_SETTINGS)\
repositories {\
google()\
mavenCentral()\
maven { url "https://maven.aliyun.com/repository/public" }\
maven { url "https://maven.aliyun.com/repository/google" }\
maven { url "https://maven.aliyun.com/repository/central" }\
}\
}\
' settings.gradle
# Add Aliyun Maven mirror to build.gradle
sed -i '/repositories {/a\
maven { url "https://maven.aliyun.com/repository/public" }\
maven { url "https://maven.aliyun.com/repository/google" }\
maven { url "https://maven.aliyun.com/repository/central" }\
' build.gradle
# Fix hermesEnabled in build.gradle
sed -i 's/def hermesEnabled = findProperty("hermesEnabled")/def hermesEnabled = findProperty("hermesEnabled") ?: "true"/' app/build.gradle || true
grep -n "hermesEnabled" app/build.gradle || echo "hermesEnabled not found in build.gradle"
# Fix hermesEnabled in build.gradle
sed -i 's/def hermesEnabled = findProperty("hermesEnabled")/def hermesEnabled = findProperty("hermesEnabled") ?: "true"/' app/build.gradle || true
grep -n "hermesEnabled" app/build.gradle || echo "hermesEnabled not found in build.gradle"