项目作者: qasim

项目描述 :
Run JavaScript in macOS apps through Microsoft's ChakraCore engine.
高级语言: Objective-C++
项目地址: git://github.com/qasim/ChakraCore-Cocoa.git
创建时间: 2017-04-24T02:16:32Z
项目社区:https://github.com/qasim/ChakraCore-Cocoa

开源协议:MIT License

下载


ChakraCore-Cocoa

This is a very rudimentary sample of building macOS applications that can run JavaScript through Microsoft’s ChakraCore engine.

Requirements

ChakraCore itself has the following requirements:

  1. $ brew install cmake icu4c

Setup

Clone the repository and all of its submodules:

  1. $ git clone --recursive https://github.com/qasim/ChakraCore-Cocoa.git && cd ChakraCore-Cocoa

Then, we can generate ChakraCore’s Xcode project files:

  1. $ ./ChakraCore/build.sh --xcode --icu=/usr/local/opt/icu4c/include

Usage

Open the Xcode workspace:

  1. $ open ChakraCore-Cocoa.xcworkspace

That’s it! Build and run the ChakraCore-Cocoa target to see the sample file being executed by ChakraCore, and then printed to console, all inside a macOS app.

What’s next?

This can be used to build native macOS applications that may depend on a shared JS library. One could build a Cocoa wrapper on top of ChakraCore to create an alternative to Apple’s JavaScriptCore.

What about iOS?

At the time of writing, ChakraCore cannot be built for iOS targets yet (Microsoft/ChakraCore#1237).