mirror of
https://gitlab.com/foxixus/neomovies_mobile.git
synced 2025-10-27 22:38: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:
@@ -1,9 +1,17 @@
|
||||
pluginManagement {
|
||||
val flutterSdkPath = run {
|
||||
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")
|
||||
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
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user