Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,11 +74,16 @@ Set the following environment variables:
- `ANDROID_HOME` pointing to where you have installed the Android SDK
- `ANDROID_NDK_HOME` pointing to the version of the Android NDK needed for this version of NativeScript

Run the following command to build the runtime:
Run the following commands to build the runtime:

```
npm run setup
```

```
npm run build
```

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.

- 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
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@
"scripts": {
"changelog": "conventional-changelog -p angular -i CHANGELOG.md -s",
"version": "npm run changelog && git add CHANGELOG.md",
"build": "node ./scripts/build.js"
"build": "node ./scripts/build.js",
"setup": "cd test-app/build-tools/jsparser && npm install && cd ../../../"
},
"devDependencies": {
"conventional-changelog-cli": "^2.1.1",
Expand Down
1 change: 1 addition & 0 deletions test-app/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
android:name="com.tns.ErrorReportActivity"
android:label="ErrorActivity">
</activity>
<profileable android:shell="true"/>
</application>

</manifest>
19 changes: 18 additions & 1 deletion test-app/app/src/main/assets/app/MyActivity.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
}
}
*/
const benchmarkRunner = require("./benchmark.js");
var MyActivity = (function (_super) {
__extends(MyActivity, _super);
function MyActivity() {
Expand All @@ -30,18 +31,23 @@ var MyActivity = (function (_super) {
_super.prototype.onCreate.call(this, bundle);
require('./tests/testsWithContext').run(this);
//run jasmine
execute();
// execute();
var layout = new android.widget.LinearLayout(this);
layout.setOrientation(1);
this.setContentView(layout);
var textView = new android.widget.TextView(this);
textView.setText("It's a button!");
textView.setTextIsSelectable(true);
layout.addView(textView);

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

var button2 = new android.widget.Button(this);
button2.setText("Run Benchmark");
layout.addView(button2);

var Color = android.graphics.Color;
var colors = [
Color.BLUE,
Expand All @@ -62,6 +68,17 @@ var MyActivity = (function (_super) {
},
})
);
button2.setOnClickListener(
new android.view.View.OnClickListener("AppClickListener", {
onClick: function () {
const result = benchmarkRunner.runBenchmark();
setTimeout(() => {
globalThis.gc();
});
textView.setText(result);
},
})
);
};
MyActivity = __decorate(
[JavaProxy("com.tns.NativeScriptActivity")],
Expand Down
Loading