Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
221 commits
Select commit Hold shift + click to select a range
2fe2ea9
initial commit
ammarahm-ed Sep 20, 2024
14adae5
implement Runtime
ammarahm-ed Sep 21, 2024
bb48bb4
part 1
ammarahm-ed Sep 25, 2024
cd5010a
part 2
ammarahm-ed Sep 27, 2024
2507609
part 3
ammarahm-ed Sep 28, 2024
20f9a5c
part 4
ammarahm-ed Sep 29, 2024
3931f28
part 5
ammarahm-ed Sep 29, 2024
7354980
part 6
ammarahm-ed Sep 29, 2024
09761b9
part 7
ammarahm-ed Sep 30, 2024
09b253f
part 8
ammarahm-ed Sep 30, 2024
5ed3591
part 9
ammarahm-ed Sep 30, 2024
a20ffdf
part 10
ammarahm-ed Sep 30, 2024
bcddac2
part 11
ammarahm-ed Sep 30, 2024
31c9e11
part 12
ammarahm-ed Sep 30, 2024
8ce2ea5
part 13
ammarahm-ed Oct 1, 2024
6e3ac86
part 14
ammarahm-ed Oct 1, 2024
cc7ae96
part 15
ammarahm-ed Oct 1, 2024
b622695
part 16
ammarahm-ed Oct 2, 2024
2036074
part 17
ammarahm-ed Oct 7, 2024
2179586
part 18
ammarahm-ed Oct 8, 2024
6f10352
part 19
ammarahm-ed Oct 8, 2024
0459cb8
part 20
ammarahm-ed Oct 9, 2024
38e3a7f
part 21
ammarahm-ed Oct 11, 2024
d86d5fd
minor fix
ammarahm-ed Oct 12, 2024
25b088f
cleanup
ammarahm-ed Oct 12, 2024
1cdab85
part 22
ammarahm-ed Oct 12, 2024
2625f96
part 23
ammarahm-ed Oct 15, 2024
86a89a2
part 24
ammarahm-ed Oct 16, 2024
eb2ea2a
part 25
ammarahm-ed Oct 19, 2024
ea787c3
minor cleanup
ammarahm-ed Oct 20, 2024
91fe489
part 26
ammarahm-ed Oct 31, 2024
35ea380
part 26
ammarahm-ed Nov 2, 2024
2f309b8
part 27
ammarahm-ed Nov 2, 2024
756e7d5
support building release aar
ammarahm-ed Nov 3, 2024
805df18
part 28
ammarahm-ed Nov 7, 2024
b6183b6
part 29
ammarahm-ed Nov 29, 2024
b5b28bd
part 30
ammarahm-ed Nov 29, 2024
a5e25c8
part 31
ammarahm-ed Nov 29, 2024
6f84f0d
part 32
ammarahm-ed Nov 29, 2024
6a54f40
part 33 (libs)
ammarahm-ed Nov 29, 2024
d801f24
part 33
ammarahm-ed Dec 30, 2024
1806e7b
part 34
ammarahm-ed Dec 31, 2024
44e8f03
part 35
ammarahm-ed Dec 31, 2024
bff3bc6
part 36
ammarahm-ed Dec 31, 2024
98cf059
update libs
ammarahm-ed Dec 31, 2024
7f3c55f
fix: call JSEnter before invoking timer callbacks
ammarahm-ed Dec 31, 2024
69b3e81
fix: release build with v8
ammarahm-ed Jan 2, 2025
857ff3e
chore: log disable part 1 - still get TNS.Java logs though
NathanWalker Jan 16, 2025
6ed5cb3
chore: ignore node_modules in build-tools
NathanWalker Jan 16, 2025
fef9212
chore: log disable part 1 - still get TNS.Java logs though
NathanWalker Jan 16, 2025
a0b7f49
chore: ignore node_modules in build-tools
NathanWalker Jan 16, 2025
58a0c13
Merge remote-tracking branch 'upstream/main'
NathanWalker Jan 17, 2025
7128faf
part 37
ammarahm-ed Jan 18, 2025
5ded706
Create build.yml
ammarahm-ed Jan 18, 2025
8287fcd
Update build.yml
ammarahm-ed Jan 18, 2025
6acaf87
Update build.yml
ammarahm-ed Jan 18, 2025
3d438a6
Update build.yml
ammarahm-ed Jan 18, 2025
bc6cb72
ci: fix
ammarahm-ed Jan 18, 2025
ab59ce0
ci: update workflows
ammarahm-ed Jan 18, 2025
183ca05
part 38
ammarahm-ed Jan 19, 2025
d299b03
cleanup
ammarahm-ed Jan 19, 2025
ce73f2b
Merge remote-tracking branch 'upstream/main'
NathanWalker Jan 19, 2025
21470c6
fix: v8
NathanWalker Jan 19, 2025
852b81f
Merge pull request #2 from NathanWalker/main
ammarahm-ed Jan 19, 2025
3f65078
fix jsc, optimize js arg conversion
ammarahm-ed Jan 20, 2025
5ba50f7
fix string conversion
ammarahm-ed Jan 21, 2025
2ad1b0e
fix property setters
ammarahm-ed Jan 21, 2025
3380db1
fix gc
ammarahm-ed Jan 22, 2025
e9a5700
fix java insance creation perf
ammarahm-ed Jan 24, 2025
becae56
quickjs: fix typedarray and arraybuffer
ammarahm-ed Jan 25, 2025
b347f05
runtime: fix js exception handling in java
ammarahm-ed Jan 25, 2025
683774f
runtime: buffer to bytebuffer interop
ammarahm-ed Jan 25, 2025
01f633d
fix: return proxy from constructor
ammarahm-ed Jan 28, 2025
a98a072
feat: update quickjs to latest
ammarahm-ed Jan 29, 2025
efb9405
fix: stacktrace file paths
ammarahm-ed Jan 30, 2025
a326b0e
fix: unify gradle version
farfromrefug Jan 29, 2025
2a99e21
improve error stacktrace when worker throws error
ammarahm-ed Jan 30, 2025
0f4b1d1
fix is_float check for qjs
ammarahm-ed Jan 30, 2025
2fce63f
fix: inner type should not overwrite static fields
ammarahm-ed Jan 30, 2025
a2807d5
minor touchup
ammarahm-ed Jan 31, 2025
53faa23
fix disposing v8 runtime
ammarahm-ed Jan 31, 2025
f885e83
fix disposal
ammarahm-ed Jan 31, 2025
c0825c8
fix disposal
ammarahm-ed Jan 31, 2025
225163c
always return main runtime as fallback
ammarahm-ed Jan 31, 2025
24ffaca
support multi threading in workers
ammarahm-ed Feb 2, 2025
5f141b0
optimize 1
ammarahm-ed Feb 4, 2025
6ebf1a9
push changes
ammarahm-ed Feb 4, 2025
d01a944
fix worker tests
ammarahm-ed Feb 5, 2025
2a43746
use concurrent maps to access runtime by id/tid
ammarahm-ed Feb 6, 2025
9461a06
fix hermes build
ammarahm-ed Feb 6, 2025
f5a94ea
improve jsc function call perf
ammarahm-ed Feb 6, 2025
cfcba76
jsc: fix weakref
ammarahm-ed Feb 6, 2025
bd6a287
fix quickjs build failing with ndk27
ammarahm-ed Feb 6, 2025
491974c
minor fixes
ammarahm-ed Feb 6, 2025
ab2118d
fix: ensure we build the runtime with the passed ndkVersion
farfromrefug Feb 6, 2025
d39cb58
fix memory leaks and runtime cleanup
ammarahm-ed Feb 9, 2025
82993f1
refactor, add napi module example
ammarahm-ed Feb 10, 2025
36fe818
fix perf 1
ammarahm-ed Feb 12, 2025
cc8adb4
fix 3
ammarahm-ed Feb 12, 2025
777a721
fix array getter arg count
ammarahm-ed Feb 13, 2025
6a35bc0
host objects support
ammarahm-ed Feb 16, 2025
d9bf136
update ts_helpers to work with host objects
ammarahm-ed Feb 16, 2025
16d6a77
add host_objects to v8 napi
ammarahm-ed Feb 16, 2025
0400e0c
minor cleanup
ammarahm-ed Feb 16, 2025
060aa5e
fix host objects for v8
ammarahm-ed Feb 17, 2025
6d48eba
fix FieldCallbackData memory leak
ammarahm-ed Feb 17, 2025
ce6c265
enable hostObjects with -PuseHostObjects
ammarahm-ed Feb 17, 2025
a909371
expose host object types only when supported
ammarahm-ed Feb 17, 2025
4575e81
increase time tests retries
ammarahm-ed Feb 17, 2025
1729c78
fix crash
ammarahm-ed Feb 17, 2025
6856be0
refactor 1
ammarahm-ed Feb 17, 2025
d6395d6
cleanup proxies before objects
ammarahm-ed Feb 17, 2025
056442a
properly release object
ammarahm-ed Feb 17, 2025
d2bed87
small improvements
ammarahm-ed Feb 18, 2025
351f6c1
fix memory leak
ammarahm-ed Feb 18, 2025
9ce3764
fix creating inner types
ammarahm-ed Feb 19, 2025
f6f492b
fix prototype cache
ammarahm-ed Feb 19, 2025
90bff0a
fix: isHolder check failing when calling accessing property from prot…
ammarahm-ed Feb 19, 2025
79d49e1
fix: fallback to JSON.stringify for plain js objects
ammarahm-ed Feb 19, 2025
f89b97d
quickjs: run tests async
ammarahm-ed Feb 20, 2025
adf8076
quickjs: fix random crashes in napi
ammarahm-ed Feb 20, 2025
045bfe9
runtime: fallback to default value when setting a field
ammarahm-ed Feb 20, 2025
93ef316
quickjs: unlock env after closing scope
ammarahm-ed Feb 20, 2025
dda33eb
quickjs: add napi_is_host_object
ammarahm-ed Feb 20, 2025
6aec780
runtime: add IsHostObject method to ObjectManager
ammarahm-ed Feb 20, 2025
63889b3
v8: implement napi_is_host_object function
ammarahm-ed Feb 20, 2025
39a2572
metadata: optimize FieldAccessor callbacks to check for __napi::this …
ammarahm-ed Feb 20, 2025
6ed2414
quickjs: support RegExp.leftContext, RegExp.rightContext
ammarahm-ed Feb 20, 2025
20fbfd0
quickjs: throw exception if index_setter throws error
ammarahm-ed Feb 20, 2025
24cf5f5
runtime: fix release signing config
ammarahm-ed Feb 22, 2025
4771615
runtime: fix build
ammarahm-ed Feb 22, 2025
ccd605a
quickjs: fix cleanup method cache
ammarahm-ed Feb 22, 2025
1b270e5
quickjs: delete jsr before erasing on destroy
ammarahm-ed Feb 22, 2025
3fa381d
hermes: unlock env after closing scope
ammarahm-ed Feb 22, 2025
9f26d62
hermes: fix running js from multiple threads
ammarahm-ed Feb 22, 2025
7f5313a
hermes: do not use method cache when calling from java -> js
ammarahm-ed Feb 22, 2025
1e73bf4
runtime: fix finalizers not getting called in hermes
ammarahm-ed Feb 22, 2025
ecd2e97
runtime: check for null method reference before returning
ammarahm-ed Feb 22, 2025
2a2cae9
runtime: skip test in Hermes
ammarahm-ed Feb 22, 2025
1fd295f
jsc: fix creating constructors
ammarahm-ed Feb 22, 2025
9509e65
jsc: constructors are objects in JSC.
ammarahm-ed Feb 22, 2025
b081981
jsc: fix tsc_helpers to handle object ctors
ammarahm-ed Feb 22, 2025
ef6412b
chore: cleanup logs in tests
ammarahm-ed Feb 22, 2025
f3ccca1
hermes: add support for napi_adjust_external_memory
ammarahm-ed Feb 24, 2025
294b6fb
quickjs: support napi_adjust_external_memory
ammarahm-ed Feb 24, 2025
9b5b94a
quickjs: fix prototype memory leak
ammarahm-ed Feb 26, 2025
0506b31
runtime: if Runtime::GetRuntime() fails, we want to throw exception t…
ammarahm-ed Feb 26, 2025
fcaf510
runtime: Add function to get runtime without throwing if it is null. …
ammarahm-ed Feb 26, 2025
bd358ca
runtime: While the runtime is terminating, it's possible that it call…
ammarahm-ed Feb 26, 2025
9e6cc0e
tests: fix failing test in quickjs
ammarahm-ed Feb 26, 2025
5aacbbd
runtime: throw to java if terminating worker throws exception
ammarahm-ed Feb 26, 2025
6532eb5
runtime: fix exception thrown during runtime cleanup
ammarahm-ed Feb 26, 2025
a3e4216
runtime: cleanup
ammarahm-ed Feb 26, 2025
51c72ec
update README.md
ammarahm-ed Feb 27, 2025
3553662
readme: add logo
ammarahm-ed Feb 27, 2025
6bde876
readme: update links
ammarahm-ed Feb 27, 2025
1640b9d
readme: cleanup
ammarahm-ed Feb 27, 2025
817c155
readme: add discord link
ammarahm-ed Feb 27, 2025
dcb4a6d
readme: cleanup
ammarahm-ed Feb 27, 2025
c626a8e
readme: add version tags
ammarahm-ed Feb 27, 2025
37fd1ba
readme: center align version tags
ammarahm-ed Feb 27, 2025
70e56dc
fix: ns debug android command
ammarahm-ed Mar 2, 2025
e3adcdb
feat: add URL & URLSearchParams
ammarahm-ed Mar 1, 2025
9614a00
fix: avoid making copies of strings
ammarahm-ed Mar 2, 2025
c6a6bd5
fix some failing tests
ammarahm-ed Mar 9, 2025
87d11ec
feat: static hermes
ammarahm-ed Mar 9, 2025
032f7ef
feat: support primjs
ammarahm-ed Mar 9, 2025
d05f552
quickjs: fix function names
ammarahm-ed Mar 9, 2025
8d19e83
runtime: fix primjs error
ammarahm-ed Mar 9, 2025
4137b7b
refactor: remove unnecessary NapiScope instances in CallbackHandlers
ammarahm-ed Mar 9, 2025
b2175d9
runtime: fix mem leak when creating metadata tree nodes
ammarahm-ed Mar 9, 2025
05add92
primjs: remove cpp shared lib
ammarahm-ed Mar 9, 2025
34313e1
v8: catch exception thrown with inspector modules not found
ammarahm-ed Mar 9, 2025
0017298
runtime: throw exception if module eval fails
ammarahm-ed Mar 9, 2025
683740b
primjs: max stack size
ammarahm-ed Mar 9, 2025
6a5d0cc
chore: cleanup
ammarahm-ed Mar 9, 2025
46bed22
v8: cleanup code
ammarahm-ed Mar 12, 2025
ddff583
runtime: allow URL in worker constructor
ammarahm-ed Mar 12, 2025
a070a9a
runtime: handle internal modules, support require("lib.node");
ammarahm-ed Mar 12, 2025
42e7018
runtime: fix memory leak on release objects
ammarahm-ed Mar 14, 2025
0ffe3b3
primjs: fix segfault on eval
ammarahm-ed Mar 16, 2025
4824700
runtime: avoid throwing uncaught exceptions in java
ammarahm-ed Mar 17, 2025
b7cbc2f
jsparser: handle parsing swc transformed @NativeClass
ammarahm-ed Mar 15, 2025
2696a9f
fix: handle all swc transform cases
ammarahm-ed Mar 15, 2025
600d02c
fix: use call_super location
ammarahm-ed Mar 15, 2025
e0f3eb8
cleanup tests
ammarahm-ed Mar 15, 2025
02765c6
fix: jsparser fixes and support for primjs in sbg
ammarahm-ed Mar 17, 2025
271c602
primjs: port host objects support
ammarahm-ed Mar 18, 2025
1619e2d
fix ts_helpers.js
ammarahm-ed Oct 16, 2025
80c633c
feat: Update V8 to 11.1.277
ammarahm-ed Oct 22, 2025
9794b66
hermes: cleanup jsr runtime
ammarahm-ed Oct 22, 2025
b72bda8
hermes: update to hermes v1
ammarahm-ed Oct 29, 2025
97ee71f
feat: v8 13.8.9
ammarahm-ed Oct 30, 2025
0fa1175
v8: fix v8 build failing due to incorrect args
ammarahm-ed Oct 30, 2025
1a5d499
chore: update gradle to 8.14.3
ammarahm-ed Oct 30, 2025
48df924
chore: update deps
ammarahm-ed Oct 30, 2025
c964825
feat: support multiple versions of v8
ammarahm-ed Oct 30, 2025
7fae343
hermes: class syntax is not supported
ammarahm-ed Oct 30, 2025
4e7aff3
v8: Set default engine to V8-10
ammarahm-ed Oct 30, 2025
a9e4a18
Merge branch 'main' into v8-update
ammarahm-ed Oct 31, 2025
48d8a55
Merge pull request #32 from NativeScript/v8-update
ammarahm-ed Oct 31, 2025
483e0a3
chore: trying release ci
farfromrefug Nov 2, 2025
1cd6887
add benchmarks
ammarahm-ed Nov 2, 2025
0847e6a
add setup command
ammarahm-ed Nov 2, 2025
d1dd983
Merge pull request #33 from NativeScript/v8-update
ammarahm-ed Nov 3, 2025
1caffa0
hermes: support loading bytecode
ammarahm-ed Nov 4, 2025
3b6b34e
Merge pull request #34 from NativeScript/v8-update
ammarahm-ed Nov 12, 2025
60d1337
feat: add promise rejection handling for v8
ammarahm-ed Nov 24, 2025
f318816
feat: add promise rejection handling for quickjs
ammarahm-ed Nov 24, 2025
210295e
v8: rename promise tracker function to be consistent across engines
ammarahm-ed Nov 24, 2025
567e42b
hermes: add promise rejection handler
ammarahm-ed Nov 24, 2025
fd496de
Merge pull request #35 from NativeScript/feat-promise-rejection-handling
ammarahm-ed Nov 25, 2025
8774062
quickjs: support multiple quickjs versions
ammarahm-ed Nov 26, 2025
b1cbc8f
Merge pull request #36 from NativeScript/support_qjs_bellard
ammarahm-ed Nov 26, 2025
70055a9
fix .extend not working in quickjs
ammarahm-ed Feb 3, 2026
62755ae
fix error 'length is read-only`. Use defineProperty
ammarahm-ed Feb 3, 2026
0caed95
Merge pull request #39 from NativeScript/fix-quickjs-bugs
ammarahm-ed Feb 3, 2026
2904566
fix console.log(error) should include stack trace
ammarahm-ed Feb 20, 2026
21ca70f
add safety checks
ammarahm-ed Feb 21, 2026
a8a0bc6
Merge pull request #40 from NativeScript/fix-error-console-log
ammarahm-ed Feb 24, 2026
709bdc3
chore: import napi-android history
DjDeveloperr Jun 5, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
The diff you're trying to view is too large. We only load the first 3000 changed files.
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
platforms/android/test-app/runtime/src/main/libs/**/libv8_monolith.a filter=lfs diff=lfs merge=lfs -text
34 changes: 34 additions & 0 deletions platforms/android/.github/workflows/build_hermes.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Build with Hermes

