pluginManagement {
    def flutterSdkPath = {
        def properties = new Properties()
        file("local.properties").withInputStream { properties.load(it) }
        def flutterSdkPath = properties.getProperty("flutter.sdk")
        assert flutterSdkPath != null, "flutter.sdk not set in local.properties"
        return flutterSdkPath
    }()

    includeBuild("$flutterSdkPath/packages/flutter_tools/gradle")
    includeBuild('../../../kotlin/ouisync-convention')

    repositories {
        google()
        mavenCentral()
        gradlePluginPortal()
    }
}

plugins {
    id "dev.flutter.flutter-plugin-loader" version "1.0.0"
    id "com.android.application" version '8.10.0' apply false
    id "org.jetbrains.kotlin.android" version "2.2.10" apply false
}

include ":app"

includeBuild('../../../kotlin') {
    dependencySubstitution {
        substitute module('ie.equalit.ouinet:ouisync-android')       using project(':ouisync-android')
        substitute module('ie.equalit.ouinet:ouisync-android-debug') using project(':ouisync-android')

        substitute module('ie.equalit.ouinet:ouisync-session')       using project(':ouisync-session')

        substitute module('ie.equalit.ouinet:ouisync-service')       using project(':ouisync-service')
        substitute module('ie.equalit.ouinet:ouisync-service-debug') using project(':ouisync-service')
    }
}
