Skip to content

Commit

Permalink
chore(android): rely on single firestore-android-sdk version, bump an…
Browse files Browse the repository at this point in the history
…notations
  • Loading branch information
mikehardy committed Dec 4, 2020
1 parent 39ffe50 commit 0c5b087
Show file tree
Hide file tree
Showing 9 changed files with 51 additions and 22 deletions.
2 changes: 1 addition & 1 deletion packages/firebase_core/firebase_core/android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ android {
}
dependencies {
implementation platform("com.google.firebase:firebase-bom:${getRootProjectExtOrDefaultProperty("FirebaseSDKVersion")}")
implementation "com.google.firebase:firebase-core"
implementation "com.google.firebase:firebase-common"

implementation 'androidx.annotation:annotation:1.1.0'
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,6 @@ if (flutterVersionName == null) {
apply plugin: 'com.android.application'
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"

// Optionally override the Firebase BoM SDK version that FlutterFire uses.
// rootProject.ext {
// set("FlutterFire", [
// FirebaseSDKVersion: "25.3.1",
// ])
// }

android {
compileSdkVersion 29

Expand Down
2 changes: 1 addition & 1 deletion packages/firebase_in_app_messaging/android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ android {
}

dependencies {
implementation 'com.android.support:support-annotations:28.0.0'
implementation 'androidx.annotation:annotation:1.1.0'
}

// TODO(<github-username>): Remove this hack once androidx.lifecycle is included on stable. https://github.com/flutter/flutter/issues/42348
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,6 @@ apply plugin: 'com.android.application'
apply plugin: 'com.google.gms.google-services'
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"

rootProject.ext {
set('FlutterFire', [
FirebaseSDKVersion: '25.12.0'
])
}


android {
compileSdkVersion 29

Expand Down
21 changes: 18 additions & 3 deletions packages/firebase_ml_custom/android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,19 @@ rootProject.allprojects {

apply plugin: 'com.android.library'

def firebaseCoreProject = findProject(':firebase_core')
if (firebaseCoreProject == null) {
throw new GradleException('Could not find the firebase_core FlutterFire plugin, have you added it as a dependency in your pubspec?')
} else if (!firebaseCoreProject.properties['FirebaseSDKVersion']) {
throw new GradleException('A newer version of the firebase_core FlutterFire plugin is required, please update your firebase_core pubspec dependency.')
}

def getRootProjectExtOrCoreProperty(name, firebaseCoreProject) {
if (!rootProject.ext.has('FlutterFire')) return firebaseCoreProject.properties[name]
if (!rootProject.ext.get('FlutterFire')[name]) return firebaseCoreProject.properties[name]
return rootProject.ext.get('FlutterFire').get(name)
}

android {
compileSdkVersion 29

Expand All @@ -32,9 +45,11 @@ android {
disable 'InvalidPackage'
}
dependencies {
api 'com.google.firebase:firebase-ml-model-interpreter:22.0.3'
implementation 'androidx.annotation:annotation:1.0.0'
implementation 'androidx.exifinterface:exifinterface:1.0.0'
api firebaseCoreProject
implementation platform("com.google.firebase:firebase-bom:${getRootProjectExtOrCoreProperty("FirebaseSDKVersion", firebaseCoreProject)}")
api 'com.google.firebase:firebase-ml-model-interpreter'
implementation 'androidx.annotation:annotation:1.1.0'
implementation 'androidx.exifinterface:exifinterface:1.3.1'
}
}

Expand Down
18 changes: 16 additions & 2 deletions packages/firebase_ml_vision/android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,19 @@ rootProject.allprojects {

apply plugin: 'com.android.library'

def firebaseCoreProject = findProject(':firebase_core')
if (firebaseCoreProject == null) {
throw new GradleException('Could not find the firebase_core FlutterFire plugin, have you added it as a dependency in your pubspec?')
} else if (!firebaseCoreProject.properties['FirebaseSDKVersion']) {
throw new GradleException('A newer version of the firebase_core FlutterFire plugin is required, please update your firebase_core pubspec dependency.')
}

def getRootProjectExtOrCoreProperty(name, firebaseCoreProject) {
if (!rootProject.ext.has('FlutterFire')) return firebaseCoreProject.properties[name]
if (!rootProject.ext.get('FlutterFire')[name]) return firebaseCoreProject.properties[name]
return rootProject.ext.get('FlutterFire').get(name)
}

android {
compileSdkVersion 29

Expand All @@ -32,8 +45,9 @@ android {
disable 'InvalidPackage'
}
dependencies {
api 'com.google.firebase:firebase-ml-vision:20.0.0'
implementation 'com.google.firebase:firebase-common:16.1.0'
implementation platform("com.google.firebase:firebase-bom:${getRootProjectExtOrCoreProperty("FirebaseSDKVersion", firebaseCoreProject)}")
implementation 'com.google.firebase:firebase-common'
api "com.google.firebase:firebase-ml-vision"
implementation 'androidx.annotation:annotation:1.0.0'
implementation 'androidx.exifinterface:exifinterface:1.0.0'
}
Expand Down
13 changes: 13 additions & 0 deletions packages/firebase_ml_vision/example/android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,19 @@ if (flutterVersionName == null) {
apply plugin: 'com.android.application'
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"

def firebaseCoreProject = findProject(':firebase_core')
if (firebaseCoreProject == null) {
throw new GradleException('Could not find the firebase_core FlutterFire plugin, have you added it as a dependency in your pubspec?')
} else if (!firebaseCoreProject.properties['FirebaseSDKVersion']) {
throw new GradleException('A newer version of the firebase_core FlutterFire plugin is required, please update your firebase_core pubspec dependency.')
}

def getRootProjectExtOrCoreProperty(name, firebaseCoreProject) {
if (!rootProject.ext.has('FlutterFire')) return firebaseCoreProject.properties[name]
if (!rootProject.ext.get('FlutterFire')[name]) return firebaseCoreProject.properties[name]
return rootProject.ext.get('FlutterFire').get(name)
}

android {
compileSdkVersion 29

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ if (flutterVersionName == null) {
}

apply plugin: 'com.android.application'
apply plugin: "com.google.firebase.firebase-perf"
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"

android {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ android {
api firebaseCoreProject
implementation platform("com.google.firebase:firebase-bom:${getRootProjectExtOrCoreProperty("FirebaseSDKVersion", firebaseCoreProject)}")
implementation 'com.google.firebase:firebase-storage'
implementation 'androidx.annotation:annotation:1.0.0'
implementation 'androidx.annotation:annotation:1.1.0'
}
}

Expand Down

0 comments on commit 0c5b087

Please sign in to comment.