您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符
 
 
 
 
 
 

56 行
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:3.5.3")
  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.2"
  32. minSdkVersion = 16
  33. compileSdkVersion = 29
  34. targetSdkVersion = 29
  35. def npmVersion = getNpmVersionArray()
  36. versionMajor = npmVersion[0]
  37. versionMinor = npmVersion[1]
  38. versionPatch = npmVersion[2]
  39. }
  40. def getNpmVersion() {
  41. def inputFile = new File("../package.json")
  42. def packageJson = new JsonSlurper().parseText(inputFile.text)
  43. return packageJson["version"]
  44. }
  45. def getNpmVersionArray() {
  46. def (major, minor, patch) = getNpmVersion().tokenize('.')
  47. return [Integer.parseInt(major), Integer.parseInt(minor), Integer.parseInt(patch)] as int[]
  48. }