Skip to content
This repository has been archived by the owner on Feb 10, 2023. It is now read-only.

Commit

Permalink
feat(demo-app): Adding demo app for E2E
Browse files Browse the repository at this point in the history
Provide simple app which uses the app to verify integration (see #11)
  • Loading branch information
hypery2k committed Mar 20, 2017
1 parent d810a40 commit 841c991
Show file tree
Hide file tree
Showing 86 changed files with 943 additions and 70 deletions.
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -68,3 +68,8 @@ src/platforms
src/hooks
src/node_modules
target/

# sample app
sampleApp/hooks/
sampleApp/node_modules/
sampleApp/platforms/
7 changes: 5 additions & 2 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
.idea
.vscode
.idea/
.vscode/
.babelrc
build.xcconfig
app/
demo/
hooks/
node_modules
*.yml
Jenkinsfile
*.gif
*.jpg
*.png
Expand All @@ -14,3 +16,4 @@ node_modules
!*.d.ts
spec/
target/
sampleApp/
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ script:
- export PATH=$PATH:/usr/local/opt/android-sdk/tools:/usr/local/opt/android-sdk/platform-tools
- npm run build
- npm run test
- npm run e2e
before_install:
- export ANDROID_HOME=/usr/local/opt/android-sdk
- export PATH=$PATH:/usr/local/opt/android-sdk/tools:/usr/local/opt/android-sdk/platform-tools
Expand Down
4 changes: 4 additions & 0 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,10 @@ node('nativescript') {
junit 'target/junit-report/junitresults-*.xml'
}

stage('End2End Test') {
sh "npm run e2e"
}

stage('Publish NPM snapshot') {
def currentVersion = sh(returnStdout: true, script: "npm version | grep \"{\" | tr -s ':' | cut -d \"'\" -f 4").trim()
def newVersion = "${currentVersion}-${branchName}-${buildNumber}"
Expand Down
140 changes: 72 additions & 68 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,69 +1,73 @@
{
"name": "nativescript-urlhandler",
"version": "0.2.0",
"description": "Register custom URLs for your NativeScript app",
"scripts": {
"preclean": "npm i rimraf",
"clean": "rimraf node_modules lib hooks platforms target '*.js' '*.js.map' 'app/**/*.js' 'app/**/*.js.map' && npm i",
"postclean": "npm i",
"prebuild": "npm run tslint",
"build": "npm run tsc",
"tsc": "tsc",
"tslint": "tslint \"*.ts\"",
"test": "npm run tslint && npm run jasmine",
"jasmine": "babel-node spec/run.js",
"changelog": "conventional-changelog -p angular -i CHANGELOG.md -s -r 0",
"changelog:add": "git add CHANGELOG.md && git commit -m 'updated CHANGELOG.md'",
"release:pre": "npm run clean && npm run build && npm run test",
"release:post": "npm run changelog && npm run changelog:add",
"release:major": "npm run release:pre && npm version major && npm run release:post && git push origin && git push origin --tags && npm publish",
"release:minor": "npm run release:pre && npm version minor && npm run release:post && git push origin && git push origin --tags && npm publish",
"release:patch": "npm run release:pre && npm version patch && npm run release:post && git push origin && git push origin --tags && npm publish"
},
"main": "urlhandler",
"typings": "urlhandler.d.ts",
"nativescript": {
"platforms": {
"android": "2.3.0",
"ios": "2.3.0"
}
},
"dependencies": {},
"peerDependencies": {
"tns-core-modules": "^2.3.1"
},
"devDependencies": {
"@types/jasmine": "2.5.46",
"babel-cli": "6.24.0",
"babel-core": "6.24.0",
"babel-preset-es2015": "6.24.0",
"babel-traverse": "6.18.0",
"babel-types": "6.18.0",
"conventional-changelog-cli": "1.3.1",
"jasmine": "2.5.3",
"jasmine-core": "2.5.2",
"jasmine-reporters": "2.2.1",
"mockery": "2.0.0",
"nativescript-dev-typescript": "0.3.7",
"rimraf": "2.6.1",
"tns-core-modules": "2.5.1",
"tns-platform-declarations": "2.5.0",
"tslint": "4.5.1",
"tslint-eslint-rules": "3.5.0",
"typescript": "2.2.1"
},
"repository": {
"type": "git",
"url": "git+https://github.com/hypery2k/nativescript-urlhandler.git"
},
"keywords": [
"NativeScript",
"URL-Handler"
],
"author": "Martin Reinhardt",
"license": "MIT",
"bugs": {
"url": "https://github.com/hypery2k/nativescript-urlhandler/issues"
},
"homepage": "https://github.com/hypery2k/nativescript-urlhandler"
}
"name": "nativescript-urlhandler",
"version": "0.2.0",
"description": "Register custom URLs for your NativeScript app",
"scripts": {
"preclean": "npm i rimraf",
"clean": "rimraf node_modules hooks platforms target '*.js' '*.js.map' 'sampleApp/**/*.js' 'sampleApp/**/*.js.map' sampleApp/platforms sampleApp/node_modules sampleApp/hooks",
"postclean": "npm i && cd sampleApp && npm i",
"prebuild": "npm run tslint",
"build": "npm run tsc",
"tsc": "tsc",
"tslint": "tslint \"*.ts\"",
"test": "npm run tslint && npm run jasmine",
"e2e": "npm run preparedemo && cd sampleApp && tns build ios && tns build android",
"jasmine": "babel-node spec/run.js",
"demo.ios": "npm run preparedemo && cd sampleApp && tns run ios --emulator",
"demo.android": "npm run preparedemo && cd sampleApp && tns run android --emulator",
"preparedemo": "npm run build && cd sampleApp && tns plugin remove nativescript-urlhandler && tns plugin add .. && tns install",
"changelog": "conventional-changelog -p angular -i CHANGELOG.md -s -r 0",
"changelog:add": "git add CHANGELOG.md && git commit -m 'updated CHANGELOG.md'",
"release:pre": "npm run clean && npm run build && npm run test",
"release:post": "npm run changelog && npm run changelog:add",
"release:major": "npm run release:pre && npm version major && npm run release:post && git push origin && git push origin --tags && npm publish",
"release:minor": "npm run release:pre && npm version minor && npm run release:post && git push origin && git push origin --tags && npm publish",
"release:patch": "npm run release:pre && npm version patch && npm run release:post && git push origin && git push origin --tags && npm publish"
},
"main": "urlhandler",
"typings": "urlhandler.d.ts",
"nativescript": {
"platforms": {
"android": "2.3.0",
"ios": "2.3.0"
}
},
"dependencies": {},
"peerDependencies": {
"tns-core-modules": "^2.3.1"
},
"devDependencies": {
"@types/jasmine": "2.5.46",
"babel-cli": "6.24.0",
"babel-core": "6.24.0",
"babel-preset-es2015": "6.24.0",
"babel-traverse": "6.18.0",
"babel-types": "6.18.0",
"conventional-changelog-cli": "1.3.1",
"jasmine": "2.5.3",
"jasmine-core": "2.5.2",
"jasmine-reporters": "2.2.1",
"mockery": "2.0.0",
"nativescript-dev-typescript": "0.3.7",
"rimraf": "2.6.1",
"tns-core-modules": "2.5.1",
"tns-platform-declarations": "2.5.0",
"tslint": "4.5.1",
"tslint-eslint-rules": "3.5.0",
"typescript": "2.2.1"
},
"repository": {
"type": "git",
"url": "git+https://github.com/hypery2k/nativescript-urlhandler.git"
},
"keywords": [
"NativeScript",
"URL-Handler"
],
"author": "Martin Reinhardt",
"license": "MIT",
"bugs": {
"url": "https://github.com/hypery2k/nativescript-urlhandler/issues"
},
"homepage": "https://github.com/hypery2k/nativescript-urlhandler"
}
49 changes: 49 additions & 0 deletions sampleApp/app/App_Resources/Android/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="__PACKAGE__"
android:versionCode="1"
android:versionName="1.0">

<supports-screens
android:smallScreens="true"
android:normalScreens="true"
android:largeScreens="true"
android:xlargeScreens="true"/>

<uses-sdk
android:minSdkVersion="17"
android:targetSdkVersion="__APILEVEL__"/>

<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.INTERNET"/>

<application
android:name="com.tns.NativeScriptApplication"
android:allowBackup="true"
android:icon="@drawable/icon"
android:label="@string/app_name"
android:theme="@style/AppTheme">

<activity
android:name="com.tns.NativeScriptActivity"
android:label="@string/title_activity_kimera"
android:configChanges="keyboardHidden|orientation|screenSize"
android:theme="@style/LaunchScreenTheme">

<meta-data android:name="SET_THEME_ON_LAUNCH" android:resource="@style/AppTheme" />

<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
<intent-filter>
<data android:scheme="sampleApp"/>
<action android:name="android.intent.action.VIEW"/>
<category android:name="android.intent.category.DEFAULT"/>
<category android:name="android.intent.category.BROWSABLE"/>
</intent-filter>
</activity>
<activity android:name="com.tns.ErrorReportActivity"/>
</application>
</manifest>
16 changes: 16 additions & 0 deletions sampleApp/app/App_Resources/Android/app.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
// Add your native dependencies here:

// Uncomment to add recyclerview-v7 dependency
//dependencies {
// compile 'com.android.support:recyclerview-v7:+'
//}

android {
defaultConfig {
generatedDensities = []
applicationId = "__PACKAGE__"
}
aaptOptions {
additionalParameters "--no-version-vectors"
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<layer-list xmlns:android="http://schemas.android.com/apk/res/android" android:gravity="fill">
<item>
<bitmap android:gravity="fill" android:src="@drawable/background" />
</item>
<item>
<bitmap android:gravity="center" android:src="@drawable/logo" />
</item>
</layer-list>
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions sampleApp/app/App_Resources/Android/values-v21/colors.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="ns_accent">#3d5afe</color>
</resources>
23 changes: 23 additions & 0 deletions sampleApp/app/App_Resources/Android/values-v21/styles.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>

<!-- Application theme -->
<style name="AppTheme" parent="AppThemeBase">
<item name="android:datePickerStyle">@style/SpinnerDatePicker</item>
<item name="android:timePickerStyle">@style/SpinnerTimePicker</item>
</style>

<!-- Default style for DatePicker - in spinner mode -->
<style name="SpinnerDatePicker" parent="android:Widget.Material.Light.DatePicker">
<item name="android:datePickerMode">spinner</item>
</style>

<!-- Default style for TimePicker - in spinner mode -->
<style name="SpinnerTimePicker" parent="android:Widget.Material.Light.TimePicker">
<item name="android:timePickerMode">spinner</item>
</style>

<style name="NativeScriptToolbarStyle" parent="NativeScriptToolbarStyleBase">
<item name="android:elevation">4dp</item>
</style>
</resources>
7 changes: 7 additions & 0 deletions sampleApp/app/App_Resources/Android/values/colors.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="ns_primary">#F5F5F5</color>
<color name="ns_primaryDark">#757575</color>
<color name="ns_accent">#33B5E5</color>
<color name="ns_blue">#272734</color>
</resources>
45 changes: 45 additions & 0 deletions sampleApp/app/App_Resources/Android/values/styles.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
<?xml version="1.0" encoding="utf-8"?>
<resources xmlns:android="http://schemas.android.com/apk/res/android">

<!-- theme to use FOR launch screen-->
<style name="LaunchScreenThemeBase" parent="Theme.AppCompat.Light.NoActionBar">
<item name="toolbarStyle">@style/NativeScriptToolbarStyle</item>

<item name="colorPrimary">@color/ns_primary</item>
<item name="colorPrimaryDark">@color/ns_primaryDark</item>
<item name="colorAccent">@color/ns_accent</item>

<item name="android:windowBackground">@drawable/splash_screen</item>

<item name="android:windowActionBarOverlay">true</item>
<item name="android:windowTranslucentStatus">true</item>

</style>

<style name="LaunchScreenTheme" parent="LaunchScreenThemeBase">
</style>

<!-- theme to use AFTER launch screen is loaded-->
<style name="AppThemeBase" parent="Theme.AppCompat.Light.NoActionBar">
<item name="toolbarStyle">@style/NativeScriptToolbarStyle</item>

<item name="colorPrimary">@color/ns_primary</item>
<item name="colorPrimaryDark">@color/ns_primaryDark</item>
<item name="colorAccent">@color/ns_accent</item>

</style>

<style name="AppTheme" parent="AppThemeBase">
</style>

<!-- theme for actioon-bar -->
<style name="NativeScriptToolbarStyleBase" parent="Widget.AppCompat.Toolbar">
<item name="android:background">@color/ns_primary</item>
<item name="theme">@style/ThemeOverlay.AppCompat.ActionBar</item>
<item name="popupTheme">@style/ThemeOverlay.AppCompat</item>

</style>

<style name="NativeScriptToolbarStyle" parent="NativeScriptToolbarStyleBase">
</style>
</resources>
Loading

0 comments on commit 841c991

Please sign in to comment.