Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions WXDevtool.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Pod::Spec.new do |s|

s.name = "WXDevtool"

s.version = "0.16.0"
s.version = "0.20.1"

s.summary = "WXDevtool Source."

Expand All @@ -30,7 +30,7 @@ Pod::Spec.new do |s|
s.ios.deployment_target = "8.0"

# cocoapods
s.source = { :git => "https://github.com/weexteam/weex-devtool-iOS.git", :tag => "0.16.0" }
s.source = { :git => "https://github.com/weexteam/weex-devtool-iOS.git", :tag => "0.20.1" }
s.source_files = "sdk/WXDevTool/Source/**/*.{h,m,mm,c}"

s.requires_arc = true
Expand Down
2 changes: 1 addition & 1 deletion playground/Podfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ platform :ios, '8.0'
#inhibit_all_warnings!

def common
pod 'WeexSDK', :path=>'../../incubator-weex/'
pod 'WeexSDK', '0.19.0.2'
pod 'WXDevtool', :path=>'../'
pod 'SDWebImage', '3.7.5'
pod 'SocketRocket', '0.4.2'
Expand Down
26 changes: 13 additions & 13 deletions playground/WeexDemo.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -415,7 +415,7 @@
TargetAttributes = {
775BEE7A1C1E8ECC008D1629 = {
CreatedOnToolsVersion = 7.1.1;
DevelopmentTeam = K46RM9974S;
DevelopmentTeam = G7EDFK7C8C;
ProvisioningStyle = Automatic;
};
775BEE931C1E8ECC008D1629 = {
Expand Down Expand Up @@ -520,11 +520,11 @@
"${PODS_ROOT}/ATSDK-Weex/ATSDK.framework/Versions/A/Resources/ATSDK.bundle",
"${PODS_ROOT}/ATSDK-Weex/ATSDK.framework/Versions/A/Resources/en.lproj",
"${PODS_ROOT}/ATSDK-Weex/ATSDK.framework/Versions/A/Resources/zh-Hans.lproj",
"${PODS_ROOT}/../../../incubator-weex/pre-build/native-bundle-main.js",
"${PODS_ROOT}/../../../incubator-weex/pre-build/weex-main-jsfm.js",
"${PODS_ROOT}/../../../incubator-weex/pre-build/weex-polyfill.js",
"${PODS_ROOT}/../../../incubator-weex/pre-build/weex-rax-api.js",
"${PODS_ROOT}/../../../incubator-weex/ios/sdk/WeexSDK/Resources/wx_load_error@3x.png",
"${PODS_ROOT}/WeexSDK/pre-build/native-bundle-main.js",
"${PODS_ROOT}/WeexSDK/pre-build/weex-main-jsfm.js",
"${PODS_ROOT}/WeexSDK/pre-build/weex-polyfill.js",
"${PODS_ROOT}/WeexSDK/pre-build/weex-rax-api.js",
"${PODS_ROOT}/WeexSDK/ios/sdk/WeexSDK/Resources/wx_load_error@3x.png",
);
name = "[CP] Copy Pods Resources";
outputPaths = (
Expand Down Expand Up @@ -570,11 +570,11 @@
"${PODS_ROOT}/ATSDK-Weex/ATSDK.framework/Versions/A/Resources/ATSDK.bundle",
"${PODS_ROOT}/ATSDK-Weex/ATSDK.framework/Versions/A/Resources/en.lproj",
"${PODS_ROOT}/ATSDK-Weex/ATSDK.framework/Versions/A/Resources/zh-Hans.lproj",
"${PODS_ROOT}/../../../incubator-weex/pre-build/native-bundle-main.js",
"${PODS_ROOT}/../../../incubator-weex/pre-build/weex-main-jsfm.js",
"${PODS_ROOT}/../../../incubator-weex/pre-build/weex-polyfill.js",
"${PODS_ROOT}/../../../incubator-weex/pre-build/weex-rax-api.js",
"${PODS_ROOT}/../../../incubator-weex/ios/sdk/WeexSDK/Resources/wx_load_error@3x.png",
"${PODS_ROOT}/WeexSDK/pre-build/native-bundle-main.js",
"${PODS_ROOT}/WeexSDK/pre-build/weex-main-jsfm.js",
"${PODS_ROOT}/WeexSDK/pre-build/weex-polyfill.js",
"${PODS_ROOT}/WeexSDK/pre-build/weex-rax-api.js",
"${PODS_ROOT}/WeexSDK/ios/sdk/WeexSDK/Resources/wx_load_error@3x.png",
);
name = "[CP] Copy Pods Resources";
outputPaths = (
Expand Down Expand Up @@ -753,7 +753,7 @@
CODE_SIGN_IDENTITY = "iPhone Developer";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
CODE_SIGN_STYLE = Automatic;
DEVELOPMENT_TEAM = K46RM9974S;
DEVELOPMENT_TEAM = G7EDFK7C8C;
ENABLE_BITCODE = NO;
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
Expand Down Expand Up @@ -785,7 +785,7 @@
CODE_SIGN_IDENTITY = "iPhone Distribution";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
CODE_SIGN_STYLE = Automatic;
DEVELOPMENT_TEAM = K46RM9974S;
DEVELOPMENT_TEAM = G7EDFK7C8C;
ENABLE_BITCODE = NO;
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
Expand Down
2 changes: 1 addition & 1 deletion sdk/Podfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ use_frameworks!

def pods

pod 'WeexSDK','0.18.0'
pod 'WeexSDK','0.19.0'
pod 'SocketRocket', '0.4.2'

end
Expand Down
91 changes: 31 additions & 60 deletions sdk/WXDevTool.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

82 changes: 82 additions & 0 deletions sdk/WXDevTool.xcodeproj/xcshareddata/xcschemes/WXDevTool.xcscheme
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0920"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "0AFA0ECA1D2CE79E006E30BB"
BuildableName = "WXDevTool.framework"
BlueprintName = "WXDevTool"
ReferencedContainer = "container:WXDevTool.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
language = ""
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
</Testables>
<AdditionalOptions>
</AdditionalOptions>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
language = ""
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
allowLocationSimulation = "YES">
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "0AFA0ECA1D2CE79E006E30BB"
BuildableName = "WXDevTool.framework"
BlueprintName = "WXDevTool"
ReferencedContainer = "container:WXDevTool.xcodeproj">
</BuildableReference>
</MacroExpansion>
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
debugDocumentVersioning = "YES">
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "0AFA0ECA1D2CE79E006E30BB"
BuildableName = "WXDevTool.framework"
BlueprintName = "WXDevTool"
ReferencedContainer = "container:WXDevTool.xcodeproj">
</BuildableReference>
</MacroExpansion>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>IDEDidComputeMac32BitWarning</key>
<true/>
</dict>
</plist>
7 changes: 6 additions & 1 deletion sdk/WXDevTool/Source/DerivedSources/WXDebugDomain.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
#import "WXDynamicDebuggerDomain.h"
#import "WXObject.h"
#import "WXDebugger.h"
#import "WXDevtool.h"
#import "WXDevTool.h"

@protocol WXDebugCommandDelegate;

Expand Down Expand Up @@ -48,4 +48,9 @@
- (void)domain:(WXDynamicDebuggerDomain *)domain callRemoveEvent:(NSDictionary *)jsModule callBack:(void (^)(id error))callback ;
- (void)domain:(WXDynamicDebuggerDomain *)domain syncCall:(NSDictionary *)args callBack:(void (^)(NSDictionary *data, id error))callback;

- (void)domain:(WXDynamicDebuggerDomain *)domain enablePerformanceMonitor:(BOOL)enable monitorCallback:(void (^)(id error))callback;
- (void)domain:(WXDynamicDebuggerDomain *)domain sendPerformanceData:(BOOL)enable sendCallback:(void (^)(id error))callback;

- (void)domain:(WXDynamicDebuggerDomain *)domain renderPageWithURL:(NSURL *)url callBack:(void (^)(id error))callback;

@end
15 changes: 12 additions & 3 deletions sdk/WXDevTool/Source/DerivedSources/WXDebugDomain.m
Original file line number Diff line number Diff line change
Expand Up @@ -87,11 +87,20 @@ - (void)handleMethodWithName:(NSString *)methodName parameters:(NSDictionary *)p
[self.delegate domain:self callRemoveEvent:params callBack:^(id error) {
responseCallback(nil, error);
}];
}else if ([methodName isEqualToString:@"enableTracing"]) {
[WXTracingUtility setRemoteTracing:[params[@"status"] boolValue]];
}else if ([methodName isEqualToString:@"enablePerformanceMonitor"]) {
[self.delegate domain:self enablePerformanceMonitor:[[params objectForKey:@"value"] boolValue] monitorCallback:^(id error) {
responseCallback(nil,error);
}];
}else if ([methodName isEqualToString:@"refreshPerformanceData"]) {
[self.delegate domain:self sendPerformanceData:[[params objectForKey:@"value"] boolValue] sendCallback:^(id error) {
responseCallback(nil,error);
}];
} else if ([methodName isEqualToString:@"renderPage"]) {
[self.delegate domain:self renderPageWithURL:[NSURL URLWithString:params[@"url"]] callBack:^(id error) {
responseCallback(nil, error);
}];
}
}



