build.gradle 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. group 'com.flutter_webview_plugin'
  2. version '1.0-SNAPSHOT'
  3. def ANDROIDX_WARNING = "flutterPluginsAndroidXWarning";
  4. gradle.buildFinished { buildResult ->
  5. if (buildResult.failure && !rootProject.ext.has(ANDROIDX_WARNING)) {
  6. println ' *********************************************************'
  7. println 'WARNING: This version of flutter_webview_plugin will break your Android build if it or its dependencies aren\'t compatible with AndroidX.'
  8. println ' See https://goo.gl/CP92wY for more information on the problem and how to fix it.'
  9. println ' This warning prints for all Android build failures. The real root cause of the error may be unrelated.'
  10. println ' *********************************************************'
  11. rootProject.ext.set(ANDROIDX_WARNING, true);
  12. }
  13. }
  14. buildscript {
  15. repositories {
  16. google()
  17. jcenter()
  18. }
  19. dependencies {
  20. classpath 'com.android.tools.build:gradle:3.5.3'
  21. }
  22. }
  23. allprojects {
  24. repositories {
  25. jcenter()
  26. google()
  27. }
  28. }
  29. apply plugin: 'com.android.library'
  30. android {
  31. compileSdkVersion 28
  32. defaultConfig {
  33. testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
  34. // NOTE(jeffmikels): When targetSdkVersion or minSdkVersion is not set or < 4, gradle adds
  35. // additional scary permissions such as WRITE_EXTERNAL_STORAGE and READ_PHONE_STATE.
  36. minSdkVersion 16
  37. }
  38. lintOptions {
  39. disable 'InvalidPackage'
  40. }
  41. testOptions {
  42. unitTests {
  43. includeAndroidResources = true
  44. }
  45. }
  46. }
  47. dependencies {
  48. implementation 'androidx.appcompat:appcompat:1.1.0'
  49. testImplementation 'junit:junit:4.12'
  50. testImplementation 'androidx.test:core:1.2.0'
  51. // When running unit tests for project, gradle needs to have flutter.jar in path
  52. // since there's no FLUTTER_HOME variable, we need to pass flutterPath from console with command:
  53. // ./gradlew test -DflutterPath=/Users/rafal.wachol/Utils/flutter
  54. //
  55. // while develop you can set path to this jar explicitly so IDE won't complain
  56. if(System.getProperty('flutterPath')) {
  57. testImplementation files(System.getProperty('flutterPath') + '/bin/cache/artifacts/engine/android-x64/flutter.jar')
  58. }
  59. testImplementation 'org.mockito:mockito-inline:2.28.2'
  60. }