fluro/example/android/flutter.gradle

22 lines
748 B
Groovy
Raw Normal View History

2018-03-23 11:53:23 -04:00
// Flutter root path helper
ext.flutterRoot = {
def flutterProperties = new Properties()
def flutterPropertiesFile = rootProject.file('local.properties')
if (!flutterPropertiesFile.exists()) {
throw new GradleException("Flutter properties file not found. Define a flutter.properties file in your project root.")
}
flutterPropertiesFile.withInputStream { stream ->
flutterProperties.load(stream)
}
def flutterRoot = flutterProperties.getProperty('flutter.sdk')
if (flutterRoot == null) {
throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the flutter.properties file.")
}
return flutterRoot
}
apply from: "${flutterRoot()}/packages/flutter_tools/gradle/flutter.gradle"
flutter {
source '../..'
}