diff --git a/framework/js/examples/ios-demo/HippyDemo.xcodeproj/project.pbxproj b/framework/js/examples/ios-demo/HippyDemo.xcodeproj/project.pbxproj index a7297cab1..52e824ce8 100644 --- a/framework/js/examples/ios-demo/HippyDemo.xcodeproj/project.pbxproj +++ b/framework/js/examples/ios-demo/HippyDemo.xcodeproj/project.pbxproj @@ -610,6 +610,7 @@ F400C2E4274F6691008BD74B /* js_native_turbo_jsc.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = js_native_turbo_jsc.h; sourceTree = ""; }; F400C2E5274F66E3008BD74B /* js_native_turbo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = js_native_turbo.h; sourceTree = ""; }; F400C2E6274F66ED008BD74B /* js_native_turbo.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = js_native_turbo.cc; sourceTree = ""; }; + B2C1237A278C0C140081B8AF /* DemoConfigs.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = DemoConfigs.h; sourceTree = ""; }; F40594982733C4A900157225 /* HippySRSIMDHelpers.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = HippySRSIMDHelpers.m; sourceTree = ""; }; F40594992733C4A900157225 /* HippySRSIMDHelpers.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HippySRSIMDHelpers.h; sourceTree = ""; }; F40736CA275F5B79009890F2 /* HippyDomNodeUtils.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = HippyDomNodeUtils.h; sourceTree = ""; }; @@ -756,6 +757,7 @@ 0612F02823A8BE320079E622 /* ViewController.mm */, 0612F03223A8BE330079E622 /* Info.plist */, 0612F03323A8BE330079E622 /* main.m */, + B2C1237A278C0C140081B8AF /* DemoConfigs.h */, ); path = HippyDemo; sourceTree = ""; diff --git a/framework/js/examples/ios-demo/HippyDemo.xcodeproj/xcshareddata/xcschemes/HippyDemo.xcscheme b/framework/js/examples/ios-demo/HippyDemo.xcodeproj/xcshareddata/xcschemes/HippyDemo.xcscheme new file mode 100644 index 000000000..576f3ab8c --- /dev/null +++ b/framework/js/examples/ios-demo/HippyDemo.xcodeproj/xcshareddata/xcschemes/HippyDemo.xcscheme @@ -0,0 +1,78 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/framework/js/examples/ios-demo/HippyDemo/DemoConfigs.h b/framework/js/examples/ios-demo/HippyDemo/DemoConfigs.h new file mode 100644 index 000000000..e30dc4862 --- /dev/null +++ b/framework/js/examples/ios-demo/HippyDemo/DemoConfigs.h @@ -0,0 +1,14 @@ +// +// DemoConfigs.h +// HippyDemo +// +// Created by bennyzqliu on 2022/1/10. +// Copyright © 2022 tencent. All rights reserved. +// + +#ifndef DemoConfigs_h +#define DemoConfigs_h + +#define DEMO_ENABLE_TURBO 1 + +#endif /* DemoConfigs_h */ diff --git a/framework/js/examples/ios-demo/HippyDemo/ViewController.mm b/framework/js/examples/ios-demo/HippyDemo/ViewController.mm index a941a1aae..4011bdab3 100644 --- a/framework/js/examples/ios-demo/HippyDemo/ViewController.mm +++ b/framework/js/examples/ios-demo/HippyDemo/ViewController.mm @@ -29,6 +29,7 @@ #include "NativeRenderManager.h" #include "dom/dom_node.h" #include "dom/dom_value.h" +#import "DemoConfigs.h" @interface ViewController () { std::shared_ptr _domManager; @@ -60,7 +61,7 @@ //#define HIPPYDEBUG #ifdef HIPPYDEBUG - NSDictionary *launchOptions = @{@"EnableTurbo": @YES, @"DebugMode": @(YES)}; + NSDictionary *launchOptions = @{@"EnableTurbo": @(DEMO_ENABLE_TURBO), @"DebugMode": @(YES)}; NSString *localhost = [HippyBundleURLProvider sharedInstance].localhost ?: @"localhost:38989"; NSString *bundleStr = [NSString stringWithFormat:@"http://%@%@", localhost, [HippyBundleURLProvider sharedInstance].debugPathUrl]; NSURL *bundleUrl = [NSURL URLWithString:bundleStr]; @@ -73,7 +74,7 @@ #else NSString *commonBundlePath = [[NSBundle mainBundle] pathForResource:@"vendor.ios" ofType:@"js" inDirectory:@"res"]; NSString *businessBundlePath = [[NSBundle mainBundle] pathForResource:@"index.ios" ofType:@"js" inDirectory:@"res"]; - NSDictionary *launchOptions = @{@"EnableTurbo": @YES}; + NSDictionary *launchOptions = @{@"EnableTurbo": @(DEMO_ENABLE_TURBO)}; HippyBridge *bridge = [[HippyBridge alloc] initWithDelegate:self bundleURL:[NSURL fileURLWithPath:commonBundlePath] moduleProvider:nil diff --git a/ios/sdk/base/HippyRootView.mm b/ios/sdk/base/HippyRootView.mm index c281b29dc..b0603b70f 100644 --- a/ios/sdk/base/HippyRootView.mm +++ b/ios/sdk/base/HippyRootView.mm @@ -40,7 +40,7 @@ #import "UIView+Hippy.h" #import "HippyBridge+Mtt.h" #import "HippyBundleURLProvider.h" -#import "core/scope.h" +#import "DemoConfigs.h" NSString *const HippyContentDidAppearNotification = @"HippyContentDidAppearNotification"; @@ -141,6 +141,7 @@ NSString *const HippyContentDidAppearNotification = @"HippyContentDidAppearNotif NSMutableDictionary *extendsLaunchOptions = [NSMutableDictionary new]; [extendsLaunchOptions addEntriesFromDictionary:launchOptions]; [extendsLaunchOptions setObject:@(mode) forKey:@"DebugMode"]; + [extendsLaunchOptions setObject:@(DEMO_ENABLE_TURBO) forKey:@"EnableTurbo"]; HippyBridge *bridge = [[HippyBridge alloc] initWithBundleURL:bundleURL moduleProvider:nil launchOptions:extendsLaunchOptions executorKey:moduleName]; return [self initWithBridge:bridge moduleName:moduleName initialProperties:initialProperties shareOptions:shareOptions delegate:delegate];