buildscript {
    repositories {
        mavenCentral()
        google()
    }
    dependencies {
        classpath GRADLE_CLASS_PATH
        classpath PROTOBUF_CLASS_PATH
    }
}

final String ANDROID_TOP = "${rootDir}/../../.."
final String FRAMEWORK_PREBUILTS_DIR = "${ANDROID_TOP}/prebuilts/framework_intermediates/"

apply plugin: 'com.android.application'
apply plugin: 'com.google.protobuf'

android {
    compileSdkVersion COMPILE_SDK
    buildToolsVersion BUILD_TOOLS_VERSION

    defaultConfig {
        minSdkVersion 30
        targetSdkVersion 33
        versionCode 1
        versionName "1.0"

        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
        vectorDrawables.useSupportLibrary = true
    }
    buildTypes {
        debug {
            minifyEnabled false
        }
    }

    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }

    // The flavor dimensions for build variants (e.g. aospWithQuickstep, aospWithoutQuickstep)
    // See: https://developer.android.com/studio/build/build-variants#flavor-dimensions
    flavorDimensions "app", "recents"

    productFlavors {
        aosp {
            dimension "app"
            applicationId 'com.android.launcher3'
            testApplicationId 'com.android.launcher3.tests'
        }

        l3go {
            dimension "app"
            applicationId 'com.android.launcher3'
            testApplicationId 'com.android.launcher3.tests'
        }

        withQuickstep {
            dimension "recents"

            minSdkVersion 28
        }

        withoutQuickstep {
            dimension "recents"
        }
    }

    // Disable release builds for now
    android.variantFilter { variant ->
        if (variant.buildType.name.endsWith('release')) {
            variant.setIgnore(true)
        }
    }

    sourceSets {
        main {
            res.srcDirs = ['res']
            java.srcDirs = ['src', 'src_plugins']
            manifest.srcFile 'AndroidManifest-common.xml'
            proto {
                srcDirs = ['protos/', 'protos_overrides/']
            }
        }

        androidTest {
            res.srcDirs = ['tests/res']
            java.srcDirs = ['tests/src', 'tests/tapl']
            manifest.srcFile "tests/AndroidManifest-common.xml"
        }

        androidTestDebug {
            manifest.srcFile "tests/AndroidManifest.xml"
        }

        aosp {
            java.srcDirs = ['src_flags', 'src_shortcuts_overrides']
        }

        aospWithoutQuickstep {
            manifest.srcFile "AndroidManifest.xml"
        }

        aospWithQuickstep {
            manifest.srcFile "quickstep/AndroidManifest-launcher.xml"
        }

        l3go {
            res.srcDirs = ['go/res']
            java.srcDirs = ['go/src']
            manifest.srcFile "go/AndroidManifest.xml"
        }

        l3goWithoutQuickstepDebug {
            manifest.srcFile "AndroidManifest.xml"
        }

        l3goWithQuickstepDebug {
            manifest.srcFile "quickstep/AndroidManifest-launcher.xml"
        }

        withoutQuickstep {
            java.srcDirs = ['src_ui_overrides']
        }

        withQuickstep {
            res.srcDirs = ['quickstep/res', 'quickstep/recents_ui_overrides/res']
            java.srcDirs = ['quickstep/src', 'quickstep/recents_ui_overrides/src']
            manifest.srcFile "quickstep/AndroidManifest.xml"
        }
    }
}

allprojects {
    repositories {
        maven { url "../../../prebuilts/sdk/current/androidx/m2repository" }
        maven { url "../../../prebuilts/fullsdk-darwin/extras/android/m2repository" }
        maven { url "../../../prebuilts/fullsdk-linux/extras/android/m2repository" }
        mavenCentral()
        google()
    }
}

dependencies {
    implementation "androidx.dynamicanimation:dynamicanimation:${ANDROID_X_VERSION}"
    implementation "androidx.recyclerview:recyclerview:${ANDROID_X_VERSION}"
    implementation "androidx.preference:preference:${ANDROID_X_VERSION}"
    implementation project(':IconLoader')
    implementation project(':UiTestsLibLauncher')
    withQuickstepImplementation project(':SharedLibWrapper')

    // Recents lib dependency
    withQuickstepImplementation fileTree(dir: "${FRAMEWORK_PREBUILTS_DIR}/quickstep/libs", include: 'sysui_shared.jar')

    // Required for AOSP to compile. This is already included in the sysui_shared.jar
    withoutQuickstepImplementation fileTree(dir: "${FRAMEWORK_PREBUILTS_DIR}/libs", include: 'plugin_core.jar')

    testImplementation 'junit:junit:4.12'
    testImplementation libs.mockitoInlineExtended
    androidTestImplementation libs.mockitoInlineExtended
    androidTestImplementation "org.mockito:mockito-core:1.9.5"
    androidTestImplementation 'com.google.dexmaker:dexmaker:1.2'
    androidTestImplementation 'com.google.dexmaker:dexmaker-mockito:1.2'
    androidTestImplementation 'com.android.support.test:runner:1.0.0'
    androidTestImplementation 'com.android.support.test:rules:1.0.0'
    androidTestImplementation 'com.android.support.test.uiautomator:uiautomator-v18:2.1.2'
    androidTestImplementation "androidx.annotation:annotation:${ANDROID_X_VERSION}"

    api 'com.airbnb.android:lottie:3.3.0'
}

protobuf {
    // Configure the protoc executable
    protoc {
        artifact = "com.google.protobuf:protoc:${protocVersion}${PROTO_ARCH_SUFFIX}"
    }
    generateProtoTasks {
        all().each { task ->
            task.builtins {
                remove java
                java {
                    option "lite"
                }
            }
        }
    }
}
