1apply plugin: 'com.android.library'
2apply plugin: 'kotlin-android'
3apply plugin: 'maven-publish'
4
5group = 'host.exp.exponent'
6version = '11.5.0'
7
8buildscript {
9  def expoModulesCorePlugin = new File(project(":expo-modules-core").projectDir.absolutePath, "ExpoModulesCorePlugin.gradle")
10  if (expoModulesCorePlugin.exists()) {
11    apply from: expoModulesCorePlugin
12    applyKotlinExpoModulesCorePlugin()
13  }
14
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.8.10")
26    }
27  }
28
29  repositories {
30    mavenCentral()
31  }
32
33  dependencies {
34    classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:${getKotlinVersion()}")
35  }
36}
37
38afterEvaluate {
39  publishing {
40    publications {
41      release(MavenPublication) {
42        from components.release
43      }
44    }
45    repositories {
46      maven {
47        url = mavenLocal().url
48      }
49    }
50  }
51}
52
53android {
54  compileSdkVersion safeExtGet("compileSdkVersion", 33)
55
56  def agpVersion = com.android.Version.ANDROID_GRADLE_PLUGIN_VERSION
57  if (agpVersion.tokenize('.')[0].toInteger() < 8) {
58    compileOptions {
59      sourceCompatibility JavaVersion.VERSION_11
60      targetCompatibility JavaVersion.VERSION_11
61    }
62
63    kotlinOptions {
64      jvmTarget = JavaVersion.VERSION_11.majorVersion
65    }
66  }
67
68  namespace "expo.modules.sqlite"
69  defaultConfig {
70    minSdkVersion safeExtGet("minSdkVersion", 21)
71    targetSdkVersion safeExtGet("targetSdkVersion", 33)
72    versionCode 18
73    versionName "11.5.0"
74  }
75  lintOptions {
76    abortOnError false
77  }
78  publishing {
79    singleVariant("release") {
80      withSourcesJar()
81    }
82  }
83}
84
85dependencies {
86  implementation project(':expo-modules-core')
87
88  implementation 'com.github.requery:sqlite-android:3.39.2'
89  implementation "androidx.sqlite:sqlite-ktx:2.3.1"
90  implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:${getKotlinVersion()}"
91}
92