1apply plugin: 'java-library'
2apply plugin: 'org.jetbrains.kotlin.jvm'
3apply plugin: 'kotlin'
4
5group = 'host.exp.exponent'
6version = '1.1.1'
7
8def expoModulesCorePlugin = new File(project(":expo-modules-core").projectDir.absolutePath, "ExpoModulesCorePlugin.gradle")
9if (expoModulesCorePlugin.exists()) {
10  apply from: expoModulesCorePlugin
11  applyKotlinExpoModulesCorePlugin()
12}
13
14buildscript {
15  // Simple helper that allows the root project to override versions declared by this library.
16  ext.safeExtGet = { prop, fallback ->
17    rootProject.ext.has(prop) ? rootProject.ext.get(prop) : fallback
18  }
19
20  // Ensures backward compatibility
21  ext.getKotlinVersion = {
22    if (ext.has("kotlinVersion")) {
23      ext.kotlinVersion()
24    } else {
25      ext.safeExtGet("kotlinVersion", "1.6.10")
26    }
27  }
28
29  repositories {
30    mavenCentral()
31  }
32
33  dependencies {
34    classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:${getKotlinVersion()}")
35  }
36}
37
38def agpVersion = com.android.Version.ANDROID_GRADLE_PLUGIN_VERSION
39if (agpVersion.tokenize('.')[0].toInteger() < 8) {
40  java {
41    sourceCompatibility = JavaVersion.VERSION_11
42    targetCompatibility = JavaVersion.VERSION_11
43  }
44}
45
46dependencies {
47  implementation project(':expo-modules-core$android-annotation')
48  implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:${getKotlinVersion()}"
49
50  implementation "com.google.devtools.ksp:symbol-processing-api:${kspVersion()}"
51
52  implementation 'com.squareup:kotlinpoet:1.12.0'
53  implementation 'com.squareup:kotlinpoet-ksp:1.12.0'
54}
55