flutter.gradle 748 B

12345678910111213141516171819202122
  1. // Flutter root path helper
  2. ext.flutterRoot = {
  3. def flutterProperties = new Properties()
  4. def flutterPropertiesFile = rootProject.file('local.properties')
  5. if (!flutterPropertiesFile.exists()) {
  6. throw new GradleException("Flutter properties file not found. Define a flutter.properties file in your project root.")
  7. }
  8. flutterPropertiesFile.withInputStream { stream ->
  9. flutterProperties.load(stream)
  10. }
  11. def flutterRoot = flutterProperties.getProperty('flutter.sdk')
  12. if (flutterRoot == null) {
  13. throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the flutter.properties file.")
  14. }
  15. return flutterRoot
  16. }
  17. apply from: "${flutterRoot()}/packages/flutter_tools/gradle/flutter.gradle"
  18. flutter {
  19. source '../..'
  20. }