Skip to content

Commit

Permalink
Add macOS build
Browse files Browse the repository at this point in the history
  • Loading branch information
Elmi Ahmadov committed Dec 13, 2019
1 parent 353cc8d commit c55edb7
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 1 deletion.
23 changes: 23 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,29 @@ name: Build J2V8
on: [push]

jobs:
j2v8_macos:
name: Build J2V8 for macOS
runs-on: macos-latest

steps:
- name: Checkout
uses: actions/checkout@v1

- name: Download monolithic libraries and extract to v8.out directory
run: |
curl -O https://download.eclipsesource.com/j2v8/v8/libv8_7.4.288_monolith.zip
mkdir -p v8.out
unzip libv8_7.4.288_monolith.zip -d v8.out
# start j2v8 build
python build.py -t macos -a x64 j2v8cmake j2v8jni j2v8cpp j2v8optimize j2v8java j2v8test
- name: Archive J2V8 macOS x86_64 jar
uses: actions/[email protected]
with:
name: j2v8-macos-x86_64
path: build.out/j2v8_macos_x86_64-6.0.0.jar

generate_j2v8_archives:
name: Create J2V8 Linux jar and Android aar archive files
runs-on: ubuntu-latest
Expand Down
4 changes: 3 additions & 1 deletion build_system/config_macos.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,17 +43,19 @@ def build_node_js(config):
#-----------------------------------------------------------------------
def build_j2v8_cmake(config):
cmake_vars = cmu.setAllVars(config)
V8_monolith_library_dir = config.platform + "." + config.arch

# NOTE: uses Python string interpolation (see: https://stackoverflow.com/a/4450610)
return \
u.mkdir(u.cmake_out_dir) + \
["cd " + u.cmake_out_dir] + \
u.rm("CMakeCache.txt CMakeFiles/") + \
["""cmake \
-DJ2V8_MONOLITH_LIB_DIR={0} \
-DCMAKE_BUILD_TYPE=Release \
%(cmake_vars)s \
../../ \
"""
""".format(V8_monolith_library_dir)
% locals()]

macos_config.build_step(c.build_j2v8_cmake, build_j2v8_cmake)
Expand Down

0 comments on commit c55edb7

Please sign in to comment.