Skip to content

Commit 995e8ea

Browse files
committed
Update README.md
1 parent 3e9d02f commit 995e8ea

File tree

1 file changed

+53
-5
lines changed

1 file changed

+53
-5
lines changed

README.md

Lines changed: 53 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,39 @@
11
# JavaScript
22

3-
Linux version of JavaScriptCore written in Swift with closure support.
3+
This package provides JavaScript APIs for several engines.
4+
5+
## Package Targets
6+
* JavaScipt - common protocols
7+
* V8 - google's v8 engine wrapper
8+
* JavaScriptCoreSwift - linux version of apple's JavaScriptCore
9+
* СhakraCore - microsoft's chakracore engine wrapper (WIP)
10+
11+
## Package.swift
12+
13+
```swift
14+
.package(url: "https://github.com/tris-foundation/javascript.git", .branch("master"))
15+
```
416

517
## Requirements
618

19+
### V8
20+
21+
#### macOS
722
```bash
8-
apt install libjavascriptcoregtk-1.0-dev
23+
brew install v8
924
```
1025

11-
## Package.swift
26+
#### Linux
27+
```bash
28+
add-apt-repository -y ppa:pinepain/libv8-archived
29+
apt update && apt install -y libv8-dev
30+
```
1231

13-
```swift
14-
.package(url: "https://github.com/tris-foundation/javascript.git", .branch("master"))
32+
### JavaScriptCore
33+
34+
#### Linux
35+
```bash
36+
apt install -y libjavascriptcoregtk-1.0-dev
1537
```
1638

1739
## Usage
@@ -28,3 +50,29 @@ assertTrue(result.isString)
2850
assertEqual(try result.toString(), "result string")
2951
assertEqual("\(result)", "result string")
3052
```
53+
54+
## Useful commands
55+
56+
### macOS
57+
```bash
58+
swift package \
59+
-Xcc -I/usr/local/include \
60+
-Xlinker -L/usr/local/lib \
61+
-Xlinker /usr/local/lib/libv8.dylib \
62+
-Xlinker /usr/local/lib/libv8_libbase.a \
63+
-Xlinker /usr/local/lib/libv8_libplatform.a \
64+
generate-xcodeproj
65+
66+
swift test \
67+
-Xlinker /System/Library/Frameworks/JavaScriptCore.framework/Versions/Current/JavaScriptCore \
68+
-Xcc -I/usr/local/include \
69+
-Xlinker /usr/local/lib/libv8.dylib \
70+
-Xlinker /usr/local/lib/libv8_libbase.a \
71+
-Xlinker /usr/local/lib/libv8_libplatform.a \
72+
--generate-linuxmain
73+
```
74+
75+
### Linux
76+
```bash
77+
swift test -Xlinker /usr/lib/libv8_libbase.a -Xlinker /usr/lib/libv8_libplatform.a
78+
```

0 commit comments

Comments
 (0)