/*
 * Copyright (c) Meta Platforms, Inc. and affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */

apply plugin: 'com.android.library'

allprojects {
    gradle.projectsEvaluated {
        tasks.withType(JavaCompile) {
            options.compilerArgs << "-Xlint:unchecked" << "-Xlint:deprecation"
        }
    }
}

buildscript {
    repositories {
        // use skycastle custom repo
        if (skycastle == 'true')
        {
            maven {
                url 'file://Applications/maven'
            }
        }
        else
        {
            mavenCentral()
            google()
            jcenter()
            maven {
                url "https://maven.google.com"
            }
        }
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:7.4.0'
    }
}

def fbSdkVersion = project.hasProperty("sdkVersion") ? sdkVersion : '18.0.3'

repositories {
    // use skycastle custom repo
    if (skycastle == 'true')
    {
        maven {
            url 'file://Applications/maven'
        }
    }
    else
    {
        mavenCentral()
        google()
        jcenter()
        maven {
            url "https://maven.google.com"
        }
    }
}

dependencies {
    implementation 'com.facebook.android:facebook-android-sdk:[18.0.0,19)'

    // enable local testing
    if (project.hasProperty("localRepo")) {
        implementation fileTree(dir: localRepo, include: ['*.aar'])
    }
}

android {
    compileSdkVersion 29
    buildToolsVersion '29.0.3'

    defaultConfig {
        minSdkVersion 15
        targetSdkVersion 29
    }

    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }

    sourceSets {
        main {
            manifest.srcFile 'AndroidManifest.xml'
            java.srcDirs = ['src']
            resources.srcDirs = ['src']
            aidl.srcDirs = ['src']
            renderscript.srcDirs = ['src']
            res.srcDirs = ['res']
            assets.srcDirs = ['assets']
        }
    }
}
