Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
Binary file added build/inspector/NativeScript Inspector.zip
Binary file not shown.
21 changes: 19 additions & 2 deletions gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ module.exports = function (grunt) {
{ expand: true, cwd: "<%= outDistDir %>", src: ["NativeScript.framework", "NativeScript.framework/**"], dest: "<%= outPackageFrameworkDir %>" },
{ expand: true, cwd: "<%= srcDir %>/src/debugging", src: "TNSDebugging.h", dest: "<%= outPackageFrameworkDir %>/__PROJECT_NAME__" },
{ expand: true, cwd: "<%= srcDir %>/src/debugging/WebInspectorUI", src: "**", dest: "<%= outPackageDir %>/WebInspectorUI/Safari" },
{ expand: true, cwd: "<%= srcDir %>/build/inspector/", src: "NativeScript Inspector.zip", dest: "<%= outPackageDir %>/WebInspectorUI/" },
{ expand: true, cwd: "<%= outDistDir %>/metadataGenerator", src: "**", dest: "<%= outPackageFrameworkDir %>/metadataGenerator" },
{ expand: true, cwd: "<%= srcDir %>/build/project-template", src: "**", dest: "<%= outPackageFrameworkDir %>" }
],
Expand All @@ -80,7 +81,6 @@ module.exports = function (grunt) {
},
packageJson: { expand: true, src: "<%= srcDir %>/package.json", dest: outPackageDir, options: { process: updatePackageVersion } }
},

shell: {
NativeScript: {
command: './build/scripts/build.sh',
Expand All @@ -97,14 +97,30 @@ module.exports = function (grunt) {
callback: assignGitSHA
}
},
}
},
modify_json: {
file: {
expand: true,
cwd: outPackageDir,
src: ['package.json'],
options: {
add: true,
fields: {
"scripts": { "postinstall": "unzip './WebInspectorUI/NativeScript Inspector.zip' -d ./WebInspectorUI" }
}
}
}


}
});

grunt.loadNpmTasks("grunt-contrib-clean");
grunt.loadNpmTasks("grunt-contrib-copy");
grunt.loadNpmTasks("grunt-mkdir");
grunt.loadNpmTasks("grunt-exec");
grunt.loadNpmTasks("grunt-shell");
grunt.loadNpmTasks("grunt-modify-json");

grunt.registerTask("default", [
"package"
Expand All @@ -117,6 +133,7 @@ module.exports = function (grunt) {
"copy:packageComponents",
"shell:getGitSHA",
"copy:packageJson",
"modify_json",
"exec:npmPackPackage"
]);
};
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
"grunt-exec": "^0.4.6",
"grunt-grunt": "^0.2.2",
"grunt-mkdir": "^0.1.2",
"grunt-modify-json": "^0.1.1",
"grunt-shell": "^0.7.0",
"shelljs": "^0.3.0",
"ws": "^0.7.1"
Expand Down
482 changes: 482 additions & 0 deletions src/debugging/Inspector/Inspector/Inspector.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

34 changes: 34 additions & 0 deletions src/debugging/Inspector/Inspector/Inspector/Info.plist
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
<?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>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key>
<string>org.NativeScript.$(PRODUCT_NAME:rfc1034identifier)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>$(PRODUCT_NAME)</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>1</string>
<key>LSApplicationCategoryType</key>
<string>public.app-category.developer-tools</string>
<key>LSMinimumSystemVersion</key>
<string>$(MACOSX_DEPLOYMENT_TARGET)</string>
<key>NSHumanReadableCopyright</key>
<string>Copyright © Telerik. All rights reserved.</string>
<key>NSPrincipalClass</key>
<string>NSApplication</string>
<key>CFBundleIconFile</key>
<string>osx-debugger.icns</string>
</dict>
</plist>
21 changes: 21 additions & 0 deletions src/debugging/Inspector/Inspector/Inspector/main.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#import <Cocoa/Cocoa.h>

int main(int argc, const char * argv[]) {
NSBundle* applicationBundle = [NSBundle bundleWithPath:[[NSBundle mainBundle] pathForAuxiliaryExecutable:@"NativeScript Inspector.app"]];
NSArray* runningApplications = [NSRunningApplication runningApplicationsWithBundleIdentifier:[applicationBundle bundleIdentifier]];

if (runningApplications.count > 0) {
NSDictionary* innerArguments = @{ @"project_name": @(argv[2]) };
[[NSDistributedNotificationCenter defaultCenter] postNotificationName:@"org.NativeScriptInspector.ApplicationShouldHandleReopen" object:nil userInfo:innerArguments];
[runningApplications[0] activateWithOptions:NSApplicationActivateIgnoringOtherApps];
} else {
NSDictionary* configuration = @{
NSWorkspaceLaunchConfigurationArguments: @[ @(argv[1]), @(argv[2]) ],
NSWorkspaceLaunchConfigurationEnvironment: @{ @"DYLD_FRAMEWORK_PATH": [[NSBundle mainBundle] privateFrameworksPath] }
};

[[NSWorkspace sharedWorkspace] launchApplicationAtURL:applicationBundle.bundleURL options:0 configuration:configuration error:nil];
}

return 0;
}
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#import <Cocoa/Cocoa.h>

@interface AppDelegate : NSObject <NSApplicationDelegate>


@end

Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#import "AppDelegate.h"

@implementation AppDelegate

-(BOOL)applicationShouldTerminateAfterLastWindowClosed:(nonnull NSApplication *)sender {
return YES;
}

@end
Loading