Skip to content

Commit

Permalink
Update project files
Browse files Browse the repository at this point in the history
  • Loading branch information
tananaev committed Nov 12, 2023
1 parent c7d4dac commit 4bcb81a
Show file tree
Hide file tree
Showing 4 changed files with 47 additions and 34 deletions.
63 changes: 39 additions & 24 deletions app/build.gradle
Original file line number Diff line number Diff line change
@@ -1,30 +1,43 @@
plugins {
id 'com.android.application'
id 'kotlin-android'
id 'com.google.gms.google-services'
id 'com.google.firebase.crashlytics'
}

android {
compileSdkVersion 33
compileSdk 34
ndkVersion '23.1.7779620'

defaultConfig {
applicationId 'com.tananaev.passportreader'
minSdkVersion 19
targetSdkVersion 33
versionCode 19
versionName '3.0'
targetSdkVersion 34
versionCode 20
versionName '3.1'
multiDexEnabled = true
}
namespace 'com.tananaev.passportreader'

flavorDimensions 'default'
buildFeatures {
flavorDimensions = ['default']
}
productFlavors {
regular {
isDefault = true
ext.enableCrashlytics = false
}
google
}

compileOptions {
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
}

kotlinOptions {
jvmTarget = JavaVersion.VERSION_17.toString()
}

packagingOptions {
resources {
excludes += ['META-INF/LICENSE', 'META-INF/NOTICE']
Expand All @@ -35,35 +48,37 @@ android {
dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
implementation 'androidx.multidex:multidex:2.0.1'
implementation 'com.google.android.material:material:1.7.0'
implementation 'androidx.core:core-ktx:1.9.0'
implementation 'com.google.android.material:material:1.10.0'
implementation 'androidx.core:core-ktx:1.12.0'
implementation 'com.wdullaer:materialdatetimepicker:3.5.2'
implementation 'org.jmrtd:jmrtd:0.7.18'
implementation 'net.sf.scuba:scuba-sc-android:0.0.18'
implementation 'com.madgag.spongycastle:prov:1.54.0.0'
implementation 'com.gemalto.jp2:jp2-android:1.0.3'
implementation 'com.github.mhshams:jnbis:1.1.0'
implementation 'org.bouncycastle:bcpkix-jdk15on:1.65' // do not update
implementation 'commons-io:commons-io:2.8.0'
googleImplementation platform('com.google.firebase:firebase-bom:31.0.0')
implementation 'commons-io:commons-io:2.11.0'
googleImplementation platform('com.google.firebase:firebase-bom:32.5.0')
googleImplementation 'com.google.firebase:firebase-analytics-ktx'
googleImplementation 'com.google.firebase:firebase-crashlytics'
googleImplementation 'com.google.android.gms:play-services-ads:21.3.0'
googleImplementation 'com.google.android.gms:play-services-ads:22.5.0'
googleImplementation 'com.google.android.play:review-ktx:2.0.1'
}

if (getGradle().getStartParameter().getTaskRequests().toString().contains('Google')) {
apply plugin: 'com.google.gms.google-services'
apply plugin: 'com.google.firebase.crashlytics'

task copyJson(type: Copy) {
from '../../environment/firebase'
into '.'
include 'passport-reader.json'
rename('passport-reader.json', 'google-services.json')
}

afterEvaluate {
preBuild.dependsOn copyJson
tasks.register('copyFirebaseConfig', Copy) {
from '../../environment/firebase'
into '.'
include 'passport-reader.json'
rename('passport-reader.json', 'google-services.json')
}
afterEvaluate {
tasks.matching { task ->
task.name.contains('Google') && !task.name.endsWith('GoogleServices')
}.configureEach { task ->
task.dependsOn copyFirebaseConfig
}
}
android.applicationVariants.configureEach { variant ->
tasks.named("process${variant.name.capitalize()}GoogleServices")
.get().enabled(variant.flavorName == 'google')
}
12 changes: 4 additions & 8 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
buildscript {
ext.kotlin_version = '1.7.20'
ext.kotlin_version = '1.9.20'
repositories {
google()
mavenCentral()
}
dependencies {
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath 'com.android.tools.build:gradle:7.3.1'
classpath 'com.google.gms:google-services:4.3.14'
classpath 'com.google.firebase:firebase-crashlytics-gradle:2.9.2'
classpath 'com.android.tools.build:gradle:8.2.0-rc03'
classpath 'com.google.gms:google-services:4.4.0'
classpath 'com.google.firebase:firebase-crashlytics-gradle:2.9.9'
}
}

Expand All @@ -18,7 +18,3 @@ allprojects {
jcenter()
}
}

task clean(type: Delete) {
delete rootProject.buildDir
}
4 changes: 3 additions & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
org.gradle.jvmargs=-Xmx4096m
android.enableJetifier=true
android.useAndroidX=true
android.useAndroidX=true
android.nonTransitiveRClass=false
android.nonFinalResIds=false
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.4.2-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.2-all.zip

0 comments on commit 4bcb81a

Please sign in to comment.