Skip to content

Commit f83c581

Browse files
authored
Merge pull request #21 from GeoTecINIT/ns7
NS7 Support
2 parents c861427 + 6993d34 commit f83c581

33 files changed

+3540
-3185
lines changed

README.md

+8-1
Original file line numberDiff line numberDiff line change
@@ -49,12 +49,19 @@ Plugin supports devices running Android 4.4 KitKat (SDK 19) to Android 10 Q (SDK
4949

5050
## Installation
5151

52-
Run the following command in your project's root folder:
52+
Run the following command in your project's root folder.
5353

54+
NS7+:
5455
```javascript
5556
tns plugin add nativescript-task-dispatcher
5657
```
5758

59+
NS6:
60+
```javascript
61+
tns plugin add nativescript-task-dispatcher@1.1.4
62+
```
63+
64+
5865
### Android-specific steps
5966

6067
#### Running tasks in foreground

azure-pipelines.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ trigger:
77
- v*
88
pr:
99
- master
10-
10+
1111

1212
pool:
1313
vmImage: 'macos-latest'
@@ -19,7 +19,7 @@ steps:
1919
displayName: 'Install Node.js'
2020

2121
- script: |
22-
echo no | npm install -g nativescript@6.8.0
22+
echo no | npm install -g nativescript@7
2323
tns usage-reporting disable
2424
tns error-reporting disable
2525
displayName: 'Install NativeScript CLI'

demo/app/app.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
import * as app from "tns-core-modules/application";
1+
import { Application } from "@nativescript/core";
22
import { taskDispatcher } from "nativescript-task-dispatcher";
33
import { appTasks } from "./tasks";
44
import { demoTaskGraph } from "./tasks/graph";
55

66
taskDispatcher.init(appTasks, demoTaskGraph, { enableLogging: true });
77

8-
app.run({ moduleName: "app-root" });
8+
Application.run({ moduleName: "app-root" });
99

1010
/*
1111
Do not place any code after the application has been started as it will not

demo/app/home/home-page.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ a code-behind file. The code-behind is a great place to place your view
66
logic, and to set up your page’s data binding.
77
*/
88

9-
import { NavigatedData, Page } from "tns-core-modules/ui/page";
9+
import { NavigatedData, Page } from "@nativescript/core";
1010

1111
import { HomeViewModel } from "./home-view-model";
1212
export function onNavigatingTo(args: NavigatedData) {

demo/app/home/home-view-model.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Observable } from "tns-core-modules/data/observable";
1+
import { Observable } from "@nativescript/core";
22

33
export class HomeViewModel extends Observable {
44
constructor() {

demo/app/package.json

-7
This file was deleted.

demo/app/tests/internal/tasks/schedulers/event-driven/native-chain-launcher.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { android as androidApp } from "tns-core-modules/application/application";
1+
import { isAndroid } from "@nativescript/core";
22

33
import { setTasks } from "nativescript-task-dispatcher/internal/tasks/provider";
44
import { testTasks } from "../..";
@@ -26,13 +26,13 @@ describe("Native task chain launcher", () => {
2626
let taskScheduler: TaskScheduler;
2727

2828
beforeAll(() => {
29-
if (androidApp) {
29+
if (isAndroid) {
3030
wireUpTaskChainRunnerService();
3131
}
3232
});
3333

3434
beforeEach(() => {
35-
if (androidApp) {
35+
if (isAndroid) {
3636
taskChainLauncher = new AndroidTaskChainLauncher();
3737
taskScheduler = new AndroidTaskScheduler();
3838
} else {

demo/app/tests/internal/tasks/schedulers/time-based/index.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { android as androidApp } from "tns-core-modules/application/application";
1+
import { isAndroid } from "@nativescript/core";
22

33
import {
44
TaskNotFoundError,
@@ -15,7 +15,7 @@ describe("Task scheduler", () => {
1515
let scheduler: TaskScheduler;
1616

1717
beforeEach(() => {
18-
if (androidApp) {
18+
if (isAndroid) {
1919
scheduler = new AndroidTaskScheduler();
2020
} else {
2121
// TODO: Set iOS scheduler here

demo/nativescript.config.ts

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import { NativeScriptConfig } from '@nativescript/core'
2+
3+
export default {
4+
id: 'org.nativescript.demo',
5+
appPath: 'app',
6+
appResourcesPath: 'app/App_Resources',
7+
android: {
8+
v8Flags: '--expose_gc',
9+
markingMode: 'none',
10+
},
11+
} as NativeScriptConfig

0 commit comments

Comments
 (0)