build.gradle 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. buildscript {
  2. repositories {
  3. google()
  4. mavenCentral()
  5. }
  6. dependencies {
  7. classpath "com.android.tools.build:gradle:7.2.1"
  8. }
  9. }
  10. def isNewArchitectureEnabled() {
  11. return rootProject.hasProperty("newArchEnabled") && rootProject.getProperty("newArchEnabled") == "true"
  12. }
  13. apply plugin: "com.android.library"
  14. if (isNewArchitectureEnabled()) {
  15. apply plugin: "com.facebook.react"
  16. }
  17. def getExtOrDefault(name) {
  18. return rootProject.ext.has(name) ? rootProject.ext.get(name) : project.properties["CompdfkitPdf_" + name]
  19. }
  20. def getExtOrIntegerDefault(name) {
  21. return rootProject.ext.has(name) ? rootProject.ext.get(name) : (project.properties["CompdfkitPdf_" + name]).toInteger()
  22. }
  23. def supportsNamespace() {
  24. def parsed = com.android.Version.ANDROID_GRADLE_PLUGIN_VERSION.tokenize('.')
  25. def major = parsed[0].toInteger()
  26. def minor = parsed[1].toInteger()
  27. // Namespace support was added in 7.3.0
  28. return (major == 7 && minor >= 3) || major >= 8
  29. }
  30. android {
  31. if (supportsNamespace()) {
  32. namespace "com.compdfkitpdf"
  33. sourceSets {
  34. main {
  35. manifest.srcFile "src/main/AndroidManifestNew.xml"
  36. }
  37. }
  38. }
  39. compileSdkVersion getExtOrIntegerDefault("compileSdkVersion")
  40. defaultConfig {
  41. minSdkVersion getExtOrIntegerDefault("minSdkVersion")
  42. targetSdkVersion getExtOrIntegerDefault("targetSdkVersion")
  43. }
  44. buildTypes {
  45. release {
  46. minifyEnabled false
  47. }
  48. }
  49. lintOptions {
  50. disable "GradleCompatible"
  51. }
  52. compileOptions {
  53. sourceCompatibility JavaVersion.VERSION_1_8
  54. targetCompatibility JavaVersion.VERSION_1_8
  55. }
  56. }
  57. repositories {
  58. mavenCentral()
  59. google()
  60. }
  61. dependencies {
  62. implementation "com.facebook.react:react-native:+"
  63. api "com.compdf:compdfkit:2.0.1"
  64. api "com.compdf:compdfkit-ui:2.0.1"
  65. api "com.compdf:compdfkit-tools:2.0.1"
  66. }