Skip to content

Commit 509b32b

Browse files
committed
enhance build
1 parent ef5fc61 commit 509b32b

13 files changed

Lines changed: 327 additions & 229 deletions

.travis.yml

Lines changed: 5 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ android:
33
- tools
44
- platform-tools
55
- build-tools-25.0.2
6-
- android-23
76
- android-25
87
- extra-android-m2repository
98

@@ -30,14 +29,7 @@ matrix:
3029
language: node_js
3130
os: linux
3231
node_js: "6"
33-
script:
34-
- cd bin/dist && cat README.md | grep -q "# Installation" && cd ../..
35-
- cd bin/dist && cat README.md | grep -q "# Configuration" && cd ../..
36-
- cd bin/dist && cat README.md | grep -q "# API" && cd ../..
37-
- cd bin/dist && cat README.md | grep -q "# Usage" && cd ../..
38-
- cd bin/dist && cat package.json | grep -q "\"license\"" && cd ../..
39-
- cd bin/dist && cat package.json | grep -q "\"nativescript\"" && cd ../..
40-
- grunt exec:tslint
32+
script: grunt lint
4133

4234
- stage: build
4335
language: android
@@ -46,9 +38,7 @@ matrix:
4638
- Android="25"
4739
jdk: oraclejdk8
4840
before_install: nvm install 6.10.3
49-
script:
50-
- cd demo && npm install && tns build android && cd ..
51-
- cd demo-ng && npm install && tns build android && cd ..
41+
script: "grunt ci:build:android"
5242

5343
- stage: build
5444
os: osx
@@ -59,9 +49,7 @@ matrix:
5949
language: node_js
6050
node_js: "6"
6151
jdk: oraclejdk8
62-
script:
63-
- cd demo && npm install && tns build ios && cd ..
64-
- cd demo-ng && npm install && tns build ios && cd ..
52+
script: "grunt ci:build:ios"
6553

6654
- stage: webpack
6755
language: android
@@ -71,9 +59,7 @@ matrix:
7159
- Platform="Android"
7260
jdk: oraclejdk8
7361
before_install: nvm install 6.10.3
74-
script:
75-
- cd demo && npm install && npm run ns-bundle --android --build-app --uglify && cd ..
76-
- cd demo-ng && npm install && npm run ns-bundle --android --build-app --uglify && cd ..
62+
script: "grunt ci:webpack:android"
7763

7864
- stage: webpack
7965
os: osx
@@ -85,9 +71,7 @@ matrix:
8571
language: node_js
8672
node_js: "6"
8773
jdk: oraclejdk8
88-
script:
89-
- cd demo && npm install && npm run ns-bundle --ios --build-app --uglify && cd ..
90-
- cd demo-ng && npm install && npm run ns-bundle --ios --build-app --uglify && cd ..
74+
script: "grunt ci:webpack:ios"
9175

9276
- stage: deploy
9377
if: branch = release

