1apply plugin: 'com.android.library'
2apply plugin: 'kotlin-android'
3apply plugin: 'maven-publish'
4
5group = 'host.exp.exponent'
6version = '1.4.0'
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.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  // Remove this if and it's contents, when support for SDK49 is dropped
55  if (!safeExtGet("expoProvidesDefaultConfig", false)) {
56    compileSdkVersion safeExtGet("compileSdkVersion", 33)
57
58    defaultConfig {
59      minSdkVersion safeExtGet("minSdkVersion", 23)
60      targetSdkVersion safeExtGet("targetSdkVersion", 33)
61    }
62
63    lintOptions {
64      abortOnError false
65    }
66  }
67
68  def agpVersion = com.android.Version.ANDROID_GRADLE_PLUGIN_VERSION
69  if (agpVersion.tokenize('.')[0].toInteger() < 8) {
70    compileOptions {
71      sourceCompatibility JavaVersion.VERSION_11
72      targetCompatibility JavaVersion.VERSION_11
73    }
74
75    kotlinOptions {
76      jvmTarget = JavaVersion.VERSION_11.majorVersion
77    }
78  }
79
80  namespace "expo.interfaces.devmenu"
81  defaultConfig {
82    versionCode 6
83    versionName '1.4.0'
84  }
85  publishing {
86    singleVariant("release") {
87      withSourcesJar()
88    }
89  }
90}
91
92dependencies {
93  //noinspection GradleDynamicVersion
94  implementation 'com.facebook.react:react-native:+'
95
96  implementation 'com.squareup.okhttp3:okhttp:3.14.9'
97
98  implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:${getKotlinVersion()}"
99  implementation "org.jetbrains.kotlinx:kotlinx-coroutines-core:1.4.3"
100}
101