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:
Martin Kustermann 2018-06-04 17:44:37 +02:00 committed by GitHub
parent f833c43e6e
commit ec6c4aba89
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 17 additions and 17 deletions

View file

@ -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"

View file

@ -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');

View file

@ -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);
}

View file

@ -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).',
)

View file

@ -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,

View file

@ -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)