Skip to content

Commit

Permalink
Add a gradle warning to the AndroidX plugins (#1138)
Browse files Browse the repository at this point in the history
This warning is only printed once per plugin on build failure.

flutter/flutter#27106
  • Loading branch information
Michael Klimushyn authored Feb 8, 2019
1 parent 2b9bae3 commit 73d7e39
Show file tree
Hide file tree
Showing 40 changed files with 256 additions and 16 deletions.
6 changes: 6 additions & 0 deletions packages/cloud_firestore/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
## 0.9.0+1

* Log a more detailed warning at build time about the previous AndroidX
migration.

## 0.9.0

* **Breaking change**. Migrate from the deprecated original Android Support
Library to AndroidX. This shouldn't result in any functional changes, but it
requires any Android apps using this plugin to [also
Expand Down
13 changes: 13 additions & 0 deletions packages/cloud_firestore/android/build.gradle
Original file line number Diff line number Diff line change
@@ -1,3 +1,16 @@
def PLUGIN = "cloud_firestore";
def ANDROIDX_WARNING = "flutterPluginsAndroidXWarning";
gradle.buildFinished { buildResult ->
if (buildResult.failure && !rootProject.ext.has(ANDROIDX_WARNING)) {
println ' *********************************************************'
println 'WARNING: This version of ' + PLUGIN + ' will break your Android build if it or its dependencies aren\'t compatible with AndroidX.'
println ' See https://goo.gl/CP92wY for more information on the problem and how to fix it.'
println ' This warning prints for all Android build failures. The real root cause of the error may be unrelated.'
println ' *********************************************************'
rootProject.ext.set(ANDROIDX_WARNING, true);
}
}

group 'io.flutter.plugins.firebase.firestore'
version '1.0-SNAPSHOT'

Expand Down
2 changes: 1 addition & 1 deletion packages/cloud_firestore/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ description: Flutter plugin for Cloud Firestore, a cloud-hosted, noSQL database
live synchronization and offline support on Android and iOS.
author: Flutter Team <[email protected]>
homepage: https://github.com/flutter/plugins/tree/master/packages/cloud_firestore
version: 0.9.0
version: 0.9.0+1

flutter:
plugin:
Expand Down
6 changes: 6 additions & 0 deletions packages/cloud_functions/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
## 0.1.0+1

* Log a more detailed warning at build time about the previous AndroidX
migration.

## 0.1.0

* **Breaking change**. Migrate from the deprecated original Android Support
Library to AndroidX. This shouldn't result in any functional changes, but it
requires any Android apps using this plugin to [also
Expand Down
13 changes: 13 additions & 0 deletions packages/cloud_functions/android/build.gradle
Original file line number Diff line number Diff line change
@@ -1,3 +1,16 @@
def PLUGIN = "cloud_functions";
def ANDROIDX_WARNING = "flutterPluginsAndroidXWarning";
gradle.buildFinished { buildResult ->
if (buildResult.failure && !rootProject.ext.has(ANDROIDX_WARNING)) {
println ' *********************************************************'
println 'WARNING: This version of ' + PLUGIN + ' will break your Android build if it or its dependencies aren\'t compatible with AndroidX.'
println ' See https://goo.gl/CP92wY for more information on the problem and how to fix it.'
println ' This warning prints for all Android build failures. The real root cause of the error may be unrelated.'
println ' *********************************************************'
rootProject.ext.set(ANDROIDX_WARNING, true);
}
}

group 'io.flutter.plugins.firebase.cloudfunctions.cloudfunctions'
version '1.0-SNAPSHOT'

Expand Down
2 changes: 1 addition & 1 deletion packages/cloud_functions/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: cloud_functions
description: Flutter plugin for Cloud Functions.
version: 0.1.0
version: 0.1.0+1
author: Flutter Team <[email protected]>
homepage: https://github.com/flutter/plugins/tree/master/packages/cloud_functions

Expand Down
6 changes: 6 additions & 0 deletions packages/firebase_admob/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
## 0.8.0+1

* Log a more detailed warning at build time about the previous AndroidX
migration.

## 0.8.0

* **Breaking change**. Migrate from the deprecated original Android Support
Library to AndroidX. This shouldn't result in any functional changes, but it
requires any Android apps using this plugin to [also
Expand Down
13 changes: 13 additions & 0 deletions packages/firebase_admob/android/build.gradle
Original file line number Diff line number Diff line change
@@ -1,3 +1,16 @@
def PLUGIN = "firebase_admob";
def ANDROIDX_WARNING = "flutterPluginsAndroidXWarning";
gradle.buildFinished { buildResult ->
if (buildResult.failure && !rootProject.ext.has(ANDROIDX_WARNING)) {
println ' *********************************************************'
println 'WARNING: This version of ' + PLUGIN + ' will break your Android build if it or its dependencies aren\'t compatible with AndroidX.'
println ' See https://goo.gl/CP92wY for more information on the problem and how to fix it.'
println ' This warning prints for all Android build failures. The real root cause of the error may be unrelated.'
println ' *********************************************************'
rootProject.ext.set(ANDROIDX_WARNING, true);
}
}

group 'io.flutter.plugins.firebaseadmob'
version '1.0-SNAPSHOT'

Expand Down
2 changes: 1 addition & 1 deletion packages/firebase_admob/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: firebase_admob
description: Firebase AdMob plugin for Flutter applications.
author: Flutter Team <[email protected]>
homepage: https://github.com/flutter/plugins/tree/master/packages/firebase_admob
version: 0.8.0
version: 0.8.0+1

flutter:
plugin:
Expand Down
5 changes: 5 additions & 0 deletions packages/firebase_analytics/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
## 2.0.1

* Log a more detailed warning at build time about the previous AndroidX
migration.

## 2.0.0

* **Breaking change**. Migrate from the deprecated original Android Support
Expand Down
13 changes: 13 additions & 0 deletions packages/firebase_analytics/android/build.gradle
Original file line number Diff line number Diff line change
@@ -1,3 +1,16 @@
def PLUGIN = "firebase_analytics";
def ANDROIDX_WARNING = "flutterPluginsAndroidXWarning";
gradle.buildFinished { buildResult ->
if (buildResult.failure && !rootProject.ext.has(ANDROIDX_WARNING)) {
println ' *********************************************************'
println 'WARNING: This version of ' + PLUGIN + ' will break your Android build if it or its dependencies aren\'t compatible with AndroidX.'
println ' See https://goo.gl/CP92wY for more information on the problem and how to fix it.'
println ' This warning prints for all Android build failures. The real root cause of the error may be unrelated.'
println ' *********************************************************'
rootProject.ext.set(ANDROIDX_WARNING, true);
}
}

group 'io.flutter.plugins.firebaseanalytics'
version '1.0-SNAPSHOT'

Expand Down
2 changes: 1 addition & 1 deletion packages/firebase_analytics/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ description: Flutter plugin for Google Analytics for Firebase, an app measuremen
solution that provides insight on app usage and user engagement on Android and iOS.
author: Flutter Team <[email protected]>
homepage: https://github.com/flutter/plugins/tree/master/packages/firebase_analytics
version: 2.0.0
version: 2.0.1

flutter:
plugin:
Expand Down
5 changes: 5 additions & 0 deletions packages/firebase_auth/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
## 0.8.0+3

* Log a more detailed warning at build time about the previous AndroidX
migration.

## 0.8.0+2

* Update Google sign-in example in the README.
Expand Down
14 changes: 14 additions & 0 deletions packages/firebase_auth/android/build.gradle
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
def PLUGIN = "firebase_auth";
def ANDROIDX_WARNING = "flutterPluginsAndroidXWarning";
gradle.buildFinished { buildResult ->
if (buildResult.failure && !rootProject.ext.has(ANDROIDX_WARNING)) {
println ' *********************************************************'
println 'WARNING: This version of ' + PLUGIN + ' will break your Android build if it or its dependencies aren\'t compatible with AndroidX.'
println ' See https://goo.gl/CP92wY for more information on the problem and how to fix it.'
println ' This warning prints for all Android build failures. The real root cause of the error may be unrelated.'
println ' *********************************************************'
rootProject.ext.set(ANDROIDX_WARNING, true);
}
}


group 'io.flutter.plugins.firebaseauth'
version '1.0-SNAPSHOT'

Expand Down
2 changes: 1 addition & 1 deletion packages/firebase_auth/example/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ dependencies:
sdk: flutter
firebase_auth:
path: ../
google_sign_in: ^3.0.4
google_sign_in: ^4.0.0
firebase_core: ^0.3.0

flutter:
Expand Down
2 changes: 1 addition & 1 deletion packages/firebase_auth/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ description: Flutter plugin for Firebase Auth, enabling Android and iOS
like Google, Facebook and Twitter.
author: Flutter Team <[email protected]>
homepage: https://github.com/flutter/plugins/tree/master/packages/firebase_auth
version: "0.8.0+2"
version: "0.8.0+3"

flutter:
plugin:
Expand Down
5 changes: 5 additions & 0 deletions packages/firebase_core/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
## 0.3.0+1

* Log a more detailed warning at build time about the previous AndroidX
migration.

## 0.3.0

* **Breaking change**. Migrate from the deprecated original Android Support
Expand Down
13 changes: 13 additions & 0 deletions packages/firebase_core/android/build.gradle
Original file line number Diff line number Diff line change
@@ -1,3 +1,16 @@
def PLUGIN = "firebase_core";
def ANDROIDX_WARNING = "flutterPluginsAndroidXWarning";
gradle.buildFinished { buildResult ->
if (buildResult.failure && !rootProject.ext.has(ANDROIDX_WARNING)) {
println ' *********************************************************'
println 'WARNING: This version of ' + PLUGIN + ' will break your Android build if it or its dependencies aren\'t compatible with AndroidX.'
println ' See https://goo.gl/CP92wY for more information on the problem and how to fix it.'
println ' This warning prints for all Android build failures. The real root cause of the error may be unrelated.'
println ' *********************************************************'
rootProject.ext.set(ANDROIDX_WARNING, true);
}
}

group 'io.flutter.plugins.firebase.core'
version '1.0-SNAPSHOT'

Expand Down
2 changes: 1 addition & 1 deletion packages/firebase_core/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ description: Flutter plugin for Firebase Core, enabling connecting to multiple
Firebase apps.
author: Flutter Team <[email protected]>
homepage: https://github.com/flutter/plugins/tree/master/packages/firebase_core
version: 0.3.0
version: 0.3.0+1

flutter:
plugin:
Expand Down
5 changes: 5 additions & 0 deletions packages/firebase_database/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
## 2.0.1

* Log a more detailed warning at build time about the previous AndroidX
migration.

## 2.0.0

* **Breaking change**. Migrate from the deprecated original Android Support
Expand Down
13 changes: 13 additions & 0 deletions packages/firebase_database/android/build.gradle
Original file line number Diff line number Diff line change
@@ -1,3 +1,16 @@
def PLUGIN = "firebase_database";
def ANDROIDX_WARNING = "flutterPluginsAndroidXWarning";
gradle.buildFinished { buildResult ->
if (buildResult.failure && !rootProject.ext.has(ANDROIDX_WARNING)) {
println ' *********************************************************'
println 'WARNING: This version of ' + PLUGIN + ' will break your Android build if it or its dependencies aren\'t compatible with AndroidX.'
println ' See https://goo.gl/CP92wY for more information on the problem and how to fix it.'
println ' This warning prints for all Android build failures. The real root cause of the error may be unrelated.'
println ' *********************************************************'
rootProject.ext.set(ANDROIDX_WARNING, true);
}
}

group 'io.flutter.plugins.firebase.database'
version '1.0-SNAPSHOT'

Expand Down
2 changes: 1 addition & 1 deletion packages/firebase_database/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ description: Flutter plugin for Firebase Database, a cloud-hosted NoSQL database
with realtime data syncing across Android and iOS clients, and offline access.
author: Flutter Team <[email protected]>
homepage: https://github.com/flutter/plugins/tree/master/packages/firebase_database
version: 2.0.0
version: 2.0.1

flutter:
plugin:
Expand Down
6 changes: 6 additions & 0 deletions packages/firebase_dynamic_links/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
## 0.2.0+1

* Log a more detailed warning at build time about the previous AndroidX
migration.

## 0.2.0

* **Breaking change**. Migrate from the deprecated original Android Support
Library to AndroidX. This shouldn't result in any functional changes, but it
requires any Android apps using this plugin to [also
Expand Down
13 changes: 13 additions & 0 deletions packages/firebase_dynamic_links/android/build.gradle
Original file line number Diff line number Diff line change
@@ -1,3 +1,16 @@
def PLUGIN = "firebase_dynamic_links";
def ANDROIDX_WARNING = "flutterPluginsAndroidXWarning";
gradle.buildFinished { buildResult ->
if (buildResult.failure && !rootProject.ext.has(ANDROIDX_WARNING)) {
println ' *********************************************************'
println 'WARNING: This version of ' + PLUGIN + ' will break your Android build if it or its dependencies aren\'t compatible with AndroidX.'
println ' See https://goo.gl/CP92wY for more information on the problem and how to fix it.'
println ' This warning prints for all Android build failures. The real root cause of the error may be unrelated.'
println ' *********************************************************'
rootProject.ext.set(ANDROIDX_WARNING, true);
}
}

group 'io.flutter.plugins.firebasedynamiclinks'
version '1.0-SNAPSHOT'

Expand Down
2 changes: 1 addition & 1 deletion packages/firebase_dynamic_links/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: firebase_dynamic_links
description: Flutter plugin for Google Dynamic Links for Firebase, an app solution for creating
and handling links across multiple platforms.
version: 0.2.0
version: 0.2.0+1

author: Flutter Team <[email protected]>
homepage: https://github.com/flutter/plugins/tree/master/packages/firebase_dynamic_links
Expand Down
5 changes: 5 additions & 0 deletions packages/firebase_messaging/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
## 3.0.1

* Log a more detailed warning at build time about the previous AndroidX
migration.

## 3.0.0

* **Breaking change**. Migrate from the deprecated original Android Support
Expand Down
13 changes: 13 additions & 0 deletions packages/firebase_messaging/android/build.gradle
Original file line number Diff line number Diff line change
@@ -1,3 +1,16 @@
def PLUGIN = "firebase_messaging";
def ANDROIDX_WARNING = "flutterPluginsAndroidXWarning";
gradle.buildFinished { buildResult ->
if (buildResult.failure && !rootProject.ext.has(ANDROIDX_WARNING)) {
println ' *********************************************************'
println 'WARNING: This version of ' + PLUGIN + ' will break your Android build if it or its dependencies aren\'t compatible with AndroidX.'
println ' See https://goo.gl/CP92wY for more information on the problem and how to fix it.'
println ' This warning prints for all Android build failures. The real root cause of the error may be unrelated.'
println ' *********************************************************'
rootProject.ext.set(ANDROIDX_WARNING, true);
}
}

group 'io.flutter.plugins.firebasemessaging'
version '1.0-SNAPSHOT'

Expand Down
2 changes: 1 addition & 1 deletion packages/firebase_messaging/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ description: Flutter plugin for Firebase Cloud Messaging, a cross-platform
messaging solution that lets you reliably deliver messages on Android and iOS.
author: Flutter Team <[email protected]>
homepage: https://github.com/flutter/plugins/tree/master/packages/firebase_messaging
version: 3.0.0
version: 3.0.1

flutter:
plugin:
Expand Down
7 changes: 6 additions & 1 deletion packages/firebase_ml_vision/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
## 0.4.0+1

* Log a more detailed warning at build time about the previous AndroidX
migration.

## 0.4.0

* **Breaking Change** Removal of base detector class `FirebaseVisionDetector`.
Expand All @@ -6,7 +11,7 @@

## 0.3.0

* **Breaking Change** Migrate from the deprecated original Android Support
* **Breaking change**. Migrate from the deprecated original Android Support
Library to AndroidX. This shouldn't result in any functional changes, but it
requires any Android apps using this plugin to [also
migrate](https://developer.android.com/jetpack/androidx/migrate) if they're
Expand Down
14 changes: 13 additions & 1 deletion packages/firebase_ml_vision/android/build.gradle
Original file line number Diff line number Diff line change
@@ -1,3 +1,16 @@
def PLUGIN = "firebase_ml_vision";
def ANDROIDX_WARNING = "flutterPluginsAndroidXWarning";
gradle.buildFinished { buildResult ->
if (buildResult.failure && !rootProject.ext.has(ANDROIDX_WARNING)) {
println ' *********************************************************'
println 'WARNING: This version of ' + PLUGIN + ' will break your Android build if it or its dependencies aren\'t compatible with AndroidX.'
println ' See https://goo.gl/CP92wY for more information on the problem and how to fix it.'
println ' This warning prints for all Android build failures. The real root cause of the error may be unrelated.'
println ' *********************************************************'
rootProject.ext.set(ANDROIDX_WARNING, true);
}
}

group 'io.flutter.plugins.firebasemlvision'
version '1.0-SNAPSHOT'

Expand Down Expand Up @@ -32,7 +45,6 @@ android {
disable 'InvalidPackage'
}
dependencies {
api 'com.android.support:support-v4:27.1.1'
api 'com.google.firebase:firebase-ml-vision:17.0.1'
api 'com.google.firebase:firebase-ml-vision-image-label-model:16.2.0'
implementation 'androidx.annotation:annotation:1.0.0'
Expand Down
2 changes: 1 addition & 1 deletion packages/firebase_ml_vision/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: firebase_ml_vision
description: Flutter plugin for Firebase machine learning vision services.
author: Flutter Team <[email protected]>
homepage: https://github.com/flutter/plugins/tree/master/packages/firebase_ml_vision
version: 0.4.0
version: 0.4.0+1

dependencies:
flutter:
Expand Down
6 changes: 6 additions & 0 deletions packages/firebase_performance/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
## 0.1.0+1

* Log a more detailed warning at build time about the previous AndroidX
migration.

## 0.1.0

* **Breaking change**. Migrate from the deprecated original Android Support
Library to AndroidX. This shouldn't result in any functional changes, but it
requires any Android apps using this plugin to [also
Expand Down
Loading

0 comments on commit 73d7e39

Please sign in to comment.