|
| 1 | +ext { |
| 2 | + androidxActivityVersion = project.hasProperty('androidxActivityVersion') ? rootProject.ext.androidxActivityVersion : '1.4.0' |
| 3 | + androidxAppCompatVersion = project.hasProperty('androidxAppCompatVersion') ? rootProject.ext.androidxAppCompatVersion : '1.4.2' |
| 4 | + androidxCoordinatorLayoutVersion = project.hasProperty('androidxCoordinatorLayoutVersion') ? rootProject.ext.androidxCoordinatorLayoutVersion : '1.2.0' |
| 5 | + androidxCoreVersion = project.hasProperty('androidxCoreVersion') ? rootProject.ext.androidxCoreVersion : '1.8.0' |
| 6 | + androidxFragmentVersion = project.hasProperty('androidxFragmentVersion') ? rootProject.ext.androidxFragmentVersion : '1.4.1' |
| 7 | + androidxWebkitVersion = project.hasProperty('androidxWebkitVersion') ? rootProject.ext.androidxWebkitVersion : '1.4.0' |
| 8 | + junitVersion = project.hasProperty('junitVersion') ? rootProject.ext.junitVersion : '4.13.2' |
| 9 | + androidxJunitVersion = project.hasProperty('androidxJunitVersion') ? rootProject.ext.androidxJunitVersion : '1.1.3' |
| 10 | + androidxEspressoCoreVersion = project.hasProperty('androidxEspressoCoreVersion') ? rootProject.ext.androidxEspressoCoreVersion : '3.4.0' |
| 11 | + cordovaAndroidVersion = project.hasProperty('cordovaAndroidVersion') ? rootProject.ext.cordovaAndroidVersion : '10.1.1' |
| 12 | +} |
| 13 | + |
| 14 | +buildscript { |
| 15 | + repositories { |
| 16 | + google() |
| 17 | + mavenCentral() |
| 18 | + maven { |
| 19 | + url "https://plugins.gradle.org/m2/" |
| 20 | + } |
| 21 | + maven{ |
| 22 | + url "https://maven.mozilla.org/maven2/" |
| 23 | + } |
| 24 | + } |
| 25 | + dependencies { |
| 26 | + classpath 'com.android.tools.build:gradle:8.2.1' |
| 27 | + |
| 28 | + if (System.getenv("CAP_PUBLISH") == "true") { |
| 29 | + classpath 'io.github.gradle-nexus:publish-plugin:1.1.0' |
| 30 | + } |
| 31 | + } |
| 32 | +} |
| 33 | + |
| 34 | +tasks.withType(Javadoc).all { enabled = false } |
| 35 | + |
| 36 | +apply plugin: 'com.android.library' |
| 37 | + |
| 38 | +if (System.getenv("CAP_PUBLISH") == "true") { |
| 39 | + apply plugin: 'io.github.gradle-nexus.publish-plugin' |
| 40 | + apply from: file('../scripts/publish-root.gradle') |
| 41 | + apply from: file('../scripts/publish-module.gradle') |
| 42 | +} |
| 43 | + |
| 44 | +android { |
| 45 | + namespace "com.getcapacitor.android" |
| 46 | + compileSdkVersion project.hasProperty('compileSdkVersion') ? rootProject.ext.compileSdkVersion : 32 |
| 47 | + defaultConfig { |
| 48 | + minSdkVersion project.hasProperty('minSdkVersion') ? rootProject.ext.minSdkVersion : 22 |
| 49 | + targetSdkVersion project.hasProperty('targetSdkVersion') ? rootProject.ext.targetSdkVersion : 32 |
| 50 | + versionCode 1 |
| 51 | + versionName "1.0" |
| 52 | + consumerProguardFiles 'proguard-rules.pro' |
| 53 | + testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" |
| 54 | + } |
| 55 | + buildTypes { |
| 56 | + release { |
| 57 | + minifyEnabled false |
| 58 | + proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' |
| 59 | + } |
| 60 | + } |
| 61 | + buildFeatures { |
| 62 | + buildConfig true |
| 63 | + } |
| 64 | + lintOptions { |
| 65 | + baseline file("lint-baseline.xml") |
| 66 | + abortOnError true |
| 67 | + warningsAsErrors true |
| 68 | + } |
| 69 | + compileOptions { |
| 70 | + sourceCompatibility JavaVersion.VERSION_11 |
| 71 | + targetCompatibility JavaVersion.VERSION_11 |
| 72 | + } |
| 73 | +} |
| 74 | + |
| 75 | +repositories { |
| 76 | + google() |
| 77 | + mavenCentral() |
| 78 | + maven{ |
| 79 | + url "https://maven.mozilla.org/maven2/" |
| 80 | + } |
| 81 | +} |
| 82 | + |
| 83 | +dependencies { |
| 84 | + implementation fileTree(dir: 'libs', include: ['*.jar']) |
| 85 | +// implementation"androidx.appcompat:appcompat:$androidxAppCompatVersion" |
| 86 | +// implementation "androidx.core:core:$androidxCoreVersion" |
| 87 | +// implementation "androidx.activity:activity:$androidxActivityVersion" |
| 88 | +// implementation "androidx.fragment:fragment:$androidxFragmentVersion" |
| 89 | + implementation "androidx.appcompat:appcompat:1.6.1" |
| 90 | + implementation "androidx.core:core:1.9.0" |
| 91 | + implementation "androidx.activity:activity:1.6.1" |
| 92 | + implementation "androidx.fragment:fragment:1.5.5" |
| 93 | + |
| 94 | + implementation "androidx.coordinatorlayout:coordinatorlayout:$androidxCoordinatorLayoutVersion" |
| 95 | + implementation "androidx.webkit:webkit:$androidxWebkitVersion" |
| 96 | + testImplementation "junit:junit:$junitVersion" |
| 97 | + androidTestImplementation "androidx.test.ext:junit:$androidxJunitVersion" |
| 98 | + androidTestImplementation "androidx.test.espresso:espresso-core:$androidxEspressoCoreVersion" |
| 99 | + implementation "org.apache.cordova:framework:$cordovaAndroidVersion" |
| 100 | + testImplementation 'org.json:json:20140107' |
| 101 | + testImplementation 'org.mockito:mockito-inline:3.6.28' |
| 102 | + |
| 103 | + // @Edward: Different versions of Geckoview for different balances of size and performance |
| 104 | + // @Edward: Version numbers for newer Geckoview versions can be obtained from: |
| 105 | + // https://maven.mozilla.org/?prefix=maven2/org/mozilla/geckoview/geckoview-omni/ |
| 106 | + |
| 107 | + // def geckoViewVersion = "83.0.20201112153044" // minimum (55.8MB download size) |
| 108 | + // def geckoViewVersion = "100.0.20220519220738" // (61.5MB download size) |
| 109 | + def geckoViewVersion = "117.0.20230912013654" // best size-performance (69.2MB download size) |
| 110 | + |
| 111 | + api "org.mozilla.geckoview:geckoview:$geckoViewVersion" |
| 112 | + implementation 'org.nanohttpd:nanohttpd-webserver:2.3.1' |
| 113 | +} |
0 commit comments