build.gradle 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  1. buildscript {
  2. repositories {
  3. google()
  4. mavenCentral()
  5. mavenLocal()
  6. maven {
  7. url 'https://s01.oss.sonatype.org/content/repositories/snapshots/'
  8. }
  9. }
  10. dependencies {
  11. classpath "com.android.tools.build:gradle:7.2.1"
  12. }
  13. }
  14. def isNewArchitectureEnabled() {
  15. return rootProject.hasProperty("newArchEnabled") && rootProject.getProperty("newArchEnabled") == "true"
  16. }
  17. apply plugin: "com.android.library"
  18. if (isNewArchitectureEnabled()) {
  19. apply plugin: "com.facebook.react"
  20. }
  21. def getExtOrDefault(name) {
  22. return rootProject.ext.has(name) ? rootProject.ext.get(name) : project.properties["CompdfkitPdf_" + name]
  23. }
  24. def getExtOrIntegerDefault(name) {
  25. return rootProject.ext.has(name) ? rootProject.ext.get(name) : (project.properties["CompdfkitPdf_" + name]).toInteger()
  26. }
  27. def supportsNamespace() {
  28. def parsed = com.android.Version.ANDROID_GRADLE_PLUGIN_VERSION.tokenize('.')
  29. def major = parsed[0].toInteger()
  30. def minor = parsed[1].toInteger()
  31. // Namespace support was added in 7.3.0
  32. return (major == 7 && minor >= 3) || major >= 8
  33. }
  34. android {
  35. if (supportsNamespace()) {
  36. namespace "com.compdfkitpdf"
  37. sourceSets {
  38. main {
  39. manifest.srcFile "src/main/AndroidManifestNew.xml"
  40. }
  41. }
  42. }
  43. compileSdkVersion getExtOrIntegerDefault("compileSdkVersion")
  44. defaultConfig {
  45. minSdkVersion getExtOrIntegerDefault("minSdkVersion")
  46. targetSdkVersion getExtOrIntegerDefault("targetSdkVersion")
  47. }
  48. buildTypes {
  49. release {
  50. minifyEnabled false
  51. }
  52. }
  53. lintOptions {
  54. disable "GradleCompatible"
  55. }
  56. compileOptions {
  57. sourceCompatibility JavaVersion.VERSION_1_8
  58. targetCompatibility JavaVersion.VERSION_1_8
  59. }
  60. }
  61. repositories {
  62. mavenCentral()
  63. google()
  64. maven { url 'https://s01.oss.sonatype.org/content/repositories/snapshots/' }
  65. }
  66. dependencies {
  67. compileOnly fileTree(include: ['*.jar','*.aar'], dir: 'libs')
  68. implementation "com.facebook.react:react-native:+"
  69. api "com.compdf:compdfkit-tools:2.3.0-SNAPSHOT"
  70. api 'com.github.bumptech.glide:glide:4.15.1'
  71. annotationProcessor 'com.github.bumptech.glide:compiler:4.15.1'
  72. api 'androidx.documentfile:documentfile:1.0.1'
  73. api 'androidx.appcompat:appcompat:1.6.1'
  74. api 'com.google.android.material:material:1.8.0'
  75. api 'androidx.constraintlayout:constraintlayout:2.1.4'
  76. }