Unverified Commit 7c434a5c authored by Vyacheslav Egorov's avatar Vyacheslav Egorov Committed by GitHub

Revert "Add flutter_shared assets to module artifact (#23782)" (#26644)

This reverts commit 9880baa3.

Reason for revert: broke `--local-engine` command line option.
parent a0f58c5e
...@@ -285,22 +285,6 @@ class FlutterPlugin implements Plugin<Project> { ...@@ -285,22 +285,6 @@ class FlutterPlugin implements Plugin<Project> {
return "release" return "release"
} }
/**
* Returns a Flutter Jar file path suitable for the specified Android buildMode.
*/
private File flutterJarFor(buildMode) {
if (buildMode == "profile") {
return profileFlutterJar
} else if (buildMode == "dynamicProfile") {
return dynamicProfileFlutterJar
} else if (buildMode == "dynamicRelease") {
return dynamicReleaseFlutterJar
} else if (buildMode == "debug") {
return debugFlutterJar
}
return releaseFlutterJar
}
private void addFlutterTask(Project project) { private void addFlutterTask(Project project) {
if (project.state.failure) { if (project.state.failure) {
return return
...@@ -405,21 +389,13 @@ class FlutterPlugin implements Plugin<Project> { ...@@ -405,21 +389,13 @@ class FlutterPlugin implements Plugin<Project> {
// We know that the flutter app is a subproject in another Android app when these tasks exist. // We know that the flutter app is a subproject in another Android app when these tasks exist.
Task packageAssets = project.tasks.findByPath(":flutter:package${variant.name.capitalize()}Assets") Task packageAssets = project.tasks.findByPath(":flutter:package${variant.name.capitalize()}Assets")
Task cleanPackageAssets = project.tasks.findByPath(":flutter:cleanPackage${variant.name.capitalize()}Assets") Task cleanPackageAssets = project.tasks.findByPath(":flutter:cleanPackage${variant.name.capitalize()}Assets")
File chosenFlutterJar = flutterJarFor(flutterBuildMode)
Task copySharedFlutterAssetsTask = project.tasks.create(name: "copySharedFlutterAssets${variant.name.capitalize()}", type: Copy) {
from(project.zipTree(chosenFlutterJar))
include 'assets/flutter_shared/*'
into "src/${variant.name}"
}
Task copyFlutterAssetsTask = project.tasks.create(name: "copyFlutterAssets${variant.name.capitalize()}", type: Copy) { Task copyFlutterAssetsTask = project.tasks.create(name: "copyFlutterAssets${variant.name.capitalize()}", type: Copy) {
dependsOn flutterTask dependsOn flutterTask
dependsOn copySharedFlutterAssetsTask
dependsOn packageAssets ? packageAssets : variant.mergeAssets dependsOn packageAssets ? packageAssets : variant.mergeAssets
dependsOn cleanPackageAssets ? cleanPackageAssets : "clean${variant.mergeAssets.name.capitalize()}" dependsOn cleanPackageAssets ? cleanPackageAssets : "clean${variant.mergeAssets.name.capitalize()}"
into packageAssets ? packageAssets.outputDir : variant.mergeAssets.outputDir into packageAssets ? packageAssets.outputDir : variant.mergeAssets.outputDir
with flutterTask.assets with flutterTask.assets
} }
if (packageAssets) { if (packageAssets) {
// Only include configurations that exist in parent project. // Only include configurations that exist in parent project.
Task mergeAssets = project.tasks.findByPath(":app:merge${variant.name.capitalize()}Assets") Task mergeAssets = project.tasks.findByPath(":app:merge${variant.name.capitalize()}Assets")
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment