build.gradle 1.2KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. def getExtOrDefault(name, defaultValue) {
  2. return rootProject.ext.has(name) ? rootProject.ext.get(name) : defaultValue
  3. }
  4. buildscript {
  5. // The Android Gradle plugin is only required when opening the android folder stand-alone.
  6. // This avoids unnecessary downloads and potential conflicts when the library is included as a
  7. // module dependency in an application project.
  8. if (project == rootProject) {
  9. repositories {
  10. google()
  11. jcenter()
  12. }
  13. dependencies {
  14. classpath 'com.android.tools.build:gradle:3.5.0'
  15. }
  16. }
  17. }
  18. apply plugin: 'com.android.library'
  19. android {
  20. compileSdkVersion getExtOrDefault('compileSdkVersion', 28)
  21. defaultConfig {
  22. minSdkVersion getExtOrDefault('minSdkVersion', 16)
  23. targetSdkVersion getExtOrDefault('targetSdkVersion', 28)
  24. }
  25. lintOptions{
  26. abortOnError false
  27. }
  28. }
  29. repositories {
  30. google()
  31. maven {
  32. // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
  33. url "$rootDir/../node_modules/react-native/android"
  34. }
  35. jcenter()
  36. }
  37. dependencies {
  38. //noinspection GradleDynamicVersion
  39. implementation 'com.facebook.react:react-native:+'
  40. }