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 26
        targetSdkVersion 30
        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')
    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'
    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}"
    }
    generateProtoTasks {
        all().each { task ->
            task.builtins {
                remove java
                java {
                    option "lite"
                }
            }
        }
    }
}
