buildscript {
  repositories {
    mavenCentral()
  }
  dependencies {
    classpath("org.jetbrains.kotlin.plugin.compose:org.jetbrains.kotlin.plugin.compose.gradle.plugin:${kotlinVersion}")
  }
}

apply plugin: 'com.android.library'
apply plugin: 'expo-module-gradle-plugin'
apply plugin: 'org.jetbrains.kotlin.plugin.compose'

group = 'host.exp.exponent'
version = '7.0.19'

expoModule {
  canBePublished false
}

android {
  namespace "expo.modules.devmenu"

  defaultConfig {
    versionCode 10
    versionName '7.0.19'
  }

  buildTypes {
    create("debugOptimized") {
      initWith(buildTypes.debug)
      matchingFallbacks += ["release"]
    }
  }

  sourceSets {
    debugOptimized {
      setRoot 'src/debug'
    }
  }

  buildFeatures {
    compose true
    buildConfig true
  }
}

repositories {
  // ref: https://www.baeldung.com/maven-local-repository
  mavenLocal()
  maven {
    // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
    url "$rootDir/../node_modules/react-native/android"
  }
  maven {
    // Android JSC is installed from npm
    url "$rootDir/../node_modules/jsc-android/dist"
  }
}

dependencies {
  implementation project(":expo-manifests")

  implementation 'androidx.coordinatorlayout:coordinatorlayout:1.2.0'
  implementation 'com.google.android.material:material:1.2.1'

  implementation project(":expo-dev-menu-interface")

  implementation 'com.squareup.okhttp3:okhttp:3.14.9'
  implementation 'com.google.code.gson:gson:2.8.6'

  implementation 'com.facebook.react:react-android'
  implementation 'com.facebook.soloader:soloader:0.11.0'
  implementation "androidx.transition:transition:1.1.0" // use by react-native-reanimated

  // Fixes
  // Cannot access 'androidx....' which is a supertype of 'expo.modules.devmenu.DevMenuActivity'.
  // Check your module classpath for missing or conflicting dependencies
  api "androidx.appcompat:appcompat:1.1.0"
  api "androidx.lifecycle:lifecycle-extensions:2.2.0"

  implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-core:1.3.7'
  implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-android:1.3.5'

  def composeVersion = "1.9.0"

  implementation "androidx.compose.foundation:foundation-android:$composeVersion"
  implementation "androidx.compose.ui:ui:$composeVersion"
  implementation "androidx.compose.ui:ui-tooling:$composeVersion"

  implementation("com.composables:core:1.37.0")

  api 'io.github.lukmccall:radix-ui-colors:1.0.1'

  // Needed by gesture handler
  implementation "androidx.core:core-ktx:1.6.0"

  api "androidx.browser:browser:1.6.0"

  testImplementation "com.google.truth:truth:1.1.2"
  testImplementation "org.robolectric:robolectric:4.10"
  testImplementation 'com.squareup.okhttp3:mockwebserver:4.3.1'
  testImplementation 'androidx.test:core:1.4.0'
}
