build.gradle 2.0 KB

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