apply plugin: 'com.android.library'

group = 'expo.community.modules.emojisheet'
version = '1.0.0'

def expoModulesCorePlugin = new File(project(":expo-modules-core").projectDir.absolutePath, "ExpoModulesCorePlugin.gradle")
if (expoModulesCorePlugin.exists()) {
    apply from: expoModulesCorePlugin
    applyKotlinExpoModulesCorePlugin()
    useCoreDependencies()
    useExpoPublishing()
}

buildscript {
    ext.safeExtGet = { prop, fallback ->
        rootProject.ext.has(prop) ? rootProject.ext.get(prop) : fallback
    }
}

android {
    namespace "expo.community.modules.emojisheet"

    compileSdkVersion safeExtGet("compileSdkVersion", 35)

    defaultConfig {
        minSdkVersion safeExtGet("minSdkVersion", 24)
        targetSdkVersion safeExtGet("targetSdkVersion", 35)
        versionCode 1
        versionName "1.0.0"
    }

    // Copy translation files from package root into module assets at build time.
    // This means Android consumers get all translations automatically — no manual setup.
    task copyTranslations(type: Copy) {
        from "${projectDir}/../translations"
        into "${projectDir}/src/main/assets/translations"
    }
    preBuild.dependsOn copyTranslations

    lintOptions {
        abortOnError false
    }

    dependencies {
        implementation "androidx.recyclerview:recyclerview:1.3.2"
        implementation "androidx.appcompat:appcompat:1.7.0"
        implementation "com.google.android.material:material:1.12.0"
        implementation "androidx.emoji2:emoji2:1.6.0"
        implementation "androidx.emoji2:emoji2-views-helper:1.6.0"
        implementation "org.jetbrains.kotlinx:kotlinx-coroutines-android:1.10.2"
    }
}
