You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

57 lines
1.5 KiB

  1. // Top-level build file where you can add configuration options common to all sub-projects/modules.
  2. import groovy.json.JsonSlurper
  3. buildscript {
  4. repositories {
  5. google()
  6. jcenter()
  7. }
  8. dependencies {
  9. classpath("com.android.tools.build:gradle:4.1.0")
  10. // NOTE: Do not place your application dependencies here; they belong
  11. // in the individual module build.gradle files
  12. }
  13. }
  14. allprojects {
  15. repositories {
  16. mavenLocal()
  17. maven {
  18. // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
  19. url("$rootDir/../node_modules/react-native/android")
  20. }
  21. maven {
  22. // Android JSC is installed from npm
  23. url("$rootDir/../node_modules/jsc-android/dist")
  24. }
  25. google()
  26. jcenter()
  27. maven { url 'https://www.jitpack.io' }
  28. }
  29. }
  30. ext {
  31. buildToolsVersion = "29.0.3"
  32. minSdkVersion = 21
  33. compileSdkVersion = 29
  34. targetSdkVersion = 29
  35. ndkVersion = "20.1.5948944"
  36. def npmVersion = getNpmVersionArray()
  37. versionMajor = npmVersion[0]
  38. versionMinor = npmVersion[1]
  39. versionPatch = npmVersion[2]
  40. }
  41. def getNpmVersion() {
  42. def inputFile = new File("../package.json")
  43. def packageJson = new JsonSlurper().parseText(inputFile.text)
  44. return packageJson["version"]
  45. }
  46. def getNpmVersionArray() {
  47. def (major, minor, patch) = getNpmVersion().tokenize('.')
  48. return [Integer.parseInt(major), Integer.parseInt(minor), Integer.parseInt(patch)] as int[]
  49. }