on: workflow_dispatch

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: set up JDK 17
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'temurin'

- name: Install dependencies
run: |
cd test-app/build-tools/jsparser
npm install

- name: Grant execute permission for gradlew
run: chmod +x gradlew

- name: Build with HERMES
run: ./gradlew -Pengine=HERMES

- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: release
path: |
./dist_hermes


34 changes: 34 additions & 0 deletions platforms/android/.github/workflows/build_jsc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Build with JSC

on: workflow_dispatch

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: set up JDK 17
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'temurin'

- name: Install dependencies
run: |
cd test-app/build-tools/jsparser
npm install

- name: Grant execute permission for gradlew
run: chmod +x gradlew

- name: Build with JSC
run: ./gradlew -Pengine=JSC

- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: release
path: |
./dist_jsc


34 changes: 34 additions & 0 deletions platforms/android/.github/workflows/build_quickjs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Build with QuickJS

on: workflow_dispatch

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: set up JDK 17
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'temurin'

- name: Install dependencies
run: |
cd test-app/build-tools/jsparser
npm install

- name: Grant execute permission for gradlew
run: chmod +x gradlew

- name: Build with QUICKJS
run: ./gradlew -Pengine=QUICKJS

- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: release
path: |
./dist_quickjs


34 changes: 34 additions & 0 deletions platforms/android/.github/workflows/build_v8.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Build with V8