@end
15 changes: 9 additions & 6 deletions sdk/WXDevTool/Source/PonyDebugger/WXDOMDomainController.m
Original file line number Diff line number Diff line change
Expand Up @@ -666,6 +666,9 @@ - (void)removeView:(UIView *)view
} else if ([view isKindOfClass:[UIWindow class]]) {
// Windows are always children of the root element node
parentNodeId = @(1);
} else {
// Windows are always children of the root element node
parentNodeId = @(1);
}
[self.domain childNodeRemovedWithParentNodeId:parentNodeId nodeId:nodeId];
[self stopTrackingView:view];
Expand Down Expand Up @@ -1456,12 +1459,12 @@ - (void)_getBoxModelNode:(UIView *)objectForNodeId callback:(void (^)(WXDOMBoxMo
CGFloat scale = [WXPageDomainController defaultInstance].domain.screenScaleFactor;
UIView *view = [WXPageDomainUtility getCurrentKeyController].view;
CGRect changeRect = [objectForNodeId.superview convertRect:objectForNodeId.frame toView:view];
NSNumber *width = [NSNumber numberWithInteger:objectForNodeId.frame.size.width / [WXUtility defaultPixelScaleFactor]];
NSNumber *height = [NSNumber numberWithInteger:objectForNodeId.frame.size.height / [WXUtility defaultPixelScaleFactor]];
CGFloat left = changeRect.origin.x * scale;
CGFloat top = changeRect.origin.y * scale;
CGFloat right = left + objectForNodeId.frame.size.width * scale;
CGFloat bottom = top + objectForNodeId.frame.size.height * scale;
NSNumber *width = [NSNumber numberWithInteger:objectForNodeId.frame.size.width / scale];
NSNumber *height = [NSNumber numberWithInteger:objectForNodeId.frame.size.height / scale];
CGFloat left = changeRect.origin.x;
CGFloat top = changeRect.origin.y;
CGFloat right = left + objectForNodeId.frame.size.width;
CGFloat bottom = top + objectForNodeId.frame.size.height;

CGFloat paddingLeft = 0;
CGFloat paddingRight = 0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* For the full copyright and license information,please view the LICENSE file in the root directory of this source tree.
*/

#import "WXDevtool.h"
#import "WXDevTool.h"
#import "WXPonyDebugger.h"
#import "WXDebugDomain.h"
#import "WXDynamicDebuggerDomain.h"
Expand Down
37 changes: 37 additions & 0 deletions sdk/WXDevTool/Source/PonyDebugger/WXDebugDomainController.m
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
#import "WXDevToolType.h"
#import "WXDeviceInfo.h"
#import "WXDebuggerUtility.h"
#import "WXMonitorHandler.h"
#import <WeexSDK/WeexSDK.h>

#define SYNCRETURN @"WxDebug.syncReturn"
Expand Down Expand Up @@ -80,9 +81,11 @@ - (void)registerDevice {
machine, @"model",
[WXSDKEngine SDKEngineVersion],@"weexVersion",
[WXDevTool WXDevtoolVersion],@"devtoolVersion",
[WXDebugger isVDom] ? @"vdom" : @"native",@"elementMode",
appName, @"name",
[WXLog logLevelString] ?: @"error",@"logLevel",
[NSNumber numberWithBool:[WXDevToolType isDebug]],@"remoteDebug",
[NSNumber numberWithBool:[WXDebugger isNetwork]], @"network",
nil];
[self _registerDeviceWithParams:parameters];
}
Expand Down Expand Up @@ -380,6 +383,40 @@ - (void)domain:(WXDynamicDebuggerDomain *)domain syncCall:(NSDictionary *)data c
}];
}

