Unverified Commit ec6c4aba authored by Martin Kustermann's avatar Martin Kustermann Committed by GitHub

Rename --prefer-shared-library to --build-shared library consistently (#18164)

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