buildscript {
    ext {
        kotlinVersion = '1.3.40'
        androidToolsVersion = '3.4.1'
    }

    repositories {
        google()
        mavenCentral()
    }

    dependencies {
        classpath "com.android.tools.build:gradle:${project.ext.androidToolsVersion}"
        classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:${project.ext.kotlinVersion}"
    }
}

plugins {
    id "com.diffplug.gradle.spotless" version "3.23.0"
    id "org.jlleitschuh.gradle.ktlint" version "8.1.0"
}

spotless {
    enforceCheck false

    kotlin {
        ktlint()
    }
    java {
        target '**/*.java'
        googleJavaFormat().aosp()
        removeUnusedImports()
    }
    format 'xml', {
        target fileTree('.') {
            include '**/*.xml', '**/*.xsd'
            exclude '**/build/**'
        }
        eclipseWtp('xml')
    }
}

apply plugin: 'com.android.library'
apply plugin: 'kotlin-android'

repositories {
    google()
    jcenter()
    mavenCentral()
}

android {
    compileSdkVersion 28

    defaultConfig {
        minSdkVersion 23
        targetSdkVersion 28
        versionCode 1
        versionName "1.0.0"
    }

    lintOptions {
        warning 'InvalidPackage', 'MissingPermission'
    }
}

dependencies {
    api "org.jetbrains.kotlin:kotlin-stdlib-jdk7:${project.ext.kotlinVersion}"
    api "com.facebook.react:react-native:+"
}
