buildscript { repositories { google() mavenCentral() } dependencies { classpath("com.facebook.react:react-native-gradle-plugin") classpath("com.android.tools.build:gradle:7.4.2") classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:1.9.10") } } plugins { id("com.android.library") id("kotlin-android") id("com.facebook.react") } fun isNewArchitectureEnabled(): Boolean { return project.hasProperty("newArchEnabled") && project.property("newArchEnabled") == "true" } fun getExtOrDefault(name: String): Any? { return if (project.extensions.extraProperties.has(name)) { project.extensions.extraProperties[name] } else { project.properties["DocvCapture_$name"] } } fun getExtOrIntegerDefault(name: String): Int { return if (project.extensions.extraProperties.has(name)) { project.extensions.extraProperties[name] as Int } else { (project.properties["DocvCapture_$name"] as String).toInt() } } android { namespace = "com.docvcapture" sourceSets["main"].manifest.srcFile("src/main/AndroidManifestNew.xml") compileSdk = 34 defaultConfig { minSdk = 24 targetSdk = 34 buildConfigField("boolean", "IS_NEW_ARCHITECTURE_ENABLED", isNewArchitectureEnabled().toString()) } buildFeatures { buildConfig = true compose = true } composeOptions { kotlinCompilerExtensionVersion = "1.5.3" } buildTypes { release { isMinifyEnabled = false } } lint { disable += "GradleCompatible" } compileOptions { sourceCompatibility = JavaVersion.VERSION_1_8 targetCompatibility = JavaVersion.VERSION_1_8 } if (isNewArchitectureEnabled()) { sourceSets["main"].java { srcDirs("src/newarch", "${project.buildDir}/generated/source/codegen/java") } } else { sourceSets["main"].java { srcDirs("src/oldarch") } } } val kotlinVersion: String = getExtOrDefault("kotlinVersion") as String val docVCaptureVersion: String = "2.15.3" dependencies { implementation("com.facebook.react:react-native:+") implementation("org.jetbrains.kotlin:kotlin-stdlib:$kotlinVersion") implementation("com.trulioo:docv-capture:$docVCaptureVersion") } if (isNewArchitectureEnabled()) { react { jsRootDir.set(project.layout.projectDirectory.dir("../src/")) libraryName.set("DocvSdkView") codegenJavaPackageName.set("com.docvcapture") } }