import groovy.json.JsonSlurper def getNpmVersion() { def packageJsonFile = file('../package.json') def packageJson = new JsonSlurper().parseText(packageJsonFile.text) return packageJson.version } ext { junitVersion = project.hasProperty('junitVersion') ? rootProject.ext.junitVersion : '4.13.2' androidxJunitVersion = project.hasProperty('androidxJunitVersion') ? rootProject.ext.androidxJunitVersion : '1.1.5' androidxAppCompatVersion = project.hasProperty('androidxAppCompatVersion') ? rootProject.ext.androidxAppCompatVersion : '1.6.1' androidxEspressoCoreVersion = project.hasProperty('androidxEspressoCoreVersion') ? rootProject.ext.androidxEspressoCoreVersion : '3.5.1' } buildscript { repositories { google() mavenCentral() } dependencies { classpath 'com.android.tools.build:gradle:8.7.2' } } apply plugin: 'com.android.library' android { namespace "co.boundstate.capacitorbranchdeeplinks" compileSdk project.hasProperty('compileSdkVersion') ? rootProject.ext.compileSdkVersion : 35 buildFeatures { buildConfig = true } defaultConfig { minSdkVersion project.hasProperty('minSdkVersion') ? rootProject.ext.minSdkVersion : 23 targetSdkVersion project.hasProperty('targetSdkVersion') ? rootProject.ext.targetSdkVersion : 35 versionCode 1 versionName "1.0" testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" buildConfigField("String", "CAPACITOR_BRANCH_VERSION", "\"${getNpmVersion()}\"") } buildTypes { release { minifyEnabled false proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' } } compileOptions { sourceCompatibility JavaVersion.VERSION_21 targetCompatibility JavaVersion.VERSION_21 } lintOptions { abortOnError false } } repositories { google() mavenCentral() } dependencies { implementation 'androidx.multidex:multidex:2.0.1' implementation fileTree(dir: 'libs', include: ['*.jar']) implementation project(':capacitor-android') implementation 'androidx.annotation:annotation:1.4.0' implementation 'androidx.appcompat:appcompat:1.5.0' api 'io.branch.sdk.android:library:5.20.3' testImplementation "junit:junit:$junitVersion" androidTestImplementation "androidx.test.ext:junit:$androidxJunitVersion" androidTestImplementation "androidx.test.espresso:espresso-core:$androidxEspressoCoreVersion" }