build.gradle 1.4KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. def safeExtGet(prop, fallback) {
  2. rootProject.ext.has(prop) ? rootProject.ext.get(prop) : fallback
  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 safeExtGet('compileSdkVersion', 28)
  21. buildToolsVersion safeExtGet('buildToolsVersion', '28.0.3')
  22. defaultConfig {
  23. minSdkVersion safeExtGet('minSdkVersion', 16)
  24. targetSdkVersion safeExtGet('targetSdkVersion', 28)
  25. }
  26. lintOptions {
  27. abortOnError false
  28. }
  29. }
  30. repositories {
  31. mavenLocal()
  32. maven {
  33. // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
  34. url "$rootDir/../node_modules/react-native/android"
  35. }
  36. maven {
  37. // Android JSC is installed from npm
  38. url "$rootDir/../node_modules/jsc-android/dist"
  39. }
  40. google()
  41. jcenter()
  42. }
  43. dependencies {
  44. //noinspection GradleDynamicVersion
  45. implementation 'com.facebook.react:react-native:+' // From node_modules
  46. }