Add a profile build type to the Android app template (with plugin support) (#22884)
This is required in order to support "flutter run --profile"
This commit is contained in:
@@ -191,6 +191,13 @@ class FlutterPlugin implements Plugin<Project> {
|
||||
compile pluginProject
|
||||
}
|
||||
}
|
||||
pluginProject.afterEvaluate {
|
||||
pluginProject.android.buildTypes {
|
||||
profile {
|
||||
initWith debug
|
||||
}
|
||||
}
|
||||
}
|
||||
pluginProject.afterEvaluate this.&addFlutterJarCompileOnlyDependency
|
||||
} else {
|
||||
project.logger.error("Plugin project :$name not found. Please update settings.gradle.")
|
||||
@@ -212,9 +219,11 @@ class FlutterPlugin implements Plugin<Project> {
|
||||
} else {
|
||||
if (project.getConfigurations().findByName("debugCompileOnly")) {
|
||||
debugCompileOnly project.files(debugFlutterJar)
|
||||
profileCompileOnly project.files(profileFlutterJar)
|
||||
releaseCompileOnly project.files(releaseFlutterJar)
|
||||
} else {
|
||||
debugProvided project.files(debugFlutterJar)
|
||||
profileProvided project.files(profileFlutterJar)
|
||||
releaseProvided project.files(releaseFlutterJar)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -14,6 +14,9 @@ android {
|
||||
}
|
||||
|
||||
buildTypes {
|
||||
profile {
|
||||
initWith debug
|
||||
}
|
||||
release {
|
||||
// TODO: Add your own signing config for the release build.
|
||||
// Signing with the debug keys for now, so `flutter run --release` works.
|
||||
|
||||
Reference in New Issue
Block a user