mirror of
https://gitlab.com/foxixus/neomovies_mobile.git
synced 2025-10-28 01:18:50 +05:00
fix(ci): handle missing local.properties in CI environment
- Check if local.properties exists before reading - Fallback to FLUTTER_ROOT environment variable - Add FLUTTER_ROOT to CI variables - Set default Flutter path to /opt/flutter for CI - Fixes: 'local.properties (No such file or directory)' error
This commit is contained in:
@@ -9,6 +9,8 @@ stages:
|
|||||||
variables:
|
variables:
|
||||||
# Flutter версия
|
# Flutter версия
|
||||||
FLUTTER_VERSION: "3.35.5"
|
FLUTTER_VERSION: "3.35.5"
|
||||||
|
# Flutter путь для CI
|
||||||
|
FLUTTER_ROOT: "/opt/flutter"
|
||||||
# Android SDK
|
# Android SDK
|
||||||
ANDROID_SDK_ROOT: "/opt/android-sdk"
|
ANDROID_SDK_ROOT: "/opt/android-sdk"
|
||||||
# Gradle настройки для CI (меньше RAM)
|
# Gradle настройки для CI (меньше RAM)
|
||||||
|
|||||||
@@ -1,9 +1,17 @@
|
|||||||
pluginManagement {
|
pluginManagement {
|
||||||
val flutterSdkPath = run {
|
val flutterSdkPath = run {
|
||||||
val properties = java.util.Properties()
|
val properties = java.util.Properties()
|
||||||
file("local.properties").inputStream().use { properties.load(it) }
|
val localPropertiesFile = file("local.properties")
|
||||||
|
if (localPropertiesFile.exists()) {
|
||||||
|
localPropertiesFile.inputStream().use { properties.load(it) }
|
||||||
|
}
|
||||||
|
|
||||||
|
// Try to get from local.properties first, then from environment variable
|
||||||
val flutterSdkPath = properties.getProperty("flutter.sdk")
|
val flutterSdkPath = properties.getProperty("flutter.sdk")
|
||||||
require(flutterSdkPath != null) { "flutter.sdk not set in local.properties" }
|
?: System.getenv("FLUTTER_ROOT")
|
||||||
|
?: System.getenv("FLUTTER_SDK")
|
||||||
|
?: "/opt/flutter" // Default path in CI
|
||||||
|
|
||||||
flutterSdkPath
|
flutterSdkPath
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user