mirror of
https://github.com/flutter/flutter.git
synced 2026-02-20 02:29:02 +08:00
Deprecate FlutterProjectArgs.main_path, packages_path (flutter/engine#7497)
As of Dart 2, running from Dart source is no longer supported. Dart code should now be compiled to kernel form and will be loaded by from kernel.blob in the assets directory. We retain the struct members for ABI stability. package_path is also not required since kernel blobs are self-contained.
This commit is contained in:
parent
8c111d9e25
commit
86d1e4f835
@ -270,6 +270,16 @@ FlutterResult FlutterEngineRun(size_t version,
|
||||
return kInvalidArguments;
|
||||
}
|
||||
|
||||
if (SAFE_ACCESS(args, main_path__unused__, nullptr) != nullptr) {
|
||||
FML_LOG(WARNING)
|
||||
<< "FlutterProjectArgs.main_path is deprecated and should be set null.";
|
||||
}
|
||||
|
||||
if (SAFE_ACCESS(args, packages_path__unused__, nullptr) != nullptr) {
|
||||
FML_LOG(WARNING) << "FlutterProjectArgs.packages_path is deprecated and "
|
||||
"should be set null.";
|
||||
}
|
||||
|
||||
if (!IsRendererValid(config)) {
|
||||
return kInvalidArguments;
|
||||
}
|
||||
|
||||
@ -185,14 +185,24 @@ typedef struct {
|
||||
// string can be collected after the call to |FlutterEngineRun| returns. The
|
||||
// string must be NULL terminated.
|
||||
const char* assets_path;
|
||||
// The path to the Dart file containing the |main| entry point. The string can
|
||||
// be collected after the call to |FlutterEngineRun| returns. The string must
|
||||
// be NULL terminated.
|
||||
const char* main_path;
|
||||
// The path to the Dart file containing the |main| entry point.
|
||||
// The string can be collected after the call to |FlutterEngineRun| returns.
|
||||
// The string must be NULL terminated.
|
||||
//
|
||||
// \deprecated As of Dart 2, running from Dart source is no longer supported.
|
||||
// Dart code should now be compiled to kernel form and will be loaded by from
|
||||
// |kernel_blob.bin| in the assets directory. This struct member is retained
|
||||
// for ABI stability.
|
||||
const char* main_path__unused__;
|
||||
// The path to the |.packages| for the project. The string can be collected
|
||||
// after the call to |FlutterEngineRun| returns. The string must be NULL
|
||||
// terminated.
|
||||
const char* packages_path;
|
||||
//
|
||||
// \deprecated As of Dart 2, running from Dart source is no longer supported.
|
||||
// Dart code should now be compiled to kernel form and will be loaded by from
|
||||
// |kernel_blob.bin| in the assets directory. This struct member is retained
|
||||
// for ABI stability.
|
||||
const char* packages_path__unused__;
|
||||
// The path to the icudtl.dat file for the project. The string can be
|
||||
// collected after the call to |FlutterEngineRun| returns. The string must
|
||||
// be NULL terminated.
|
||||
|
||||
@ -29,8 +29,6 @@ TEST(EmbedderTest, CanLaunchAndShutdownWithValidProjectArgs) {
|
||||
FlutterProjectArgs args = {};
|
||||
args.struct_size = sizeof(FlutterProjectArgs);
|
||||
args.assets_path = testing::GetFixturesPath();
|
||||
args.main_path = "";
|
||||
args.packages_path = "";
|
||||
|
||||
FlutterEngine engine = nullptr;
|
||||
FlutterResult result = FlutterEngineRun(FLUTTER_ENGINE_VERSION, &config,
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user