on: workflow_dispatch

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: set up JDK 17
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'temurin'

- name: Install dependencies
run: |
cd test-app/build-tools/jsparser
npm install

- name: Grant execute permission for gradlew
run: chmod +x gradlew

- name: Build with V8
run: ./gradlew -Pengine=V8

- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: release
path: |
./dist_v8


219 changes: 219 additions & 0 deletions platforms/android/.github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,219 @@
on:
workflow_dispatch:
inputs:
publish:
description: 'If true, run publish after build (default: false)'
required: false
default: 'false'
run_tests:
description: 'If true, run gradle runtestsAndVerifyResults before builds (default: false)'
required: false
default: 'false'
custom_version:
description: 'Optional custom NPM version (overrides computed version).'
required: false
default: ''
enable_HERMES:
description: 'Enable HERMES in the matrix'
required: false
default: 'true'
enable_V8:
description: 'Enable V8 in the matrix'
required: false
default: 'true'
enable_QUICKS:
description: 'Enable QUICKS in the matrix'
required: false
default: 'true'
enable_JSC:
description: 'Enable JSC in the matrix'
required: false
default: 'true'

jobs:
set-matrix:
name: Build matrix from inputs
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.emit.outputs.matrix }}
steps:
- name: Emit matrix JSON
id: emit
run: |
set -e
# Build the engine list based on workflow dispatch inputs.
engines=()
if [ "${{ github.event.inputs.enable_HERMES }}" != "false" ]; then engines+=("HERMES"); fi
if [ "${{ github.event.inputs.enable_V8 }}" != "false" ]; then engines+=("V8"); fi
if [ "${{ github.event.inputs.enable_QUICKS }}" != "false" ]; then engines+=("QUICKS"); fi
if [ "${{ github.event.inputs.enable_JSC }}" != "false" ]; then engines+=("JSC"); fi