README.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -285,6 +285,20 @@ module.exports = function (platform, destinationApp) {
285285
//......
286286
}
287287
```
288+
289+
## Demos
290+
This repository includes both Angular and plain NativeScript demos. In order to run those execute the following in your shell:
291+
```shell
292+
$ git clone https://github.com/peterstaev/nativescript-drop-down
293+
$ cd nativescript-drop-down
294+
$ npm install
295+
$ npm run demo-ios
296+
```
297+
This will run the plain NativeScript demo project on iOS. If you want to run it on Android simply use the `-android` instead of the `-ios` sufix.
298+
299+
If you want to run the Angular demo simply use the `demo-ng-` prefix instead of `demo-`.
300+
301+
288302
## Donate
289303
`bitcoin:14fjysmpwLvSsAskvLASw6ek5XfhTzskHC`
290304

demo/app/package.json

Lines changed: 6 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,8 @@
11
{
2-
"name": "tns-template-hello-world-ts",
2+
"android": {
3+
"v8Flags": "--expose_gc"
4+
},
35
"main": "app.js",
4-
"version": "1.2.0",
5-
"author": "Telerik <support@telerik.com>",
6-
"description": "Nativescript hello-world-ts project template",
7-
"license": "BSD",
8-
"keywords": [
9-
"telerik",
10-
"mobile",
11-
"nativescript",
12-
"{N}",
13-
"tns",
14-
"appbuilder",
15-
"template"
16-
],
17-
"repository": {
18-
"url": "https://github.com/NativeScript/NativeScript/commit/06ddbf133a1c022a9ec61dc442d7f7ce0841c915"
19-
}
20-
}
6+
"name": "tns-template-hello-world-ts",
7+
"version": "3.2.0"
8+
}
Lines changed: 8 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,10 @@
1-
// Resolve JavaScript classes that extend a Java class, and need to resolve
2-
// their JavaScript module from a bundled script. For example:
3-
// NativeScriptApplication, NativeScriptActivity, etc.
4-
//
5-
// This module gets bundled together with the rest of the app code and the
6-
// `require` calls get resolved to the correct bundling import call.
7-
//
8-
// At runtime the module gets loaded *before* the rest of the app code, so code
9-
// placed here needs to be careful about its dependencies.
10-
1+
// tslint:disable
112
require("application");
12-
require("ui/frame");
13-
require("ui/frame/activity");
14-
15-
if (global.TNS_WEBPACK) {
16-
global.__requireOverride = function (name, dir) {
17-
if (name === "./tns_modules/application/application.js") {
18-
return require("application");
19-
} else if (name === "./tns_modules/ui/frame/frame.js") {
20-
return require("ui/frame");
21-
} else if (name === "./tns_modules/ui/frame/activity.js") {
22-
return require("ui/frame/activity");
23-
}
24-
};
3+
if (!global["__snapshot"]) {
4+
// In case snapshot generation is enabled these modules will get into the bundle
5+
// but will not be required/evaluated.
6+
// The snapshot webpack plugin will add them to the tns-java-classes.js bundle file.
7+
// This way, they will be evaluated on app start as early as possible.
8+
require("ui/frame");
9+
require("ui/frame/activity");
2510
}

demo/app/vendor.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
// tslint:disable
12
require("./vendor-platform");
23

34
require("bundle-entry-points");

demo/package.json

Lines changed: 25 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,44 +1,47 @@
11
{
22
"nativescript": {
33
"id": "com.tangrainc.dropdownsample",
4-
"tns-android": {
5-
"version": "3.0.0"
6-
},
74
"tns-ios": {
8-
"version": "3.0.1"
5+
"version": "3.2.0"
6+
},
7+
"tns-android": {
8+
"version": "3.2.0"
99
}
1010
},
1111
"scripts": {
1212
"android": "npm uninstall nativescript-drop-down && tns platform remove android && tns platform add android@rc && tns run android",
1313
"ios": "npm uninstall nativescript-drop-down && tns run ios --emulator",
1414
"debug-ios": "npm uninstall nativescript-drop-down && tns debug ios --emulator",
1515
"ns-bundle": "ns-bundle",
16-
"start-android-bundle": "npm run ns-bundle --android --start-app",
17-
"start-ios-bundle": "npm run ns-bundle --ios --start-app",
16+
"publish-ios-bundle": "npm run ns-bundle --ios --publish-app",
17+
"generate-android-snapshot": "generate-android-snapshot --targetArchs arm,arm64,ia32 --install",
18+
"start-android-bundle": "npm run ns-bundle --android --run-app",
19+
"start-ios-bundle": "npm run ns-bundle --ios --run-app",
1820
"build-android-bundle": "npm run ns-bundle --android --build-app",
1921
"build-ios-bundle": "npm run ns-bundle --ios --build-app"
2022
},
2123
"dependencies": {
2224
"nativescript-drop-down": "file:../bin/dist",
23-
"tns-core-modules": "3.0.1"
25+
"tns-core-modules": "3.2.0"
2426
},
2527
"devDependencies": {
26-
"awesome-typescript-loader": "~3.0.0-beta.9",
27-
"babel-traverse": "6.10.4",
28-
"babel-types": "6.11.1",
29-
"babylon": "6.8.2",
30-
"copy-webpack-plugin": "~3.0.1",
31-
"extract-text-webpack-plugin": "~2.0.0-beta.4",
32-
"filewalker": "0.1.3",
28+
"awesome-typescript-loader": "~3.1.3",
29+
"babel-traverse": "6.26.0",
30+
"babel-types": "6.26.0",
31+
"babylon": "6.18.0",
32+
"copy-webpack-plugin": "~4.0.1",
33+
"extract-text-webpack-plugin": "~3.0.0",
3334
"lazy": "1.0.11",
3435
"nativescript-css-loader": "~0.26.0",
35-
"nativescript-dev-typescript": "^0.4.0",
36-
"nativescript-dev-webpack": "^0.3.7",
36+
"nativescript-dev-typescript": "~0.5.0",
37+
"nativescript-dev-webpack": "^0.8.0",
38+
"nativescript-worker-loader": "~0.8.1",
3739
"raw-loader": "~0.5.1",
38-
"resolve-url-loader": "~1.6.0",
39-
"tns-platform-declarations": "3.0.1",
40-
"typescript": "~2.2.2",
41-
"webpack": "2.2.0",
42-
"webpack-sources": "~0.1.3"
40+
"resolve-url-loader": "~2.1.0",
41+
"tns-platform-declarations": "^3.2.0",
42+
"typescript": "~2.2.1",
43+
"webpack": "~3.2.0",
44+
"webpack-bundle-analyzer": "^2.8.2",
45+
"webpack-sources": "~1.0.1"
4346
}
44-
}
47+
}

demo/webpack.android.js

Lines changed: 0 additions & 2 deletions
This file was deleted.

demo/webpack.common.js

Lines changed: 0 additions & 139 deletions
This file was deleted.

0 commit comments

Comments
 (0)