mirror of
https://github.com/flutter/flutter
synced 2024-09-19 16:21:58 +00:00
Rename --prefer-shared-library to --build-shared library consistently (#18164)
The change in 8b8d368d2
has only renamed the flag in a subset of the
places.
This commit is contained in:
parent
f833c43e6e
commit
ec6c4aba89
|
@ -281,9 +281,9 @@ class FlutterPlugin implements Plugin<Project> {
|
|||
if (project.hasProperty('extra-gen-snapshot-options')) {
|
||||
extraGenSnapshotOptionsValue = project.property('extra-gen-snapshot-options')
|
||||
}
|
||||
Boolean preferSharedLibraryValue = false
|
||||
if (project.hasProperty('prefer-shared-library')) {
|
||||
preferSharedLibraryValue = project.property('prefer-shared-library').toBoolean()
|
||||
Boolean buildSharedLibraryValue = false
|
||||
if (project.hasProperty('build-shared-library')) {
|
||||
buildSharedLibraryValue = project.property('build-shared-library').toBoolean()
|
||||
}
|
||||
String targetPlatformValue = null
|
||||
if (project.hasProperty('target-platform')) {
|
||||
|
@ -314,7 +314,7 @@ class FlutterPlugin implements Plugin<Project> {
|
|||
fileSystemRoots fileSystemRootsValue
|
||||
fileSystemScheme fileSystemSchemeValue
|
||||
trackWidgetCreation trackWidgetCreationValue
|
||||
preferSharedLibrary preferSharedLibraryValue
|
||||
buildSharedLibrary buildSharedLibraryValue
|
||||
targetPlatform targetPlatformValue
|
||||
sourceDir project.file(project.flutter.source)
|
||||
intermediateDir project.file("${project.buildDir}/${AndroidProject.FD_INTERMEDIATES}/flutter/${variant.name}")
|
||||
|
@ -361,7 +361,7 @@ abstract class BaseFlutterTask extends DefaultTask {
|
|||
@Optional @Input
|
||||
Boolean trackWidgetCreation
|
||||
@Optional @Input
|
||||
Boolean preferSharedLibrary
|
||||
Boolean buildSharedLibrary
|
||||
@Optional @Input
|
||||
String targetPlatform
|
||||
File sourceDir
|
||||
|
@ -422,8 +422,8 @@ abstract class BaseFlutterTask extends DefaultTask {
|
|||
if (extraGenSnapshotOptions != null) {
|
||||
args "--extra-gen-snapshot-options", "${extraGenSnapshotOptions}"
|
||||
}
|
||||
if (preferSharedLibrary) {
|
||||
args "--prefer-shared-library"
|
||||
if (buildSharedLibrary) {
|
||||
args "--build-shared-library"
|
||||
}
|
||||
if (targetPlatform != null) {
|
||||
args "--target-platform", "${targetPlatform}"
|
||||
|
@ -487,7 +487,7 @@ class FlutterTask extends BaseFlutterTask {
|
|||
include "flutter_assets/**" // the working dir and its files
|
||||
|
||||
if (buildMode != 'debug') {
|
||||
if (preferSharedLibrary) {
|
||||
if (buildSharedLibrary) {
|
||||
include "app.so"
|
||||
} else {
|
||||
include "vm_snapshot_data"
|
||||
|
|
|
@ -340,8 +340,8 @@ Future<Null> _buildGradleProjectV2(String gradle, BuildInfo buildInfo, String ta
|
|||
} else {
|
||||
command.add('-Ppreview-dart-2=false');
|
||||
}
|
||||
if (buildInfo.preferSharedLibrary && androidSdk.ndk != null) {
|
||||
command.add('-Pprefer-shared-library=true');
|
||||
if (buildInfo.buildSharedLibrary && androidSdk.ndk != null) {
|
||||
command.add('-Pbuild-shared-library=true');
|
||||
}
|
||||
if (buildInfo.targetPlatform == TargetPlatform.android_arm64)
|
||||
command.add('-Ptarget-platform=android-arm64');
|
||||
|
|
|
@ -15,7 +15,7 @@ class BuildInfo {
|
|||
this.trackWidgetCreation: false,
|
||||
this.extraFrontEndOptions,
|
||||
this.extraGenSnapshotOptions,
|
||||
this.preferSharedLibrary,
|
||||
this.buildSharedLibrary,
|
||||
this.targetPlatform,
|
||||
this.fileSystemRoots,
|
||||
this.fileSystemScheme,
|
||||
|
@ -49,7 +49,7 @@ class BuildInfo {
|
|||
final String extraGenSnapshotOptions;
|
||||
|
||||
/// Whether to prefer AOT compiling to a *so file.
|
||||
final bool preferSharedLibrary;
|
||||
final bool buildSharedLibrary;
|
||||
|
||||
/// Target platform for the build (e.g. android_arm versus android_arm64).
|
||||
final TargetPlatform targetPlatform;
|
||||
|
@ -97,7 +97,7 @@ class BuildInfo {
|
|||
trackWidgetCreation: trackWidgetCreation,
|
||||
extraFrontEndOptions: extraFrontEndOptions,
|
||||
extraGenSnapshotOptions: extraGenSnapshotOptions,
|
||||
preferSharedLibrary: preferSharedLibrary,
|
||||
buildSharedLibrary: buildSharedLibrary,
|
||||
targetPlatform: targetPlatform);
|
||||
}
|
||||
|
||||
|
|
|
@ -23,7 +23,7 @@ class BuildApkCommand extends BuildSubCommand {
|
|||
help: 'Preview Dart 2.0 functionality.',
|
||||
)
|
||||
..addFlag('track-widget-creation', negatable: false, hide: !verboseHelp)
|
||||
..addFlag('prefer-shared-library',
|
||||
..addFlag('build-shared-library',
|
||||
negatable: false,
|
||||
help: 'Whether to prefer compiling to a *.so file (android only).',
|
||||
)
|
||||
|
|
|
@ -366,7 +366,7 @@ class IOSSimulator extends Device {
|
|||
trackWidgetCreation: buildInfo.trackWidgetCreation,
|
||||
extraFrontEndOptions: buildInfo.extraFrontEndOptions,
|
||||
extraGenSnapshotOptions: buildInfo.extraGenSnapshotOptions,
|
||||
preferSharedLibrary: buildInfo.preferSharedLibrary);
|
||||
buildSharedLibrary: buildInfo.buildSharedLibrary);
|
||||
|
||||
final XcodeBuildResult buildResult = await buildXcodeProject(
|
||||
app: app,
|
||||
|
|
|
@ -222,8 +222,8 @@ abstract class FlutterCommand extends Command<Null> {
|
|||
extraGenSnapshotOptions: argParser.options.containsKey(FlutterOptions.kExtraGenSnapshotOptions)
|
||||
? argResults[FlutterOptions.kExtraGenSnapshotOptions]
|
||||
: null,
|
||||
preferSharedLibrary: argParser.options.containsKey('prefer-shared-library')
|
||||
? argResults['prefer-shared-library']
|
||||
buildSharedLibrary: argParser.options.containsKey('build-shared-library')
|
||||
? argResults['build-shared-library']
|
||||
: false,
|
||||
targetPlatform: targetPlatform,
|
||||
fileSystemRoots: argParser.options.containsKey(FlutterOptions.kFileSystemRoot)
|
||||
|
|
Loading…
Reference in a new issue