# If user disabled everything, fall back to a safe default (all engines).
if [ ${#engines[@]} -eq 0 ]; then
echo "All engines were disabled; defaulting to all engines."
engines=(HERMES V8 QUICKS JSC)
fi

# Build a JSON array string like ["HERMES","V8"]
json="["
for e in "${engines[@]}"; do
json="${json}\"${e}\","
done
json="${json%,}" # remove trailing comma
json="${json}]"

echo "Computed matrix JSON: $json"
echo "matrix=$json" >> $GITHUB_OUTPUT

engine:
name: Test · Build · Publish (engine=${{ matrix.engine }})
needs: set-matrix
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
# fromJson converts the JSON string emitted by set-matrix into the matrix array
engine: ${{ fromJson(needs.set-matrix.outputs.matrix) }}
env:
JS_PARSER_DIR: test-app/build-tools/jsparser
ENGINE: ${{ matrix.engine }}
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
persist-credentials: true

- name: Setup Node.js 18
uses: actions/setup-node@v4
with:
node-version: 18

- name: set up JDK 17
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'temurin'

- name: Restore npm cache for jsparser
uses: actions/cache@v4
with:
path: |
~/.npm
${{ github.workspace }}/${{ env.JS_PARSER_DIR }}/node_modules
key: ${{ runner.os }}-node-${{ hashFiles('test-app/build-tools/jsparser/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-

- name: Install dependencies (jsparser)
working-directory: ${{ env.JS_PARSER_DIR }}
run: npm ci

- name: Grant execute permission for gradlew
run: chmod +x gradlew

- name: Run runSbgTests (no emulator) for ${{ matrix.engine }}
if: ${{ github.event.inputs.run_tests == 'true' }}
run: |
echo "Running runSbgTests with ENGINE=${ENGINE}"
./gradlew -Pengine="${ENGINE}" runSbgTests
env:
ENGINE: ${{ matrix.engine }}

- name: Run runtestsAndVerifyResults inside emulator for ${{ matrix.engine }}
if: ${{ github.event.inputs.run_tests == 'true' }}
uses: reactivecircus/android-emulator-runner@v2
with:
api-level: 35
arch: x86_64
target: google_apis
emulator-options: -no-window
script: |
echo "Running runtestsAndVerifyResults with ENGINE=${ENGINE}"
./gradlew -Pengine="${ENGINE}" runtestsAndVerifyResults
env:
ENGINE: ${{ matrix.engine }}

- name: Build with engine ${{ matrix.engine }}
run: |
echo "Building with ENGINE=${ENGINE}"
./gradlew -Pengine="${ENGINE}"
env:
ENGINE: ${{ matrix.engine }}

- name: Publish tarball (or add dist-tag if version already exists)
id: npm_publish
run: |
set -e
eng_lc="${ENG_LC}"
TARBALL="${TARBALL:-dist-${eng_lc}-${NPM_VERSION}.tgz}"
TAG="${eng_lc}-${NPM_VERSION}"
echo "Publishing tarball $TARBALL with npm tag $TAG (package version: $NPM_VERSION)..."
echo "//registry.npmjs.org/:_authToken=${NODE_AUTH_TOKEN}" > .npmrc

if npm publish "$TARBALL" --tag "$TAG" --provenance --access public; then
echo "npm publish succeeded for $TARBALL"
echo "PUBLISHED=true" >> $GITHUB_ENV
else
echo "npm publish failed; attempting to add dist-tag pointing to existing version"
npm dist-tag add @nativescript/android@"${NPM_VERSION}" "${TAG}"
echo "DIST_TAG_ADDED=true" >> $GITHUB_ENV
fi
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_PUBLISH_TOKEN }}
NPM_VERSION: ${{ env.NPM_VERSION }}
ENG_LC: ${{ env.ENG_LC }}
TARBALL: ${{ env.TARBALL }}

- name: Create and push git tag for engine/version
if: always()
id: tag_release
run: |
set -e
eng_lc="${ENG_LC}"
TAG_NAME="${eng_lc}-v${NPM_VERSION}"
echo "Creating tag $TAG_NAME"
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
if git rev-parse --verify "$TAG_NAME" >/dev/null 2>&1; then
git tag -d "$TAG_NAME" || true
fi
git tag -a "$TAG_NAME" -m "Release ${TAG_NAME}"
git push origin "refs/tags/${TAG_NAME}" || true
echo "TAG_NAME=$TAG_NAME" >> $GITHUB_ENV

- name: Update CHANGELOG
id: changelog
uses: requarks/changelog-action@v1
with:
useGitmojis: false
excludeTypes: build,docs,other,style,chore,perf,doc
token: ${{ secrets.GITHUB_TOKEN }}
tag: v${{ env.TAG_NAME }}
writeToFile: false

- name: Create GitHub release for engine
uses: actions/create-release@v1
if: always()
with:
tag_name: ${{ env.TAG_NAME }}
release_name: ${{ env.ENGINE }} ${{ env.NPM_VERSION }}
body: ${{ steps.changelog.outputs.changes }}
draft: false
prerelease: ${{ contains(env.NPM_VERSION, '-dev') }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
ENGINE: ${{ matrix.engine }}
NPM_VERSION: ${{ env.NPM_VERSION }}

- name: Final status print
run: |
echo "Engine: ${ENGINE}"
echo "NPM_VERSION: ${NPM_VERSION}"
echo "Published: ${PUBLISHED:-false}"
echo "Dist-tag added: ${DIST_TAG_ADDED:-false}"
echo "Tag created: ${TAG_NAME:-none}"
env:
PUBLISHED: ${{ env.PUBLISHED }}
DIST_TAG_ADDED: ${{ env.DIST_TAG_ADDED }}
TAG_NAME: ${{ env.TAG_NAME }}
21 changes: 21 additions & 0 deletions platforms/android/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
*.iml
.gradle
/local.properties
/.idea/caches
/.idea/libraries
/.idea/modules.xml
/.idea/workspace.xml
/.idea/navEditor.xml
/.idea/assetWizardSettings.xml
.DS_Store
/build
/captures
.externalNativeBuild
.cxx
local.properties
dist
dist_v8
dist_quickjs
dist_hermes
dist_jsc
dist_*
3 changes: 3 additions & 0 deletions platforms/android/.idea/.gitignore

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

6 changes: 6 additions & 0 deletions platforms/android/.idea/compiler.xml

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

Loading
Loading