diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 75eb011..c830204 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -9,6 +9,8 @@ stages: variables: # Flutter версия FLUTTER_VERSION: "3.35.5" + # Flutter путь для CI + FLUTTER_ROOT: "/opt/flutter" # Android SDK ANDROID_SDK_ROOT: "/opt/android-sdk" # Gradle настройки для CI (меньше RAM) diff --git a/android/settings.gradle.kts b/android/settings.gradle.kts index c2ecccd..b322a85 100644 --- a/android/settings.gradle.kts +++ b/android/settings.gradle.kts @@ -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 }