Skip to content

Commit dcfae4e

Browse files
authored
Eliminate main_dart_file_path, package_file_path (flutter#6973)
These settings were specific to Dart 1 and are no longer used in the engine. This eliminates them from the Settings class.
1 parent 3fd6636 commit dcfae4e

File tree

6 files changed

+5
-33
lines changed

6 files changed

+5
-33
lines changed

common/settings.cc

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,6 @@ std::string Settings::ToString() const {
2525
<< std::endl;
2626
stream << "application_library_path: " << application_library_path
2727
<< std::endl;
28-
stream << "main_dart_file_path: " << main_dart_file_path << std::endl;
29-
stream << "packages_file_path: " << packages_file_path << std::endl;
3028
stream << "temp_directory_path: " << temp_directory_path << std::endl;
3129
stream << "dart_flags:" << std::endl;
3230
for (const auto& dart_flag : dart_flags) {

common/settings.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,6 @@ struct Settings {
3838
std::string application_kernel_asset;
3939
std::string application_kernel_list_asset;
4040

41-
std::string main_dart_file_path;
42-
std::string packages_file_path;
43-
4441
std::string temp_directory_path;
4542
std::vector<std::string> dart_flags;
4643

shell/common/switches.cc

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -170,12 +170,6 @@ blink::Settings SettingsFromCommandLine(const fml::CommandLine& command_line) {
170170
command_line.GetOptionValue(FlagForSwitch(Switch::FlutterAssetsDir),
171171
&settings.assets_path);
172172

173-
command_line.GetOptionValue(FlagForSwitch(Switch::MainDartFile),
174-
&settings.main_dart_file_path);
175-
176-
command_line.GetOptionValue(FlagForSwitch(Switch::Packages),
177-
&settings.packages_file_path);
178-
179173
std::string aot_shared_library_path;
180174
command_line.GetOptionValue(FlagForSwitch(Switch::AotSharedLibraryPath),
181175
&aot_shared_library_path);

shell/common/switches.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,8 +92,6 @@ DEF_SWITCH(FlutterAssetsDir,
9292
"Path to the Flutter assets directory.")
9393
DEF_SWITCH(Help, "help", "Display this help text.")
9494
DEF_SWITCH(LogTag, "log-tag", "Tag associated with log messages.")
95-
DEF_SWITCH(MainDartFile, "dart-main", "The path to the main Dart file.")
96-
DEF_SWITCH(Packages, "packages", "Specify the path to the packages.")
9795
DEF_SWITCH(StartPaused,
9896
"start-paused",
9997
"Start the application paused in the Dart debugger.")

shell/platform/darwin/ios/framework/Source/FlutterDartProject.mm

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -157,15 +157,6 @@ - (instancetype)initWithFlutterAssets:(NSURL*)flutterAssetsURL
157157

158158
if (self) {
159159
_settings = DefaultSettingsForProcess();
160-
161-
if (dartMainURL != nil && [[NSFileManager defaultManager] fileExistsAtPath:dartMainURL.path]) {
162-
_settings.main_dart_file_path = dartMainURL.path.UTF8String;
163-
}
164-
165-
if (dartPackages.path != nil &&
166-
[[NSFileManager defaultManager] fileExistsAtPath:dartPackages.path]) {
167-
_settings.packages_file_path = dartPackages.path.UTF8String;
168-
}
169160
}
170161

171162
return self;

shell/platform/embedder/embedder.cc

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -266,9 +266,7 @@ FlutterResult FlutterEngineRun(size_t version,
266266
return kInvalidArguments;
267267
}
268268

269-
if (SAFE_ACCESS(args, assets_path, nullptr) == nullptr ||
270-
SAFE_ACCESS(args, main_path, nullptr) == nullptr ||
271-
SAFE_ACCESS(args, packages_path, nullptr) == nullptr) {
269+
if (SAFE_ACCESS(args, assets_path, nullptr) == nullptr) {
272270
return kInvalidArguments;
273271
}
274272

@@ -293,18 +291,14 @@ FlutterResult FlutterEngineRun(size_t version,
293291
settings.icu_data_path = icu_data_path;
294292
settings.assets_path = args->assets_path;
295293

296-
// Check whether the assets path contains Dart 2 kernel assets.
294+
// Verify the assets path contains Dart 2 kernel assets.
297295
const std::string kApplicationKernelSnapshotFileName = "kernel_blob.bin";
298296
std::string application_kernel_path = fml::paths::JoinPaths(
299297
{settings.assets_path, kApplicationKernelSnapshotFileName});
300-
if (fml::IsFile(application_kernel_path)) {
301-
// Run from a kernel snapshot.
302-
settings.application_kernel_asset = kApplicationKernelSnapshotFileName;
303-
} else {
304-
// Run from a main Dart file.
305-
settings.main_dart_file_path = args->main_path;
306-
settings.packages_file_path = args->packages_path;
298+
if (!fml::IsFile(application_kernel_path)) {
299+
return kInvalidArguments;
307300
}
301+
settings.application_kernel_asset = kApplicationKernelSnapshotFileName;
308302

309303
settings.task_observer_add = [](intptr_t key, fml::closure callback) {
310304
fml::MessageLoop::GetCurrent().AddTaskObserver(key, std::move(callback));

0 commit comments

Comments
 (0)