- (void)domain:(WXDynamicDebuggerDomain *)domain enablePerformanceMonitor:(BOOL)enable monitorCallback:(void (^)(id error))callback {
[WXAnalyzerCenter setOpen: enable];
if (enable) {
[WXAnalyzerCenter addWxAnalyzer:[WXMonitorHandler sharedInstance]];
if ([WXDebugTool isDebug]) {
[WXDebugTool setDebug:false];
}
}else {
[WXAnalyzerCenter rmWxAnalyzer:[WXMonitorHandler sharedInstance]];
[WXMonitorHandler resetMonitorData];
}
}

- (void)domain:(WXDynamicDebuggerDomain *)domain sendPerformanceData:(BOOL)enable sendCallback:(void (^)(id error))callback {
NSMutableDictionary *params = nil;
NSError *error = nil;
if ([WXMonitorHandler sharedInstance]) {
params = [WXMonitorHandler sharedInstance].monitorDictionary;
}else {
error = [NSError errorWithDomain:(NSErrorDomain)@"sendPerformanceData error" code:500 userInfo:nil];
}
if ([WXDebugger defaultInstance].isConnected) {
NSMutableDictionary *dict = [NSMutableDictionary dictionary];
[dict setObject:@"WxDebug.sendPerformanceData" forKey:@"method"];
[dict setObject:params forKey:@"params"];
[[WXDebugger defaultInstance] sendDebugMessage:[WXUtility JSONString:dict] onBridgeThread:false];
}
callback(error);
}

