Skip to content

Commit c75eb73

Browse files
authored
Merge pull request #33 from NativeScript/v8-update
V8 update
2 parents c4abbe4 + f2a94bd commit c75eb73

File tree

6 files changed

+16258
-5
lines changed

6 files changed

+16258
-5
lines changed

README.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,11 +74,16 @@ Set the following environment variables:
7474
- `ANDROID_HOME` pointing to where you have installed the Android SDK
7575
- `ANDROID_NDK_HOME` pointing to the version of the Android NDK needed for this version of NativeScript
7676

77-
Run the following command to build the runtime:
77+
Run the following commands to build the runtime:
78+
79+
```
80+
npm run setup
81+
```
7882

7983
```
8084
npm run build
8185
```
86+
8287
The command will let you interactively choose the JS engine you want to build with. i.e V8, QuickJS, Hermes or JSC, PrimJS, Static Hermes.
8388

8489
- The build process includes building of the runtime package (both optimized and with unstripped v8 symbol table), as well as all supplementary tools used for the android builds: metadata-generator, binding-generator, metadata-generator, static-binding-generator

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,8 @@
2727
"scripts": {
2828
"changelog": "conventional-changelog -p angular -i CHANGELOG.md -s",
2929
"version": "npm run changelog && git add CHANGELOG.md",
30-
"build": "node ./scripts/build.js"
30+
"build": "node ./scripts/build.js",
31+
"setup": "cd test-app/build-tools/jsparser && npm install && cd ../../../"
3132
},
3233
"devDependencies": {
3334
"conventional-changelog-cli": "^2.1.1",

test-app/app/src/main/AndroidManifest.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
android:name="com.tns.ErrorReportActivity"
2727
android:label="ErrorActivity">
2828
</activity>
29+
<profileable android:shell="true"/>
2930
</application>
3031

3132
</manifest>

test-app/app/src/main/assets/app/MyActivity.js

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
}
2222
}
2323
*/
24+
const benchmarkRunner = require("./benchmark.js");
2425
var MyActivity = (function (_super) {
2526
__extends(MyActivity, _super);
2627
function MyActivity() {
@@ -30,18 +31,23 @@ var MyActivity = (function (_super) {
3031
_super.prototype.onCreate.call(this, bundle);
3132
require('./tests/testsWithContext').run(this);
3233
//run jasmine
33-
execute();
34+
// execute();
3435
var layout = new android.widget.LinearLayout(this);
3536
layout.setOrientation(1);
3637
this.setContentView(layout);
3738
var textView = new android.widget.TextView(this);
3839
textView.setText("It's a button!");
40+
textView.setTextIsSelectable(true);
3941
layout.addView(textView);
4042

4143
var button = new android.widget.Button(this);
4244
button.setText("Hit me");
4345
layout.addView(button);
4446

47+
var button2 = new android.widget.Button(this);
48+
button2.setText("Run Benchmark");
49+
layout.addView(button2);
50+
4551
var Color = android.graphics.Color;
4652
var colors = [
4753
Color.BLUE,
@@ -62,6 +68,17 @@ var MyActivity = (function (_super) {
6268
},
6369
})
6470
);
71+
button2.setOnClickListener(
72+
new android.view.View.OnClickListener("AppClickListener", {
73+
onClick: function () {
74+
const result = benchmarkRunner.runBenchmark();
75+
setTimeout(() => {
76+
globalThis.gc();
77+
});
78+
textView.setText(result);
79+
},
80+
})
81+
);
6582
};
6683
MyActivity = __decorate(
6784
[JavaProxy("com.tns.NativeScriptActivity")],

0 commit comments

Comments
 (0)