- (void)domain:(WXDynamicDebuggerDomain *)domain renderPageWithURL:(NSURL *)url callBack:(void (^)(id error))callback {
NSDictionary *userInfo = @{@"url": url};
[[NSNotificationCenter defaultCenter] postNotificationName:@"WXDevToolRenderPage" object:nil userInfo:userInfo];
callback(nil);
}

@end
2 changes: 1 addition & 1 deletion sdk/WXDevTool/Source/PonyDebugger/WXDebugger.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
#import <Foundation/Foundation.h>
#import <CoreData/CoreData.h>
#import <WeexSDK/WeexSDK.h>
#import <WeexSDK/WXTracingManager.h>

#pragma mark - Preprocessor

Expand Down Expand Up @@ -78,6 +77,7 @@ extern NSString *const kWXNetworkObserverEnabledStateChangedNotification;
- (void)forwardNetworkTrafficFromDelegateClass:(Class)cls;
+ (void)registerPrettyStringPrinter:(id<WXPrettyStringPrinting>)prettyStringPrinter;
+ (void)unregisterPrettyStringPrinter:(id<WXPrettyStringPrinting>)prettyStringPrinter;
+ (BOOL)isNetwork;

#pragma mark Core Data Debugging
- (void)enableCoreDataDebugging;
Expand Down
Loading