├── .asf.yaml ├── .eslintignore ├── .eslintrc.yml ├── .gitattributes ├── .github ├── ISSUE_TEMPLATE.md ├── ISSUE_TEMPLATE │ ├── BUG_REPORT.md │ ├── FEATURE_REQUEST.md │ └── SUPPORT_QUESTION.md ├── PULL_REQUEST_TEMPLATE.md └── workflows │ └── ci.yml ├── .gitignore ├── .ratignore ├── .travis.yml ├── CONTRIBUTING.md ├── LICENSE ├── NOTICE ├── README.md ├── RELEASENOTES.md ├── VERSION ├── appveyor.yml ├── bin ├── check_all ├── check_all.bat ├── check_reqs ├── check_reqs.bat ├── create ├── create.bat ├── lib │ ├── check_reqs.js │ ├── create.js │ └── update.js ├── update └── update.bat ├── cordova-js-src ├── confighelper.js ├── exec.js ├── platform.js └── splashscreen.js ├── cordova-windows10.md ├── package-lock.json ├── package.json ├── spec ├── e2e │ └── endtoend.spec.js ├── support │ └── jasmine.json └── unit │ ├── AppxManifest.spec.js │ ├── ConfigChanges.spec.js │ ├── JsprojManager.spec.js │ ├── MRTImage.spec.js │ ├── MSBuildTools.spec.js │ ├── Prepare.Win10.spec.js │ ├── Version.spec.js │ ├── WindowsConfigParser.spec.js │ ├── build.spec.js │ ├── check_reqs.spec.js │ ├── clean.spec.js │ ├── deployment.spec.js │ ├── fixtures │ ├── DummyProject │ │ ├── AppPackages │ │ │ ├── CordovaApp.Phone_0.0.1.0_debug_Test │ │ │ │ └── CordovaApp.Phone_0.0.1.0_AnyCPU_debug.appxbundle │ │ │ └── CordovaApp.Windows_0.0.1.0_anycpu_debug_Test │ │ │ │ └── CordovaApp.Windows_0.0.1.0_anycpu_debug.appx │ │ ├── CordovaApp.Phone.jsproj │ │ ├── CordovaApp.Windows.jsproj │ │ ├── CordovaApp.Windows10.jsproj │ │ ├── CordovaApp.Windows80.jsproj │ │ ├── CordovaApp.projitems │ │ ├── CordovaApp.shproj │ │ ├── CordovaApp.sln │ │ ├── CordovaApp.vs2012.sln │ │ ├── CordovaApp_TemporaryKey.pfx │ │ ├── VERSION │ │ ├── config.xml │ │ ├── images │ │ │ └── SplashScreen.scale-100.png │ │ ├── package.phone.appxmanifest │ │ ├── package.windows.appxmanifest │ │ └── package.windows80.appxmanifest │ ├── fakeBuildConfig.json │ ├── org.test.configtest │ │ └── plugin.xml │ ├── org.test.plugins.capabilityplugin │ │ ├── plugin.xml │ │ └── www │ │ │ └── org.test.plugins.capabilityplugin.js │ ├── org.test.plugins.dummyplugin │ │ ├── plugin.xml │ │ ├── src │ │ │ └── windows │ │ │ │ ├── dummer.js │ │ │ │ ├── dummy1.dll │ │ │ │ ├── dummy1.vcxproj │ │ │ │ ├── dummy2.dll │ │ │ │ ├── dummy2.vcxproj │ │ │ │ ├── dummy3.dll │ │ │ │ ├── dummy3.vcxproj │ │ │ │ ├── dummy4.dll │ │ │ │ ├── dummy4.vcxproj │ │ │ │ ├── dummy5.dll │ │ │ │ ├── dummy6.dll │ │ │ │ ├── text_sample1.txt │ │ │ │ ├── text_sample2.txt │ │ │ │ ├── text_sample3.txt │ │ │ │ └── text_sample4.txt │ │ └── www │ │ │ ├── dummyplugin.js │ │ │ └── dummyplugin │ │ │ └── image.jpg │ ├── org.test.plugins.extensionsplugin │ │ ├── plugin.xml │ │ └── src │ │ │ └── windows │ │ │ └── Foo.dll │ ├── org.test.plugins.faultyplugin │ │ ├── plugin.xml │ │ └── src │ │ │ └── windows │ │ │ ├── faultyPlugin.js │ │ │ ├── text_sample1.txt │ │ │ ├── text_sample2.txt │ │ │ └── text_sample3.txt │ ├── org.test.plugins.resourcereferenceplugin │ │ ├── plugin.xml │ │ └── src │ │ │ └── windows │ │ │ ├── dummy1.json │ │ │ ├── dummy2.json │ │ │ ├── dummy3.json │ │ │ └── dummy4.json │ └── testProj │ │ ├── platforms │ │ └── windows │ │ │ ├── AppPackages │ │ │ ├── CordovaApp.Phone_0.0.1.0_debug_Test │ │ │ │ └── CordovaApp.Phone_0.0.1.0_AnyCPU_debug.appxbundle │ │ │ └── CordovaApp.Windows_0.0.1.0_anycpu_debug_Test │ │ │ │ └── CordovaApp.Windows_0.0.1.0_anycpu_debug.appx │ │ │ ├── CordovaApp.Phone.jsproj │ │ │ ├── CordovaApp.Windows.jsproj │ │ │ ├── CordovaApp.Windows10.jsproj │ │ │ ├── CordovaApp.Windows80.jsproj │ │ │ ├── CordovaApp.projitems │ │ │ ├── CordovaApp.shproj │ │ │ ├── CordovaApp.sln │ │ │ ├── CordovaApp.vs2012.sln │ │ │ ├── CordovaApp_TemporaryKey.pfx │ │ │ ├── VERSION │ │ │ ├── config.xml │ │ │ ├── package.phone.appxmanifest │ │ │ ├── package.windows.appxmanifest │ │ │ ├── package.windows10.appxmanifest │ │ │ └── package.windows80.appxmanifest │ │ └── plugins │ │ ├── org.test.plugins.dummyplugin │ │ ├── plugin.xml │ │ ├── src │ │ │ └── windows │ │ │ │ ├── dummer.js │ │ │ │ ├── dummy1.dll │ │ │ │ ├── dummy1.vcxproj │ │ │ │ ├── dummy2.dll │ │ │ │ ├── dummy2.vcxproj │ │ │ │ ├── dummy3.dll │ │ │ │ ├── dummy3.vcxproj │ │ │ │ ├── dummy4.dll │ │ │ │ ├── dummy4.vcxproj │ │ │ │ ├── dummy5.dll │ │ │ │ ├── dummy6.dll │ │ │ │ ├── text_sample1.txt │ │ │ │ ├── text_sample2.txt │ │ │ │ ├── text_sample3.txt │ │ │ │ └── text_sample4.txt │ │ └── www │ │ │ ├── dummyplugin.js │ │ │ └── dummyplugin │ │ │ └── image.jpg │ │ └── testPlugin │ │ ├── plugin.xml │ │ └── src │ │ └── deps │ │ ├── ARM │ │ ├── arm.dll │ │ └── arm.winmd │ │ ├── x64 │ │ ├── x64.UWP.dll │ │ └── x64.winmd │ │ └── x86 │ │ ├── x86.dll │ │ └── x86.winmd │ ├── package.spec.js │ ├── pluginHandler │ ├── common.spec.js │ └── windows.spec.js │ └── run.spec.js └── template ├── CordovaApp.Phone.jsproj ├── CordovaApp.Windows.jsproj ├── CordovaApp.Windows10.jsproj ├── CordovaApp.projitems ├── CordovaApp.shproj ├── CordovaApp.sln ├── CordovaApp.vs2013.sln ├── CordovaApp_TemporaryKey.pfx ├── Properties └── Default.rd.xml ├── config.xml ├── cordova ├── Api.js ├── build ├── build.bat ├── clean ├── clean.bat ├── defaults.xml ├── lib │ ├── AppxManifest.js │ ├── ConfigChanges.js │ ├── ConfigParser.js │ ├── JsprojManager.js │ ├── MRTImage.js │ ├── MSBuildTools.js │ ├── PluginHandler.js │ ├── PluginInfo.js │ ├── Version.js │ ├── WindowsStoreAppUtils.ps1 │ ├── build.js │ ├── clean.js │ ├── deployment.js │ ├── list-devices.bat │ ├── list-emulator-images.bat │ ├── list-started-emulators.bat │ ├── log.js │ ├── loggingHelper.js │ ├── package.js │ ├── prepare.js │ ├── run.js │ ├── target-list.js │ └── utils.js ├── log ├── log.bat ├── prebuild-10.js ├── prebuild-81.js ├── prebuild-phone-81.js ├── prebuild.js ├── prepare ├── prepare.bat ├── run ├── run.bat ├── version └── version.bat ├── images ├── SplashScreen.scale-100.png ├── SplashScreenPhone.scale-240.png ├── Square150x150Logo.scale-100.png ├── Square150x150Logo.scale-240.png ├── Square30x30Logo.scale-100.png ├── Square310x310Logo.scale-100.png ├── Square44x44Logo.scale-100.png ├── Square44x44Logo.scale-240.png ├── Square70x70Logo.scale-100.png ├── Square71x71Logo.scale-100.png ├── Square71x71Logo.scale-240.png ├── StoreLogo.scale-100.png ├── StoreLogo.scale-240.png ├── Wide310x150Logo.scale-100.png └── Wide310x150Logo.scale-240.png ├── package.phone.appxmanifest ├── package.windows.appxmanifest ├── package.windows10.appxmanifest └── www ├── cordova.js ├── css ├── index.css └── splashscreen.css ├── img ├── logo.png ├── smalllogo.png ├── splashscreen.png └── storelogo.png ├── index.html └── js └── index.js /.asf.yaml: -------------------------------------------------------------------------------- 1 | # Licensed to the Apache Software Foundation (ASF) under one 2 | # or more contributor license agreements. See the NOTICE file 3 | # distributed with this work for additional information 4 | # regarding copyright ownership. The ASF licenses this file 5 | # to you under the Apache License, Version 2.0 (the 6 | # "License"); you may not use this file except in compliance 7 | # with the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, 12 | # software distributed under the License is distributed on an 13 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | # KIND, either express or implied. See the License for the 15 | # specific language governing permissions and limitations 16 | # under the License. 17 | 18 | notifications: 19 | commits: commits@cordova.apache.org 20 | issues: issues@cordova.apache.org 21 | pullrequests_status: issues@cordova.apache.org 22 | pullrequests_comment: issues@cordova.apache.org 23 | -------------------------------------------------------------------------------- /.eslintignore: -------------------------------------------------------------------------------- 1 | **/dummer.js 2 | **/faultyPlugin.js 3 | **/dummyplugin.js 4 | template/www/cordova.js -------------------------------------------------------------------------------- /.eslintrc.yml: -------------------------------------------------------------------------------- 1 | # Licensed to the Apache Software Foundation (ASF) under one 2 | # or more contributor license agreements. See the NOTICE file 3 | # distributed with this work for additional information 4 | # regarding copyright ownership. The ASF licenses this file 5 | # to you under the Apache License, Version 2.0 (the 6 | # "License"); you may not use this file except in compliance 7 | # with the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, 12 | # software distributed under the License is distributed on an 13 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | # KIND, either express or implied. See the License for the 15 | # specific language governing permissions and limitations 16 | # under the License. 17 | 18 | extends: '@cordova/eslint-config/node' 19 | 20 | # FIXME avoid rule exceptions 21 | rules: 22 | prefer-promise-reject-errors: off 23 | 24 | overrides: 25 | - files: [spec/**/*.js] 26 | extends: '@cordova/eslint-config/node-tests' 27 | 28 | # FIXME avoid rule exceptions 29 | rules: 30 | prefer-promise-reject-errors: off 31 | 32 | - files: [cordova-js-src/**/*.js] 33 | extends: '@cordova/eslint-config/browser' 34 | 35 | globals: 36 | cordova: readonly 37 | WinJS: readonly 38 | Windows: readonly 39 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | * text eol=lf 2 | 3 | # source code 4 | *.php text 5 | *.css text 6 | *.sass text 7 | *.scss text 8 | *.less text 9 | *.styl text 10 | *.js text 11 | *.coffee text 12 | *.json text 13 | *.htm text 14 | *.html text 15 | *.xml text 16 | *.svg text 17 | *.txt text 18 | *.ini text 19 | *.inc text 20 | *.pl text 21 | *.rb text 22 | *.py text 23 | *.scm text 24 | *.sql text 25 | *.sh text 26 | *.bat text 27 | 28 | # templates 29 | *.ejs text 30 | *.hbt text 31 | *.jade text 32 | *.haml text 33 | *.hbs text 34 | *.dot text 35 | *.tmpl text 36 | *.phtml text 37 | 38 | # server config 39 | .htaccess text 40 | 41 | # git config 42 | .gitattributes text 43 | .gitignore text 44 | .gitconfig text 45 | 46 | # code analysis config 47 | .jshintrc text 48 | .jscsrc text 49 | .jshintignore text 50 | .csslintrc text 51 | 52 | # misc config 53 | *.yaml text 54 | *.yml text 55 | .editorconfig text 56 | 57 | # build config 58 | *.npmignore text 59 | *.bowerrc text 60 | 61 | # Heroku 62 | Procfile text 63 | .slugignore text 64 | 65 | # Documentation 66 | *.md text 67 | LICENSE text 68 | AUTHORS text 69 | 70 | 71 | # 72 | ## These files are binary and should be left untouched 73 | # 74 | 75 | # (binary is a macro for -text -diff) 76 | *.png binary 77 | *.jpg binary 78 | *.jpeg binary 79 | *.gif binary 80 | *.ico binary 81 | *.mov binary 82 | *.mp4 binary 83 | *.mp3 binary 84 | *.flv binary 85 | *.fla binary 86 | *.swf binary 87 | *.gz binary 88 | *.zip binary 89 | *.7z binary 90 | *.ttf binary 91 | *.eot binary 92 | *.woff binary 93 | *.pyc binary 94 | *.pdf binary 95 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | 5 | 6 | ### Issue Type 7 | 8 | 9 | - [ ] Bug Report 10 | - [ ] Feature Request 11 | - [ ] Support Question 12 | 13 | ## Description 14 | 15 | ## Information 16 | 17 | 18 | ### Command or Code 19 | 20 | 21 | ### Environment, Platform, Device 22 | 23 | 24 | 25 | 26 | ### Version information 27 | 34 | 35 | 36 | 37 | ## Checklist 38 | 39 | 40 | - [ ] I searched for already existing GitHub issues about this 41 | - [ ] I updated all Cordova tooling to their most recent version 42 | - [ ] I included all the necessary information above 43 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/BUG_REPORT.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: 🐛 Bug Report 3 | about: If something isn't working as expected. 4 | 5 | --- 6 | 7 | # Bug Report 8 | 9 | ## Problem 10 | 11 | ### What is expected to happen? 12 | 13 | 14 | 15 | ### What does actually happen? 16 | 17 | 18 | 19 | ## Information 20 | 21 | 22 | 23 | 24 | ### Command or Code 25 | 26 | 27 | 28 | 29 | ### Environment, Platform, Device 30 | 31 | 32 | 33 | 34 | ### Version information 35 | 42 | 43 | 44 | 45 | ## Checklist 46 | 47 | 48 | - [ ] I searched for existing GitHub issues 49 | - [ ] I updated all Cordova tooling to most recent version 50 | - [ ] I included all the necessary information above 51 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/FEATURE_REQUEST.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: 🚀 Feature Request 3 | about: A suggestion for a new functionality 4 | 5 | --- 6 | 7 | # Feature Request 8 | 9 | ## Motivation Behind Feature 10 | 11 | 12 | 13 | 14 | ## Feature Description 15 | 20 | 21 | 22 | 23 | ## Alternatives or Workarounds 24 | 28 | 29 | 30 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/SUPPORT_QUESTION.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: 💬 Support Question 3 | about: If you have a question, please check out our Slack or StackOverflow! 4 | 5 | --- 6 | 7 | 8 | 9 | Apache Cordova uses GitHub Issues as a feature request and bug tracker _only_. 10 | For usage and support questions, please check out the resources below. Thanks! 11 | 12 | --- 13 | 14 | You can get answers to your usage and support questions about **Apache Cordova** on: 15 | 16 | * Slack Community Chat: https://cordova.slack.com (you can sign-up at http://slack.cordova.io/) 17 | * StackOverflow: https://stackoverflow.com/questions/tagged/cordova using the tag `cordova` 18 | 19 | --- 20 | 21 | If you are using a tool that uses Cordova internally, like e.g. Ionic, check their support channels: 22 | 23 | * **Ionic Framework** 24 | * [Ionic Community Forum](https://forum.ionicframework.com/) 25 | * [Ionic Worldwide Slack](https://ionicworldwide.herokuapp.com/) 26 | * **PhoneGap** 27 | * [PhoneGap Developer Community](https://forums.adobe.com/community/phonegap) 28 | -------------------------------------------------------------------------------- /.github/PULL_REQUEST_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | 8 | 9 | ### Platforms affected 10 | 11 | 12 | 13 | ### Motivation and Context 14 | 15 | 16 | 17 | 18 | 19 | ### Description 20 | 21 | 22 | 23 | 24 | ### Testing 25 | 26 | 27 | 28 | 29 | ### Checklist 30 | 31 | - [ ] I've run the tests to see all new and existing tests pass 32 | - [ ] I added automated test coverage as appropriate for this change 33 | - [ ] Commit is prefixed with `(platform)` if this change only applies to one platform (e.g. `(android)`) 34 | - [ ] If this Pull Request resolves an issue, I linked to the issue in the text above (and used the correct [keyword to close issues using keywords](https://help.github.com/articles/closing-issues-using-keywords/)) 35 | - [ ] I've updated the documentation if necessary 36 | -------------------------------------------------------------------------------- /.github/workflows/ci.yml: -------------------------------------------------------------------------------- 1 | # Licensed to the Apache Software Foundation (ASF) under one 2 | # or more contributor license agreements. See the NOTICE file 3 | # distributed with this work for additional information 4 | # regarding copyright ownership. The ASF licenses this file 5 | # to you under the Apache License, Version 2.0 (the 6 | # "License"); you may not use this file except in compliance 7 | # with the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, 12 | # software distributed under the License is distributed on an 13 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | # KIND, either express or implied. See the License for the 15 | # specific language governing permissions and limitations 16 | # under the License. 17 | 18 | name: Node CI 19 | 20 | on: [push, pull_request] 21 | 22 | jobs: 23 | test: 24 | name: NodeJS ${{ matrix.node-version }} on ${{ matrix.os }} 25 | 26 | runs-on: ${{ matrix.os }} 27 | 28 | strategy: 29 | matrix: 30 | node-version: [10.x, 12.x, 14.x, 16.x] 31 | os: [windows-latest] 32 | 33 | steps: 34 | - uses: actions/checkout@v2 35 | 36 | - name: Use Node.js ${{ matrix.node-version }} 37 | uses: actions/setup-node@v1 38 | with: 39 | node-version: ${{ matrix.node-version }} 40 | 41 | - name: Environment Information 42 | run: | 43 | node --version 44 | npm --version 45 | 46 | - name: npm install and test 47 | run: | 48 | npm i 49 | npm t 50 | env: 51 | CI: true 52 | 53 | - uses: codecov/codecov-action@v1 54 | with: 55 | fail_ci_if_error: true 56 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *.user 2 | .DS_Store 3 | bld 4 | *.opensdf 5 | *.suo 6 | *.sdf 7 | Debug 8 | obj 9 | Thumbs.db 10 | /.idea/ 11 | 12 | # Skip node_modules folder 13 | node_modules/ 14 | npm-debug.log 15 | 16 | # Skip testing stuff 17 | coverage/* 18 | testcreate* 19 | coverage/ 20 | .nyc_output/ 21 | temp/* 22 | -------------------------------------------------------------------------------- /.ratignore: -------------------------------------------------------------------------------- 1 | # WinJS base.js is using MIT license 2 | base.js 3 | *.appx 4 | *.appxbundle 5 | spec 6 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: node_js 2 | sudo: false 3 | 4 | git: 5 | depth: 10 6 | 7 | node_js: 8 | - 10 9 | - 12 10 | - 14 11 | 12 | install: 13 | - npm install 14 | - npm install -g codecov 15 | 16 | script: 17 | - npm run lint 18 | - npm run cover 19 | 20 | after_script: 21 | - codecov 22 | -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | 21 | 22 | # Contributing to Apache Cordova 23 | 24 | Anyone can contribute to Cordova. And we need your contributions. 25 | 26 | There are multiple ways to contribute: report bugs, improve the docs, and 27 | contribute code. 28 | 29 | For instructions on this, start with the 30 | [contribution overview](http://cordova.apache.org/contribute/). 31 | 32 | The details are explained there, but the important items are: 33 | - Check for Github issues that corresponds to your contribution and link or create them if necessary. 34 | - Run the tests so your patch doesn't break existing functionality. 35 | 36 | We look forward to your contributions! 37 | 38 | -------------------------------------------------------------------------------- /NOTICE: -------------------------------------------------------------------------------- 1 | Apache Cordova 2 | Copyright 2012 The Apache Software Foundation 3 | 4 | This product includes software developed by 5 | The Apache Software Foundation (http://www.apache.org) 6 | 7 | 8 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | 21 | 22 | 📌 **Deprecation Notice** 23 | 24 | This repository is deprecated and no more work will be done on this by Apache Cordova. You can continue to use this and it should work as-is but any future issues will not be fixed by the Cordova community. 25 | 26 | Feel free to fork this repository and improve your fork. Existing forks are listed in [Network](../../network) and [Forks](../../network/members). 27 | 28 | - Learn more: https://github.com/apache/cordova/blob/master/deprecated.md#deprecated-platforms 29 | --- 30 | 31 | 32 | 33 | # Apache Cordova for Windows 34 | 35 | [![Build status](https://ci.appveyor.com/api/projects/status/19h1fq0lyvwtei05/branch/master)](https://ci.appveyor.com/project/Humbedooh/cordova-windows/branch/master) 36 | [![Build Status](https://travis-ci.org/apache/cordova-windows.svg?branch=master)](https://travis-ci.org/apache/cordova-windows) 37 | [![codecov.io](https://codecov.io/github/apache/cordova-windows/coverage.svg?branch=master)](https://codecov.io/github/apache/cordova-windows?branch=master) 38 | 39 | This repo contains the code for an [Apache Cordova](http://cordova.apache.org) platform that allows you to build applications that target Windows 10, and Windows 8.1, as well as Windows Phone 8.1. An Apache Cordova based applications is written in HTML, CSS and JavaScript. 40 | 41 | (Warning: Windows 8 has been deprecated, please update your applications to target Windows 8.1 or above) 42 | 43 | [Apache Cordova](http://cordova.apache.org) is a project of [The Apache Software Foundation (ASF)](http://apache.org) 44 | 45 | # Requirements 46 | 47 | See https://cordova.apache.org/docs/en/dev/guide/platforms/windows/index.html#requirements-and-support 48 | 49 | Note that Visual Studio 2019 is not supported, as discussed in [cordova-windows issue #327](https://github.com/apache/cordova-windows/issues/327). 50 | 51 | # Getting started 52 | 53 | The best way to use this is to install the [Cordova CLI](https://www.npmjs.com/package/cordova), create a project, add the windows platform, and run the app: 54 | 55 | npm install -g cordova 56 | cordova create test 57 | cordova platform add windows 58 | cordova run windows 59 | 60 | # Getting logs from Windows Store applications 61 | 62 | You can get your JavaScript logs as well as Windows logs related to your Windows Store application by running the following command from your app directory: 63 | 64 | platforms\windows\cordova\log 65 | 66 | In most cases, this command requires administrator privileges. However, if you want to gather logs without admin privileges, you may need to manually enable logging channel via Event Viewer: 67 | 68 | Start -> Run -> eventvwr 69 | View -> Show Analytic and Debug Logs 70 | Applications and Services Logs -> Microsoft -> Windows -> AppHost -> AppTracing -> Enable Log 71 | 72 | Please note that the log command is supported only for Windows Store applications and cannot get logs from Windows Phone application. 73 | 74 | # Report Issues 75 | 76 | Report them [right here at GitHub using the "Issues" tab](https://github.com/apache/cordova-windows/issues). 77 | 78 | # Further Reading 79 | 80 | - [Windows Platform Guide](https://cordova.apache.org/docs/en/latest/guide/platforms/windows/index.html) 81 | - [Apache Cordova Documentation](http://docs.cordova.io) 82 | -------------------------------------------------------------------------------- /VERSION: -------------------------------------------------------------------------------- 1 | 8.0.0-dev 2 | -------------------------------------------------------------------------------- /appveyor.yml: -------------------------------------------------------------------------------- 1 | # 2 | # Licensed to the Apache Software Foundation (ASF) under one 3 | # or more contributor license agreements. See the NOTICE file 4 | # distributed with this work for additional information 5 | # regarding copyright ownership. The ASF licenses this file 6 | # to you under the Apache License, Version 2.0 (the 7 | # "License"); you may not use this file except in compliance 8 | # with the License. You may obtain a copy of the License at 9 | # 10 | # http://www.apache.org/licenses/LICENSE-2.0 11 | # 12 | # Unless required by applicable law or agreed to in writing, 13 | # software distributed under the License is distributed on an 14 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | # KIND, either express or implied. See the License for the 16 | # specific language governing permissions and limitations 17 | # under the License. 18 | 19 | # appveyor file 20 | # http://www.appveyor.com/docs/appveyor-yml 21 | 22 | environment: 23 | matrix: 24 | - nodejs_version: "14" 25 | APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017 26 | 27 | - nodejs_version: "14" 28 | APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017 29 | MSBUILDDIR: "C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\Community\\MSBuild\\15.0\\Bin\\" 30 | 31 | - nodejs_version: "14" 32 | APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017 33 | MSBUILDDIR: "C:\\Program Files (x86)\\MSBuild\\14.0\\bin\\" 34 | 35 | - nodejs_version: "14" 36 | APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015 37 | 38 | install: 39 | - ps: Install-Product node $env:nodejs_version 40 | - npm install 41 | 42 | build: off 43 | 44 | test_script: 45 | - node --version 46 | - npm --version 47 | - msbuild -version -nologo 48 | - where msbuild 49 | - IF NOT EXIST "%ProgramFiles(x86)%\Microsoft Visual Studio\Installer\vswhere.exe" ( echo "no vswhere" ) ELSE "%ProgramFiles(x86)%\Microsoft Visual Studio\Installer\vswhere" -property installationPath -products * -all" 50 | - IF NOT EXIST "%ProgramFiles(x86)%\Microsoft Visual Studio\Installer\vswhere.exe" ( echo "no vswhere" ) ELSE "%ProgramFiles(x86)%\Microsoft Visual Studio\Installer\vswhere" -property installationPath -all" 51 | - IF NOT EXIST "%ProgramFiles(x86)%\Microsoft Visual Studio\Installer\vswhere.exe" ( echo "no vswhere" ) ELSE "%ProgramFiles(x86)%\Microsoft Visual Studio\Installer\vswhere" -property installationPath -legacy" 52 | - npm test 53 | -------------------------------------------------------------------------------- /bin/check_all: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env node 2 | 3 | /* 4 | Licensed to the Apache Software Foundation (ASF) under one 5 | or more contributor license agreements. See the NOTICE file 6 | distributed with this work for additional information 7 | regarding copyright ownership. The ASF licenses this file 8 | to you under the Apache License, Version 2.0 (the 9 | "License"); you may not use this file except in compliance 10 | with the License. You may obtain a copy of the License at 11 | 12 | http://www.apache.org/licenses/LICENSE-2.0 13 | 14 | Unless required by applicable law or agreed to in writing, 15 | software distributed under the License is distributed on an 16 | "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 17 | KIND, either express or implied. See the License for the 18 | specific language governing permissions and limitations 19 | under the License. 20 | */ 21 | 22 | var check_reqs = require('./lib/check_reqs'); 23 | 24 | // check for help flag 25 | if (['--help', '/?', '-h', 'help', '-help', '/help'].indexOf(process.argv[2]) > -1) { 26 | check_reqs.help(); 27 | } else { 28 | check_reqs.check_all().then(function success (result) { 29 | console.log('check_all', result); 30 | }, function (err) { 31 | console.error('Error: ' + err); 32 | process.exit(2); 33 | }); 34 | } 35 | -------------------------------------------------------------------------------- /bin/check_all.bat: -------------------------------------------------------------------------------- 1 | :: Licensed to the Apache Software Foundation (ASF) under one 2 | :: or more contributor license agreements. See the NOTICE file 3 | :: distributed with this work for additional information 4 | :: regarding copyright ownership. The ASF licenses this file 5 | :: to you under the Apache License, Version 2.0 (the 6 | :: "License"); you may not use this file except in compliance 7 | :: with the License. You may obtain a copy of the License at 8 | :: 9 | :: http://www.apache.org/licenses/LICENSE-2.0 10 | :: 11 | :: Unless required by applicable law or agreed to in writing, 12 | :: software distributed under the License is distributed on an 13 | :: "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | :: KIND, either express or implied. See the License for the 15 | :: specific language governing permissions and limitations 16 | :: under the License 17 | @ECHO OFF 18 | SET script_path="%~dp0check_all" 19 | IF EXIST %script_path% ( 20 | node "%script_path%" %* 21 | ) ELSE ( 22 | ECHO. 23 | ECHO ERROR: Could not find 'check_all' script in 'bin' folder, aborting...>&2 24 | EXIT /B 1 25 | ) -------------------------------------------------------------------------------- /bin/check_reqs: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env node 2 | 3 | /* 4 | Licensed to the Apache Software Foundation (ASF) under one 5 | or more contributor license agreements. See the NOTICE file 6 | distributed with this work for additional information 7 | regarding copyright ownership. The ASF licenses this file 8 | to you under the Apache License, Version 2.0 (the 9 | "License"); you may not use this file except in compliance 10 | with the License. You may obtain a copy of the License at 11 | 12 | http://www.apache.org/licenses/LICENSE-2.0 13 | 14 | Unless required by applicable law or agreed to in writing, 15 | software distributed under the License is distributed on an 16 | "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 17 | KIND, either express or implied. See the License for the 18 | specific language governing permissions and limitations 19 | under the License. 20 | */ 21 | 22 | var check_reqs = require('./lib/check_reqs'); 23 | 24 | // check for help flag 25 | if (['--help', '/?', '-h', 'help', '-help', '/help'].indexOf(process.argv[2]) > -1) { 26 | check_reqs.help(); 27 | } else { 28 | check_reqs.run().then(function success (msbuild) { 29 | console.log('Environment is supported; found MSBuild Tools version ' + msbuild.version + ' at ' + msbuild.path); 30 | }, function (err) { 31 | console.error('Environment is not supported: ' + err); 32 | process.exit(2); 33 | }); 34 | } 35 | -------------------------------------------------------------------------------- /bin/check_reqs.bat: -------------------------------------------------------------------------------- 1 | :: Licensed to the Apache Software Foundation (ASF) under one 2 | :: or more contributor license agreements. See the NOTICE file 3 | :: distributed with this work for additional information 4 | :: regarding copyright ownership. The ASF licenses this file 5 | :: to you under the Apache License, Version 2.0 (the 6 | :: "License"); you may not use this file except in compliance 7 | :: with the License. You may obtain a copy of the License at 8 | :: 9 | :: http://www.apache.org/licenses/LICENSE-2.0 10 | :: 11 | :: Unless required by applicable law or agreed to in writing, 12 | :: software distributed under the License is distributed on an 13 | :: "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | :: KIND, either express or implied. See the License for the 15 | :: specific language governing permissions and limitations 16 | :: under the License 17 | @ECHO OFF 18 | SET script_path="%~dp0check_reqs" 19 | IF EXIST %script_path% ( 20 | node "%script_path%" %* 21 | ) ELSE ( 22 | ECHO. 23 | ECHO ERROR: Could not find 'check_reqs' script in 'bin' folder, aborting...>&2 24 | EXIT /B 1 25 | ) -------------------------------------------------------------------------------- /bin/create: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env node 2 | 3 | /* 4 | Licensed to the Apache Software Foundation (ASF) under one 5 | or more contributor license agreements. See the NOTICE file 6 | distributed with this work for additional information 7 | regarding copyright ownership. The ASF licenses this file 8 | to you under the Apache License, Version 2.0 (the 9 | "License"); you may not use this file except in compliance 10 | with the License. You may obtain a copy of the License at 11 | 12 | http://www.apache.org/licenses/LICENSE-2.0 13 | 14 | Unless required by applicable law or agreed to in writing, 15 | software distributed under the License is distributed on an 16 | "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 17 | KIND, either express or implied. See the License for the 18 | specific language governing permissions and limitations 19 | under the License. 20 | */ 21 | 22 | var path = require('path'); 23 | var ConfigParser = require('cordova-common').ConfigParser; 24 | var Api = require('../template/cordova/Api'); 25 | 26 | var argv = require('nopt')({ 27 | help: Boolean, 28 | guid: String, 29 | silent: Boolean, 30 | verbose: Boolean 31 | }, { d: '--verbose' }); 32 | 33 | if (argv.help || argv.argv.remain.length === 0) { 34 | console.log('Usage: create PathToProject [ PackageName [ AppName [ CustomTemplate ] ] ] [--guid=]'); 35 | console.log(' PathToProject : The path to where you wish to create the project'); 36 | console.log(' PackageName : The namespace for the project (default is Cordova.Example)'); 37 | console.log(' AppName : The name of the application (default is CordovaAppProj)'); 38 | console.log(' CustomTemplate: The path to project template overrides'); 39 | console.log(' (will be copied over default platform template files)'); 40 | console.log(' --guid : The App\'s GUID (default is random generated)'); 41 | console.log('examples:'); 42 | console.log(' create C:\\Users\\anonymous\\Desktop\\MyProject'); 43 | console.log(' create C:\\Users\\anonymous\\Desktop\\MyProject io.Cordova.Example AnApp'); 44 | process.exit(1); 45 | } 46 | 47 | var config = new ConfigParser(path.resolve(__dirname, '../template/config.xml')); 48 | 49 | if (argv.argv.remain[1]) config.setPackageName(argv.argv.remain[1]); 50 | if (argv.argv.remain[2]) config.setName(argv.argv.remain[2]); 51 | 52 | var options = { 53 | guid: argv.guid, 54 | customTemplate: argv.argv.remain[3] 55 | }; 56 | 57 | require('../template/cordova/lib/loggingHelper').adjustLoggerLevel(options); 58 | 59 | Api.createPlatform(argv.argv.remain[0], config, options).catch(err => { 60 | console.error(err); 61 | process.exit(2); 62 | }); 63 | -------------------------------------------------------------------------------- /bin/create.bat: -------------------------------------------------------------------------------- 1 | :: Licensed to the Apache Software Foundation (ASF) under one 2 | :: or more contributor license agreements. See the NOTICE file 3 | :: distributed with this work for additional information 4 | :: regarding copyright ownership. The ASF licenses this file 5 | :: to you under the Apache License, Version 2.0 (the 6 | :: "License"); you may not use this file except in compliance 7 | :: with the License. You may obtain a copy of the License at 8 | :: 9 | :: http://www.apache.org/licenses/LICENSE-2.0 10 | :: 11 | :: Unless required by applicable law or agreed to in writing, 12 | :: software distributed under the License is distributed on an 13 | :: "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | :: KIND, either express or implied. See the License for the 15 | :: specific language governing permissions and limitations 16 | :: under the License 17 | @ECHO OFF 18 | SET script_path="%~dp0create" 19 | IF EXIST %script_path% ( 20 | node %script_path% %* 21 | ) ELSE ( 22 | ECHO. 23 | ECHO ERROR: Could not find 'create' script in 'bin' folder, aborting...>&2 24 | EXIT /B 1 25 | ) -------------------------------------------------------------------------------- /bin/lib/update.js: -------------------------------------------------------------------------------- 1 | /* 2 | Licensed to the Apache Software Foundation (ASF) under one 3 | or more contributor license agreements. See the NOTICE file 4 | distributed with this work for additional information 5 | regarding copyright ownership. The ASF licenses this file 6 | to you under the Apache License, Version 2.0 (the 7 | "License"); you may not use this file except in compliance 8 | with the License. You may obtain a copy of the License at 9 | 10 | http://www.apache.org/licenses/LICENSE-2.0 11 | 12 | Unless required by applicable law or agreed to in writing, 13 | software distributed under the License is distributed on an 14 | "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | KIND, either express or implied. See the License for the 16 | specific language governing permissions and limitations 17 | under the License. 18 | */ 19 | 20 | var fs = require('fs'); 21 | var path = require('path'); 22 | var shell = require('shelljs'); 23 | var create = require('./create'); 24 | var events = require('cordova-common').events; 25 | var ConfigParser = require('cordova-common').ConfigParser; 26 | var CordovaError = require('cordova-common').CordovaError; 27 | var AppxManifest = require('../../template/cordova/lib/AppxManifest'); 28 | 29 | // updates the cordova.js in project along with the cordova tooling. 30 | module.exports.update = function (destinationDir, options) { 31 | if (!fs.existsSync(destinationDir)) { 32 | // if specified project path is not valid then reject promise 33 | return Promise.reject(new CordovaError('The given path to the project does not exist: ' + destinationDir)); 34 | } 35 | 36 | var projectConfig = path.join(destinationDir, 'config.xml'); 37 | if (!fs.existsSync(projectConfig)) { 38 | return Promise.reject(new CordovaError('Can\'t update project at ' + destinationDir + 39 | '. config.xml does not exist in destination directory')); 40 | } 41 | 42 | var guid; 43 | var config = new ConfigParser(projectConfig); 44 | 45 | // guid param is used only when adding a platform, and isn't saved anywhere. 46 | // The only place, where it is being persisted - phone/win10 appxmanifest file, 47 | // but since win10 introduced just recently, we can't rely on its manifest 48 | // for old platform versions. 49 | var manifestPath = path.join(destinationDir, 'package.phone.appxmanifest'); 50 | try { 51 | guid = AppxManifest.get(manifestPath).getPhoneIdentity().getPhoneProductId(); 52 | } catch (e) { /* ignore IO errors */ } 53 | 54 | shell.rm('-rf', destinationDir); 55 | return create.create(destinationDir, config, { guid: guid }, events); 56 | }; 57 | -------------------------------------------------------------------------------- /bin/update: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env node 2 | 3 | /* 4 | Licensed to the Apache Software Foundation (ASF) under one 5 | or more contributor license agreements. See the NOTICE file 6 | distributed with this work for additional information 7 | regarding copyright ownership. The ASF licenses this file 8 | to you under the Apache License, Version 2.0 (the 9 | "License"); you may not use this file except in compliance 10 | with the License. You may obtain a copy of the License at 11 | 12 | http://www.apache.org/licenses/LICENSE-2.0 13 | 14 | Unless required by applicable law or agreed to in writing, 15 | software distributed under the License is distributed on an 16 | "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 17 | KIND, either express or implied. See the License for the 18 | specific language governing permissions and limitations 19 | under the License. 20 | */ 21 | 22 | var Api = require('../template/cordova/Api'); 23 | var args = require('nopt')({ 24 | help: Boolean, 25 | silent: Boolean, 26 | verbose: Boolean 27 | }, { d: '--verbose' }); 28 | 29 | if (args.help || args.argv.remain.length === 0) { 30 | console.log('WARNING : Make sure to back up your project before updating!'); 31 | console.log('Usage: update PathToProject '); 32 | console.log(' PathToProject : The path the project you would like to update.'); 33 | console.log('examples:'); 34 | console.log(' update C:\\Users\\anonymous\\Desktop\\MyProject'); 35 | process.exit(1); 36 | } 37 | 38 | require('../template/cordova/lib/loggingHelper').adjustLoggerLevel(args); 39 | 40 | Api.updatePlatform(args.argv.remain[0]).catch(err => { 41 | console.error(err); 42 | process.exit(2); 43 | }); 44 | -------------------------------------------------------------------------------- /bin/update.bat: -------------------------------------------------------------------------------- 1 | :: Licensed to the Apache Software Foundation (ASF) under one 2 | :: or more contributor license agreements. See the NOTICE file 3 | :: distributed with this work for additional information 4 | :: regarding copyright ownership. The ASF licenses this file 5 | :: to you under the Apache License, Version 2.0 (the 6 | :: "License"); you may not use this file except in compliance 7 | :: with the License. You may obtain a copy of the License at 8 | :: 9 | :: http://www.apache.org/licenses/LICENSE-2.0 10 | :: 11 | :: Unless required by applicable law or agreed to in writing, 12 | :: software distributed under the License is distributed on an 13 | :: "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | :: KIND, either express or implied. See the License for the 15 | :: specific language governing permissions and limitations 16 | :: under the License 17 | @ECHO OFF 18 | SET script_path="%~dp0update" 19 | IF EXIST %script_path% ( 20 | node %script_path% %* 21 | ) ELSE ( 22 | ECHO. 23 | ECHO ERROR: Could not find 'update' script in 'bin' folder, aborting...>&2 24 | EXIT /B 1 25 | ) -------------------------------------------------------------------------------- /cordova-js-src/confighelper.js: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * Licensed to the Apache Software Foundation (ASF) under one 4 | * or more contributor license agreements. See the NOTICE file 5 | * distributed with this work for additional information 6 | * regarding copyright ownership. The ASF licenses this file 7 | * to you under the Apache License, Version 2.0 (the 8 | * "License"); you may not use this file except in compliance 9 | * with the License. You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, 14 | * software distributed under the License is distributed on an 15 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16 | * KIND, either express or implied. See the License for the 17 | * specific language governing permissions and limitations 18 | * under the License. 19 | * 20 | */ 21 | 22 | // config.xml and AppxManifest.xml wrapper (non-node ConfigParser analogue) 23 | var configCache = {}; 24 | var utils = require('cordova/utils'); 25 | 26 | var isPhone = (cordova.platformId === 'windows') && WinJS.Utilities.isPhone; 27 | var isWin10UWP = navigator.appVersion.indexOf('MSAppHost/3.0') !== -1; 28 | var splashScreenTagName = isWin10UWP ? "uap:SplashScreen" : (isPhone ? "m3:SplashScreen" : "m2:SplashScreen"); 29 | 30 | function XmlFile (text) { 31 | this.text = text; 32 | } 33 | 34 | XmlFile.prototype.loadTags = function (tagName) { 35 | var parser; 36 | if (!this.doc) { 37 | parser = new DOMParser(); 38 | this.doc = parser.parseFromString(this.text, 'application/xml'); 39 | } 40 | 41 | var tags = this.doc.getElementsByTagName(tagName); 42 | return Array.prototype.slice.call(tags); 43 | }; 44 | 45 | function Config (text) { 46 | XmlFile.apply(this, arguments); 47 | this.preferences = this.loadTags('preference'); 48 | } 49 | 50 | function Manifest (text) { 51 | XmlFile.apply(this, arguments); 52 | this.splashScreen = this.loadTags(splashScreenTagName)[0]; 53 | } 54 | 55 | utils.extend(Config, XmlFile); 56 | utils.extend(Manifest, XmlFile); 57 | 58 | function requestFile (filePath, success, error) { 59 | var xhr; 60 | 61 | if (typeof configCache[filePath] !== 'undefined') { 62 | success(configCache[filePath]); 63 | } 64 | 65 | function fail (msg) { 66 | console.error(msg); 67 | 68 | if (error) { 69 | error(msg); 70 | } 71 | } 72 | 73 | var xhrStatusChangeHandler = function () { 74 | if (xhr.readyState === 4) { 75 | if (xhr.status === 200 || xhr.status === 304 || xhr.status === 0 /* file:// */) { 76 | configCache[filePath] = xhr.responseText; 77 | success(xhr.responseText); 78 | } else { 79 | fail('[Windows][cordova.js][xhrStatusChangeHandler] Could not XHR ' + filePath + ': ' + xhr.statusText); 80 | } 81 | } 82 | }; 83 | 84 | xhr = new XMLHttpRequest(); 85 | xhr.addEventListener('load', xhrStatusChangeHandler); 86 | 87 | try { 88 | xhr.open('get', filePath, true); 89 | xhr.send(); 90 | } catch (e) { 91 | fail('[Windows][cordova.js][xhrFile] Could not XHR ' + filePath + ': ' + JSON.stringify(e)); 92 | } 93 | } 94 | 95 | function readConfig (success, error) { 96 | requestFile('/config.xml', function (contents) { 97 | success(new Config(contents)); 98 | }, error); 99 | } 100 | 101 | function readManifest (success, error) { 102 | requestFile('/AppxManifest.xml', function (contents) { 103 | success(new Manifest(contents)); 104 | }, error); 105 | } 106 | 107 | /** 108 | * Reads a preference value from config.xml. 109 | * Returns preference value or undefined if it does not exist. 110 | * @param {String} preferenceName Preference name to read */ 111 | Config.prototype.getPreferenceValue = function (preferenceName) { 112 | var preferenceItem = this.preferences && this.preferences.filter(function (item) { 113 | return item.attributes.name.value === preferenceName; 114 | }); 115 | 116 | if (preferenceItem && preferenceItem[0] && preferenceItem[0].attributes && preferenceItem[0].attributes.value) { 117 | return preferenceItem[0].attributes.value.value; 118 | } 119 | }; 120 | 121 | /** 122 | * Reads SplashScreen image path 123 | */ 124 | Manifest.prototype.getSplashScreenImagePath = function () { 125 | return this.splashScreen.attributes.Image.value; 126 | }; 127 | 128 | exports.readConfig = readConfig; 129 | exports.readManifest = readManifest; 130 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "cordova-windows", 3 | "version": "8.0.0-dev", 4 | "description": "cordova-windows release", 5 | "bin": "bin/create", 6 | "main": "template/cordova/Api.js", 7 | "repository": "github:apache/cordova-windows", 8 | "bugs": "https://github.com/apache/cordova-windows/issues", 9 | "keywords": [ 10 | "windows", 11 | "cordova", 12 | "apache" 13 | ], 14 | "scripts": { 15 | "test": "npm run lint && npm run test-unit && npm run test-e2e", 16 | "test-unit": "jasmine", 17 | "test-e2e": "jasmine spec/e2e/endtoend.spec.js", 18 | "cover": "nyc jasmine", 19 | "lint": "eslint . \"+(bin|template)/**/!(*.*|gitignore)\"" 20 | }, 21 | "dependencies": { 22 | "cordova-common": "^3.2.0", 23 | "elementtree": "^0.1.7", 24 | "fs-extra": "^9.0.0", 25 | "node-uuid": "^1.4.8", 26 | "nopt": "^4.0.1", 27 | "semver": "^5.5.0", 28 | "shelljs": "^0.5.3", 29 | "winjs": "^4.4.3" 30 | }, 31 | "devDependencies": { 32 | "@cordova/eslint-config": "^3.0.0", 33 | "jasmine": "^3.5.0", 34 | "nyc": "^15.0.1", 35 | "rewire": "^5.0.0" 36 | }, 37 | "engines": { 38 | "node": ">=10.0.0" 39 | }, 40 | "author": "Apache Software Foundation", 41 | "license": "Apache-2.0", 42 | "nyc": { 43 | "include": [ 44 | "bin/**", 45 | "template/cordova/**" 46 | ], 47 | "reporter": [ 48 | "lcov", 49 | "text" 50 | ] 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /spec/support/jasmine.json: -------------------------------------------------------------------------------- 1 | { 2 | "spec_dir": "spec", 3 | "spec_files": [ 4 | "../spec/unit/**/*[sS]pec.js" 5 | ], 6 | "stopSpecOnExpectationFailure": false, 7 | "random": false 8 | } 9 | -------------------------------------------------------------------------------- /spec/unit/JsprojManager.spec.js: -------------------------------------------------------------------------------- 1 | /** 2 | Licensed to the Apache Software Foundation (ASF) under one 3 | or more contributor license agreements. See the NOTICE file 4 | distributed with this work for additional information 5 | regarding copyright ownership. The ASF licenses this file 6 | to you under the Apache License, Version 2.0 (the 7 | "License"); you may not use this file except in compliance 8 | with the License. You may obtain a copy of the License at 9 | 10 | http://www.apache.org/licenses/LICENSE-2.0 11 | 12 | Unless required by applicable law or agreed to in writing, 13 | software distributed under the License is distributed on an 14 | "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | KIND, either express or implied. See the License for the 16 | specific language governing permissions and limitations 17 | under the License. 18 | */ 19 | 20 | var et = require('elementtree'); 21 | var shell = require('shelljs'); 22 | var rewire = require('rewire'); 23 | var xml = require('cordova-common').xmlHelpers; 24 | var AppxManifest = require('../../template/cordova/lib/AppxManifest'); 25 | var JsprojManager = rewire('../../template/cordova/lib/JsprojManager'); 26 | 27 | var PROJECT_PATH = 'spec/unit/fixtures/DummyProject'; 28 | var INVALID_PROJECT_PATH = 'spec/unit/fixtures/FakeProject'; 29 | var FAKE_MANIFEST = new et.ElementTree(et.XML( 30 | '' + 31 | '' + 32 | '' + 33 | 'HelloCordova' + 34 | '' + 35 | '')); 36 | 37 | describe('JsprojManager', function () { 38 | var project; 39 | var origProj = JsprojManager.__get__('proj'); 40 | 41 | beforeEach(function () { 42 | JsprojManager.__set__('proj', jasmine.createSpy('proj')); 43 | 44 | spyOn(shell, 'ls').and.returnValue([PROJECT_PATH + '/CordovaApp.projitems']); 45 | spyOn(xml, 'parseElementtreeSync').and.returnValue(FAKE_MANIFEST); 46 | spyOn(AppxManifest, 'get').and.callThrough(); 47 | 48 | project = JsprojManager.getProject(PROJECT_PATH); 49 | }); 50 | 51 | afterEach(function () { 52 | JsprojManager.__set__('proj', origProj); 53 | }); 54 | 55 | it('should throw if project is not a windows project', function () { 56 | shell.ls.and.callThrough(); 57 | expect(function () { 58 | JsprojManager.getProject(INVALID_PROJECT_PATH); 59 | }).toThrow(); 60 | }); 61 | 62 | it('should use AppxManifest class to get package name', function () { 63 | expect(project.getPackageName()).toBe('HelloCordova'); 64 | expect(AppxManifest.get).toHaveBeenCalled(); 65 | // Should pass 'ignoreCache' option to 'get' method 66 | expect(AppxManifest.get.calls.argsFor(0)[1]).toBe(true); 67 | }); 68 | }); 69 | -------------------------------------------------------------------------------- /spec/unit/MRTImage.spec.js: -------------------------------------------------------------------------------- 1 | /** 2 | Licensed to the Apache Software Foundation (ASF) under one 3 | or more contributor license agreements. See the NOTICE file 4 | distributed with this work for additional information 5 | regarding copyright ownership. The ASF licenses this file 6 | to you under the Apache License, Version 2.0 (the 7 | "License"); you may not use this file except in compliance 8 | with the License. You may obtain a copy of the License at 9 | 10 | http://www.apache.org/licenses/LICENSE-2.0 11 | 12 | Unless required by applicable law or agreed to in writing, 13 | software distributed under the License is distributed on an 14 | "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | KIND, either express or implied. See the License for the 16 | specific language governing permissions and limitations 17 | under the License. 18 | */ 19 | 20 | var MRTImage = require('../../template/cordova/lib/MRTImage'); 21 | 22 | describe('MRTImage class', function () { 23 | it('should be constructable', function () { 24 | expect(new MRTImage('some/path/Image.scale-240.png')).toBeDefined(); 25 | }); 26 | 27 | it('should detect base name and qualifiers properly', function () { 28 | expect(new MRTImage('some/path/Image.scale-240.png').basename).toBe('Image'); 29 | expect(new MRTImage('some/path/Basename.with.dots.scale-240.png').basename).toBe('Basename.with.dots'); 30 | expect(new MRTImage('some/path/Basename.with.dots.png').basename).toBe('Basename.with'); 31 | 32 | expect(new MRTImage('some/path/Image.png').qualifiers).toBe('scale-100'); 33 | expect(new MRTImage('some/path/Image.scale-240.png').qualifiers).toBe('scale-240'); 34 | expect(new MRTImage('some/path/Image.targetsize-20_altform-unplated.png').qualifiers).toBe('targetsize-20_altform-unplated'); 35 | }); 36 | 37 | describe('matchesTo method', function () { 38 | it('should compare MRTImage instances properly', function () { 39 | var testImage = new MRTImage('some/path/Basename.scale-240.png'); 40 | 41 | expect(new MRTImage('some/path/Basename.png').matchesTo(testImage)).toBe(true); 42 | expect(new MRTImage('some/path/Basename.scale-240.png').matchesTo(testImage)).toBe(true); 43 | expect(new MRTImage('some/path/Basename.targetsize-20_scale-240.png').matchesTo(testImage)).toBe(true); 44 | 45 | expect(testImage.matchesTo('')).toBe(false); 46 | expect(testImage.matchesTo({})).toBe(false); 47 | expect(testImage.matchesTo(undefined)).toBe(false); 48 | 49 | expect(new MRTImage('some/path/Basename.jpg').matchesTo(testImage)).toBe(false); 50 | expect(new MRTImage('some/path/Basename.with.dots.scale-240.png').matchesTo(testImage)).toBe(false); 51 | }); 52 | }); 53 | 54 | describe('generateFilenameFrom method', function () { 55 | it('should use baseName argument to construct new filename', function () { 56 | var testImage = new MRTImage('some/path/Basename.scale-240.png'); 57 | 58 | expect(testImage.generateFilenameFrom('NewName')).toMatch(/^NewName(.*)\.png/); 59 | expect(testImage.generateFilenameFrom('NewName')).not.toMatch(/Basename/); 60 | }); 61 | 62 | it('should leave qualifiers unchanged', function () { 63 | var testImage = new MRTImage('some/path/Basename.scale-240.png'); 64 | 65 | expect(testImage.generateFilenameFrom('NewName')).toMatch(/\.scale-240\.png$/); 66 | expect(testImage.generateFilenameFrom('NewName.with.dots-and-dashes')).toMatch(/\.scale-240\.png$/); 67 | }); 68 | }); 69 | }); 70 | -------------------------------------------------------------------------------- /spec/unit/clean.spec.js: -------------------------------------------------------------------------------- 1 | var shell = require('shelljs'); 2 | var path = require('path'); 3 | var fs = require('fs'); 4 | var prepareModule = require('../../template/cordova/lib/prepare'); 5 | var DUMMY_PROJECT_PATH = path.join(__dirname, '/fixtures/DummyProject'); 6 | var iconPath; 7 | var currentProject; 8 | 9 | describe('Cordova clean command', function () { 10 | beforeEach(function () { 11 | shell.cp('-rf', DUMMY_PROJECT_PATH, __dirname); 12 | currentProject = path.join(__dirname, 'DummyProject'); 13 | iconPath = path.join(currentProject, 'images/SplashScreen.scale-100.png'); 14 | 15 | var fsExistsSyncOrig = fs.existsSync; 16 | spyOn(fs, 'existsSync').and.callFake(function (filePath) { 17 | if (/config\.xml$/.test(filePath)) return true; 18 | return fsExistsSyncOrig(filePath); 19 | }); 20 | var fsStatSyncOrig = fs.statSync; 21 | spyOn(fs, 'statSync').and.callFake(function (filePath) { 22 | if (/SplashScreen\.scale-100\.png$/.test(filePath)) { 23 | // Use absolute path: 24 | return fsStatSyncOrig(iconPath); 25 | } 26 | 27 | return fsStatSyncOrig(filePath); 28 | }); 29 | }); 30 | 31 | afterEach(function () { 32 | shell.rm('-rf', currentProject); 33 | }); 34 | 35 | it('spec 1. should remove icons when ran inside Cordova project', function () { 36 | var config = { 37 | platform: 'windows', 38 | root: currentProject, 39 | locations: { 40 | root: currentProject, 41 | configXml: path.join(currentProject, 'config.xml'), 42 | www: path.join(currentProject, 'www') 43 | } 44 | }; 45 | 46 | return prepareModule.clean.call(config) 47 | .then(function () { 48 | expect(fs.existsSync(iconPath)).toBeFalsy(); 49 | }); 50 | }); 51 | }); 52 | -------------------------------------------------------------------------------- /spec/unit/fixtures/DummyProject/AppPackages/CordovaApp.Phone_0.0.1.0_debug_Test/CordovaApp.Phone_0.0.1.0_AnyCPU_debug.appxbundle: -------------------------------------------------------------------------------- 1 | (dummy package) -------------------------------------------------------------------------------- /spec/unit/fixtures/DummyProject/AppPackages/CordovaApp.Windows_0.0.1.0_anycpu_debug_Test/CordovaApp.Windows_0.0.1.0_anycpu_debug.appx: -------------------------------------------------------------------------------- 1 | (dummy package) -------------------------------------------------------------------------------- /spec/unit/fixtures/DummyProject/CordovaApp.Windows10.jsproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | build\windows\$(Configuration)\$(Platform)\ 5 | build\windows\bld\ 6 | true 7 | 8 | 9 | 10 | Debug 11 | AnyCPU 12 | 13 | 14 | Debug 15 | ARM 16 | 17 | 18 | Debug 19 | x64 20 | 21 | 22 | Debug 23 | x86 24 | 25 | 26 | Release 27 | AnyCPU 28 | 29 | 30 | Release 31 | ARM 32 | 33 | 34 | Release 35 | x64 36 | 37 | 38 | Release 39 | x86 40 | 41 | 42 | 43 | f9b0ae20-c91c-42b9-9c6e-d3bc28b4509e 44 | 45 | 46 | 47 | 14.0 48 | 49 | 50 | 51 | 52 | UAP 53 | 10.0.10240.0 54 | 10.0.10240.0 55 | 14.0 56 | 57 | 58 | 10.0 59 | 10.0 60 | 61 | 62 | -------------------------------------------------------------------------------- /spec/unit/fixtures/DummyProject/CordovaApp.projitems: -------------------------------------------------------------------------------- 1 |  2 | 20 | 21 | 22 | $(MSBuildAllProjects);$(MSBuildThisFileFullPath) 23 | true 24 | 9ebdb27f-d75b-4d8c-b53f-7be4a1fe89f9 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /spec/unit/fixtures/DummyProject/CordovaApp.shproj: -------------------------------------------------------------------------------- 1 |  2 | 20 | 21 | 22 | {9ebdb27f-d75b-4d8c-b53f-7be4a1fe89f9} 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | -------------------------------------------------------------------------------- /spec/unit/fixtures/DummyProject/CordovaApp.vs2012.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 2012 4 | # 5 | # Licensed to the Apache Software Foundation (ASF) under one 6 | # or more contributor license agreements. See the NOTICE file 7 | # distributed with this work for additional information 8 | # regarding copyright ownership. The ASF licenses this file 9 | # to you under the Apache License, Version 2.0 (the 10 | # "License"); you may not use this file except in compliance 11 | # with the License. You may obtain a copy of the License at 12 | # 13 | # http://www.apache.org/licenses/LICENSE-2.0 14 | # 15 | # Unless required by applicable law or agreed to in writing, 16 | # software distributed under the License is distributed on an 17 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 18 | # KIND, either express or implied. See the License for the 19 | # specific language governing permissions and limitations 20 | # under the License. 21 | # 22 | Project("{262852C6-CD72-467D-83FE-5EEB1973A190}") = "CordovaApp.Windows8.0", "CordovaApp.Windows80.jsproj", "{EFFFAB2F-BFC5-4EDA-B545-45EF4995F55A}" 23 | EndProject 24 | Global 25 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 26 | Debug|AnyCPU = Debug|AnyCPU 27 | Debug|ARM = Debug|ARM 28 | Debug|x64 = Debug|x64 29 | Debug|x86 = Debug|x86 30 | Release|AnyCPU = Release|AnyCPU 31 | Release|ARM = Release|ARM 32 | Release|x64 = Release|x64 33 | Release|x86 = Release|x86 34 | EndGlobalSection 35 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 36 | {EFFFAB2F-BFC5-4EDA-B545-45EF4995F55A}.Debug|AnyCPU.ActiveCfg = Debug|Any CPU 37 | {EFFFAB2F-BFC5-4EDA-B545-45EF4995F55A}.Debug|AnyCPU.Build.0 = Debug|Any CPU 38 | {EFFFAB2F-BFC5-4EDA-B545-45EF4995F55A}.Debug|AnyCPU.Deploy.0 = Debug|Any CPU 39 | {EFFFAB2F-BFC5-4EDA-B545-45EF4995F55A}.Debug|ARM.ActiveCfg = Debug|ARM 40 | {EFFFAB2F-BFC5-4EDA-B545-45EF4995F55A}.Debug|ARM.Build.0 = Debug|ARM 41 | {EFFFAB2F-BFC5-4EDA-B545-45EF4995F55A}.Debug|ARM.Deploy.0 = Debug|ARM 42 | {EFFFAB2F-BFC5-4EDA-B545-45EF4995F55A}.Debug|x64.ActiveCfg = Debug|x64 43 | {EFFFAB2F-BFC5-4EDA-B545-45EF4995F55A}.Debug|x64.Build.0 = Debug|x64 44 | {EFFFAB2F-BFC5-4EDA-B545-45EF4995F55A}.Debug|x64.Deploy.0 = Debug|x64 45 | {EFFFAB2F-BFC5-4EDA-B545-45EF4995F55A}.Debug|x86.ActiveCfg = Debug|x86 46 | {EFFFAB2F-BFC5-4EDA-B545-45EF4995F55A}.Debug|x86.Build.0 = Debug|x86 47 | {EFFFAB2F-BFC5-4EDA-B545-45EF4995F55A}.Debug|x86.Deploy.0 = Debug|x86 48 | {EFFFAB2F-BFC5-4EDA-B545-45EF4995F55A}.Release|AnyCPU.ActiveCfg = Release|Any CPU 49 | {EFFFAB2F-BFC5-4EDA-B545-45EF4995F55A}.Release|AnyCPU.Build.0 = Release|Any CPU 50 | {EFFFAB2F-BFC5-4EDA-B545-45EF4995F55A}.Release|AnyCPU.Deploy.0 = Release|Any CPU 51 | {EFFFAB2F-BFC5-4EDA-B545-45EF4995F55A}.Release|ARM.ActiveCfg = Release|ARM 52 | {EFFFAB2F-BFC5-4EDA-B545-45EF4995F55A}.Release|ARM.Build.0 = Release|ARM 53 | {EFFFAB2F-BFC5-4EDA-B545-45EF4995F55A}.Release|ARM.Deploy.0 = Release|ARM 54 | {EFFFAB2F-BFC5-4EDA-B545-45EF4995F55A}.Release|x64.ActiveCfg = Release|x64 55 | {EFFFAB2F-BFC5-4EDA-B545-45EF4995F55A}.Release|x64.Build.0 = Release|x64 56 | {EFFFAB2F-BFC5-4EDA-B545-45EF4995F55A}.Release|x64.Deploy.0 = Release|x64 57 | {EFFFAB2F-BFC5-4EDA-B545-45EF4995F55A}.Release|x86.ActiveCfg = Release|x86 58 | {EFFFAB2F-BFC5-4EDA-B545-45EF4995F55A}.Release|x86.Build.0 = Release|x86 59 | {EFFFAB2F-BFC5-4EDA-B545-45EF4995F55A}.Release|x86.Deploy.0 = Release|x86 60 | EndGlobalSection 61 | GlobalSection(SolutionProperties) = preSolution 62 | HideSolutionNode = FALSE 63 | EndGlobalSection 64 | EndGlobal 65 | -------------------------------------------------------------------------------- /spec/unit/fixtures/DummyProject/CordovaApp_TemporaryKey.pfx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/cordova-windows/5e7f2ac9795600dab4ae7ffebd53bbda96bc2386/spec/unit/fixtures/DummyProject/CordovaApp_TemporaryKey.pfx -------------------------------------------------------------------------------- /spec/unit/fixtures/DummyProject/VERSION: -------------------------------------------------------------------------------- 1 | 3.7.1 2 | -------------------------------------------------------------------------------- /spec/unit/fixtures/DummyProject/config.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CordovaApp 6 | 7 | A sample Apache Cordova application that responds to the deviceready event. 8 | 9 | 10 | Apache Cordova Team 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /spec/unit/fixtures/DummyProject/images/SplashScreen.scale-100.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/cordova-windows/5e7f2ac9795600dab4ae7ffebd53bbda96bc2386/spec/unit/fixtures/DummyProject/images/SplashScreen.scale-100.png -------------------------------------------------------------------------------- /spec/unit/fixtures/DummyProject/package.phone.appxmanifest: -------------------------------------------------------------------------------- 1 |  2 | 20 | 21 | 22 | 23 | 24 | CordovaApp 25 | $username$ 26 | images\StoreLogo.png 27 | 28 | 29 | 6.3.1 30 | 6.3.1 31 | 32 | 33 | 34 | 35 | 36 | 37 | 43 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | -------------------------------------------------------------------------------- /spec/unit/fixtures/DummyProject/package.windows.appxmanifest: -------------------------------------------------------------------------------- 1 |  2 | 20 | 21 | 22 | 23 | CordovaApp 24 | $username$ 25 | images\StoreLogo.png 26 | 27 | 28 | 6.3.0 29 | 6.3.0 30 | 31 | 32 | 33 | 34 | 35 | 36 | 42 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | -------------------------------------------------------------------------------- /spec/unit/fixtures/DummyProject/package.windows80.appxmanifest: -------------------------------------------------------------------------------- 1 |  2 | 20 | 21 | 22 | 23 | CordovaApp 24 | $username$ 25 | images\storelogo.png 26 | 27 | 28 | 6.2.1 29 | 6.2.1 30 | 31 | 32 | 33 | 34 | 35 | 36 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | -------------------------------------------------------------------------------- /spec/unit/fixtures/fakeBuildConfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "windows": { 3 | "debug": { 4 | "packageCertificateKeyFile": "some/path", 5 | "packageThumbprint": "thumbprint", 6 | "publisherId": "CN=Publisher, O=Id" 7 | } 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /spec/unit/fixtures/org.test.configtest/plugin.xml: -------------------------------------------------------------------------------- 1 | 2 | 20 | 21 | 25 | 26 | Does Code Fil Write Even Work? Hopefully the Tests Will Tell Us 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | -------------------------------------------------------------------------------- /spec/unit/fixtures/org.test.plugins.capabilityplugin/plugin.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | org.test.plugins.capabilityplugin 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /spec/unit/fixtures/org.test.plugins.capabilityplugin/www/org.test.plugins.capabilityplugin.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/cordova-windows/5e7f2ac9795600dab4ae7ffebd53bbda96bc2386/spec/unit/fixtures/org.test.plugins.capabilityplugin/www/org.test.plugins.capabilityplugin.js -------------------------------------------------------------------------------- /spec/unit/fixtures/org.test.plugins.dummyplugin/plugin.xml: -------------------------------------------------------------------------------- 1 | 2 | 20 | 21 | 25 | 26 | 27 | dummyplugin 28 | 29 | my description 30 | Jackson Badman 31 | dummy,plugin 32 | BSD 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | -------------------------------------------------------------------------------- /spec/unit/fixtures/org.test.plugins.dummyplugin/src/windows/dummer.js: -------------------------------------------------------------------------------- 1 | ./org.test.plugins.dummyplugin/src/windows8/dummer.js 2 | -------------------------------------------------------------------------------- /spec/unit/fixtures/org.test.plugins.dummyplugin/src/windows/dummy1.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/cordova-windows/5e7f2ac9795600dab4ae7ffebd53bbda96bc2386/spec/unit/fixtures/org.test.plugins.dummyplugin/src/windows/dummy1.dll -------------------------------------------------------------------------------- /spec/unit/fixtures/org.test.plugins.dummyplugin/src/windows/dummy1.vcxproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | {ef7dd979-6f12-4bdf-8754-9468ce799c4d} 5 | dummy1 6 | 7 | 8 | -------------------------------------------------------------------------------- /spec/unit/fixtures/org.test.plugins.dummyplugin/src/windows/dummy2.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/cordova-windows/5e7f2ac9795600dab4ae7ffebd53bbda96bc2386/spec/unit/fixtures/org.test.plugins.dummyplugin/src/windows/dummy2.dll -------------------------------------------------------------------------------- /spec/unit/fixtures/org.test.plugins.dummyplugin/src/windows/dummy2.vcxproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | {6a760eea-8c27-442e-b98b-a487964ded42} 5 | dummy2 6 | 7 | 8 | -------------------------------------------------------------------------------- /spec/unit/fixtures/org.test.plugins.dummyplugin/src/windows/dummy3.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/cordova-windows/5e7f2ac9795600dab4ae7ffebd53bbda96bc2386/spec/unit/fixtures/org.test.plugins.dummyplugin/src/windows/dummy3.dll -------------------------------------------------------------------------------- /spec/unit/fixtures/org.test.plugins.dummyplugin/src/windows/dummy3.vcxproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | {5318c3c8-0921-4870-b4ad-8cce06c88238} 5 | dummy3 6 | 7 | 8 | -------------------------------------------------------------------------------- /spec/unit/fixtures/org.test.plugins.dummyplugin/src/windows/dummy4.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/cordova-windows/5e7f2ac9795600dab4ae7ffebd53bbda96bc2386/spec/unit/fixtures/org.test.plugins.dummyplugin/src/windows/dummy4.dll -------------------------------------------------------------------------------- /spec/unit/fixtures/org.test.plugins.dummyplugin/src/windows/dummy4.vcxproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | {8e430a1b-094b-4c27-8b76-fdd7021dbfe9} 5 | dummy4 6 | 7 | 8 | -------------------------------------------------------------------------------- /spec/unit/fixtures/org.test.plugins.dummyplugin/src/windows/dummy5.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/cordova-windows/5e7f2ac9795600dab4ae7ffebd53bbda96bc2386/spec/unit/fixtures/org.test.plugins.dummyplugin/src/windows/dummy5.dll -------------------------------------------------------------------------------- /spec/unit/fixtures/org.test.plugins.dummyplugin/src/windows/dummy6.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/cordova-windows/5e7f2ac9795600dab4ae7ffebd53bbda96bc2386/spec/unit/fixtures/org.test.plugins.dummyplugin/src/windows/dummy6.dll -------------------------------------------------------------------------------- /spec/unit/fixtures/org.test.plugins.dummyplugin/src/windows/text_sample1.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/cordova-windows/5e7f2ac9795600dab4ae7ffebd53bbda96bc2386/spec/unit/fixtures/org.test.plugins.dummyplugin/src/windows/text_sample1.txt -------------------------------------------------------------------------------- /spec/unit/fixtures/org.test.plugins.dummyplugin/src/windows/text_sample2.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/cordova-windows/5e7f2ac9795600dab4ae7ffebd53bbda96bc2386/spec/unit/fixtures/org.test.plugins.dummyplugin/src/windows/text_sample2.txt -------------------------------------------------------------------------------- /spec/unit/fixtures/org.test.plugins.dummyplugin/src/windows/text_sample3.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/cordova-windows/5e7f2ac9795600dab4ae7ffebd53bbda96bc2386/spec/unit/fixtures/org.test.plugins.dummyplugin/src/windows/text_sample3.txt -------------------------------------------------------------------------------- /spec/unit/fixtures/org.test.plugins.dummyplugin/src/windows/text_sample4.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/cordova-windows/5e7f2ac9795600dab4ae7ffebd53bbda96bc2386/spec/unit/fixtures/org.test.plugins.dummyplugin/src/windows/text_sample4.txt -------------------------------------------------------------------------------- /spec/unit/fixtures/org.test.plugins.dummyplugin/www/dummyplugin.js: -------------------------------------------------------------------------------- 1 | ./org.test.plugins.dummyplugin/www/dummyplugin.js 2 | -------------------------------------------------------------------------------- /spec/unit/fixtures/org.test.plugins.dummyplugin/www/dummyplugin/image.jpg: -------------------------------------------------------------------------------- 1 | ./org.test.plugins.dummyplugin/www/dummyplugin/image.jpg 2 | -------------------------------------------------------------------------------- /spec/unit/fixtures/org.test.plugins.extensionsplugin/plugin.xml: -------------------------------------------------------------------------------- 1 | 2 | 20 | 21 | 25 | 26 | 27 | extensionsplugin 28 | 29 | my description 30 | Jackson Badman 31 | extensions,plugin 32 | BSD 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | Foo.dll 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | -------------------------------------------------------------------------------- /spec/unit/fixtures/org.test.plugins.extensionsplugin/src/windows/Foo.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/cordova-windows/5e7f2ac9795600dab4ae7ffebd53bbda96bc2386/spec/unit/fixtures/org.test.plugins.extensionsplugin/src/windows/Foo.dll -------------------------------------------------------------------------------- /spec/unit/fixtures/org.test.plugins.faultyplugin/plugin.xml: -------------------------------------------------------------------------------- 1 | 2 | 20 | 21 | 25 | 26 | Faulty Plugin 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | -------------------------------------------------------------------------------- /spec/unit/fixtures/org.test.plugins.faultyplugin/src/windows/faultyPlugin.js: -------------------------------------------------------------------------------- 1 | ./org.test.plugins.faultyplugin/src/windows8/faultyPlugin.js 2 | -------------------------------------------------------------------------------- /spec/unit/fixtures/org.test.plugins.faultyplugin/src/windows/text_sample1.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/cordova-windows/5e7f2ac9795600dab4ae7ffebd53bbda96bc2386/spec/unit/fixtures/org.test.plugins.faultyplugin/src/windows/text_sample1.txt -------------------------------------------------------------------------------- /spec/unit/fixtures/org.test.plugins.faultyplugin/src/windows/text_sample2.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/cordova-windows/5e7f2ac9795600dab4ae7ffebd53bbda96bc2386/spec/unit/fixtures/org.test.plugins.faultyplugin/src/windows/text_sample2.txt -------------------------------------------------------------------------------- /spec/unit/fixtures/org.test.plugins.faultyplugin/src/windows/text_sample3.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/cordova-windows/5e7f2ac9795600dab4ae7ffebd53bbda96bc2386/spec/unit/fixtures/org.test.plugins.faultyplugin/src/windows/text_sample3.txt -------------------------------------------------------------------------------- /spec/unit/fixtures/org.test.plugins.resourcereferenceplugin/plugin.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | org.test.plugins.resourcereferenceplugin 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /spec/unit/fixtures/org.test.plugins.resourcereferenceplugin/src/windows/dummy1.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "dummy1" 3 | } 4 | -------------------------------------------------------------------------------- /spec/unit/fixtures/org.test.plugins.resourcereferenceplugin/src/windows/dummy2.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "dummy2" 3 | } 4 | -------------------------------------------------------------------------------- /spec/unit/fixtures/org.test.plugins.resourcereferenceplugin/src/windows/dummy3.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "dummy3" 3 | } 4 | -------------------------------------------------------------------------------- /spec/unit/fixtures/org.test.plugins.resourcereferenceplugin/src/windows/dummy4.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "dummy4" 3 | } 4 | -------------------------------------------------------------------------------- /spec/unit/fixtures/testProj/platforms/windows/AppPackages/CordovaApp.Phone_0.0.1.0_debug_Test/CordovaApp.Phone_0.0.1.0_AnyCPU_debug.appxbundle: -------------------------------------------------------------------------------- 1 | (dummy package) -------------------------------------------------------------------------------- /spec/unit/fixtures/testProj/platforms/windows/AppPackages/CordovaApp.Windows_0.0.1.0_anycpu_debug_Test/CordovaApp.Windows_0.0.1.0_anycpu_debug.appx: -------------------------------------------------------------------------------- 1 | (dummy package) -------------------------------------------------------------------------------- /spec/unit/fixtures/testProj/platforms/windows/CordovaApp.Windows10.jsproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | build\windows\$(Configuration)\$(Platform)\ 5 | build\windows\bld\ 6 | true 7 | 8 | 9 | 10 | Debug 11 | AnyCPU 12 | 13 | 14 | Debug 15 | ARM 16 | 17 | 18 | Debug 19 | x64 20 | 21 | 22 | Debug 23 | x86 24 | 25 | 26 | Release 27 | AnyCPU 28 | 29 | 30 | Release 31 | ARM 32 | 33 | 34 | Release 35 | x64 36 | 37 | 38 | Release 39 | x86 40 | 41 | 42 | 43 | f9b0ae20-c91c-42b9-9c6e-d3bc28b4509e 44 | 45 | 46 | 47 | 14.0 48 | 49 | 50 | 51 | 52 | UAP 53 | 10.0.10240.0 54 | 10.0.10240.0 55 | 14.0 56 | 57 | 58 | 10.0 59 | 10.0 60 | 61 | 62 | -------------------------------------------------------------------------------- /spec/unit/fixtures/testProj/platforms/windows/CordovaApp.projitems: -------------------------------------------------------------------------------- 1 |  2 | 20 | 21 | 22 | $(MSBuildAllProjects);$(MSBuildThisFileFullPath) 23 | true 24 | 9ebdb27f-d75b-4d8c-b53f-7be4a1fe89f9 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /spec/unit/fixtures/testProj/platforms/windows/CordovaApp.shproj: -------------------------------------------------------------------------------- 1 |  2 | 20 | 21 | 22 | {9ebdb27f-d75b-4d8c-b53f-7be4a1fe89f9} 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | -------------------------------------------------------------------------------- /spec/unit/fixtures/testProj/platforms/windows/CordovaApp.vs2012.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 2012 4 | # 5 | # Licensed to the Apache Software Foundation (ASF) under one 6 | # or more contributor license agreements. See the NOTICE file 7 | # distributed with this work for additional information 8 | # regarding copyright ownership. The ASF licenses this file 9 | # to you under the Apache License, Version 2.0 (the 10 | # "License"); you may not use this file except in compliance 11 | # with the License. You may obtain a copy of the License at 12 | # 13 | # http://www.apache.org/licenses/LICENSE-2.0 14 | # 15 | # Unless required by applicable law or agreed to in writing, 16 | # software distributed under the License is distributed on an 17 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 18 | # KIND, either express or implied. See the License for the 19 | # specific language governing permissions and limitations 20 | # under the License. 21 | # 22 | Project("{262852C6-CD72-467D-83FE-5EEB1973A190}") = "CordovaApp.Windows8.0", "CordovaApp.Windows80.jsproj", "{EFFFAB2F-BFC5-4EDA-B545-45EF4995F55A}" 23 | EndProject 24 | Global 25 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 26 | Debug|AnyCPU = Debug|AnyCPU 27 | Debug|ARM = Debug|ARM 28 | Debug|x64 = Debug|x64 29 | Debug|x86 = Debug|x86 30 | Release|AnyCPU = Release|AnyCPU 31 | Release|ARM = Release|ARM 32 | Release|x64 = Release|x64 33 | Release|x86 = Release|x86 34 | EndGlobalSection 35 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 36 | {EFFFAB2F-BFC5-4EDA-B545-45EF4995F55A}.Debug|AnyCPU.ActiveCfg = Debug|Any CPU 37 | {EFFFAB2F-BFC5-4EDA-B545-45EF4995F55A}.Debug|AnyCPU.Build.0 = Debug|Any CPU 38 | {EFFFAB2F-BFC5-4EDA-B545-45EF4995F55A}.Debug|AnyCPU.Deploy.0 = Debug|Any CPU 39 | {EFFFAB2F-BFC5-4EDA-B545-45EF4995F55A}.Debug|ARM.ActiveCfg = Debug|ARM 40 | {EFFFAB2F-BFC5-4EDA-B545-45EF4995F55A}.Debug|ARM.Build.0 = Debug|ARM 41 | {EFFFAB2F-BFC5-4EDA-B545-45EF4995F55A}.Debug|ARM.Deploy.0 = Debug|ARM 42 | {EFFFAB2F-BFC5-4EDA-B545-45EF4995F55A}.Debug|x64.ActiveCfg = Debug|x64 43 | {EFFFAB2F-BFC5-4EDA-B545-45EF4995F55A}.Debug|x64.Build.0 = Debug|x64 44 | {EFFFAB2F-BFC5-4EDA-B545-45EF4995F55A}.Debug|x64.Deploy.0 = Debug|x64 45 | {EFFFAB2F-BFC5-4EDA-B545-45EF4995F55A}.Debug|x86.ActiveCfg = Debug|x86 46 | {EFFFAB2F-BFC5-4EDA-B545-45EF4995F55A}.Debug|x86.Build.0 = Debug|x86 47 | {EFFFAB2F-BFC5-4EDA-B545-45EF4995F55A}.Debug|x86.Deploy.0 = Debug|x86 48 | {EFFFAB2F-BFC5-4EDA-B545-45EF4995F55A}.Release|AnyCPU.ActiveCfg = Release|Any CPU 49 | {EFFFAB2F-BFC5-4EDA-B545-45EF4995F55A}.Release|AnyCPU.Build.0 = Release|Any CPU 50 | {EFFFAB2F-BFC5-4EDA-B545-45EF4995F55A}.Release|AnyCPU.Deploy.0 = Release|Any CPU 51 | {EFFFAB2F-BFC5-4EDA-B545-45EF4995F55A}.Release|ARM.ActiveCfg = Release|ARM 52 | {EFFFAB2F-BFC5-4EDA-B545-45EF4995F55A}.Release|ARM.Build.0 = Release|ARM 53 | {EFFFAB2F-BFC5-4EDA-B545-45EF4995F55A}.Release|ARM.Deploy.0 = Release|ARM 54 | {EFFFAB2F-BFC5-4EDA-B545-45EF4995F55A}.Release|x64.ActiveCfg = Release|x64 55 | {EFFFAB2F-BFC5-4EDA-B545-45EF4995F55A}.Release|x64.Build.0 = Release|x64 56 | {EFFFAB2F-BFC5-4EDA-B545-45EF4995F55A}.Release|x64.Deploy.0 = Release|x64 57 | {EFFFAB2F-BFC5-4EDA-B545-45EF4995F55A}.Release|x86.ActiveCfg = Release|x86 58 | {EFFFAB2F-BFC5-4EDA-B545-45EF4995F55A}.Release|x86.Build.0 = Release|x86 59 | {EFFFAB2F-BFC5-4EDA-B545-45EF4995F55A}.Release|x86.Deploy.0 = Release|x86 60 | EndGlobalSection 61 | GlobalSection(SolutionProperties) = preSolution 62 | HideSolutionNode = FALSE 63 | EndGlobalSection 64 | EndGlobal 65 | -------------------------------------------------------------------------------- /spec/unit/fixtures/testProj/platforms/windows/CordovaApp_TemporaryKey.pfx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/cordova-windows/5e7f2ac9795600dab4ae7ffebd53bbda96bc2386/spec/unit/fixtures/testProj/platforms/windows/CordovaApp_TemporaryKey.pfx -------------------------------------------------------------------------------- /spec/unit/fixtures/testProj/platforms/windows/VERSION: -------------------------------------------------------------------------------- 1 | 3.7.1 2 | -------------------------------------------------------------------------------- /spec/unit/fixtures/testProj/platforms/windows/config.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CordovaApp 6 | 7 | A sample Apache Cordova application that responds to the deviceready event. 8 | 9 | 10 | Apache Cordova Team 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /spec/unit/fixtures/testProj/platforms/windows/package.phone.appxmanifest: -------------------------------------------------------------------------------- 1 |  2 | 20 | 21 | 22 | 23 | 24 | CordovaApp 25 | $username$ 26 | images\StoreLogo.png 27 | 28 | 29 | 6.3.1 30 | 6.3.1 31 | 32 | 33 | 34 | 35 | 36 | 37 | 43 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | -------------------------------------------------------------------------------- /spec/unit/fixtures/testProj/platforms/windows/package.windows.appxmanifest: -------------------------------------------------------------------------------- 1 |  2 | 20 | 21 | 22 | 23 | CordovaApp 24 | $username$ 25 | images\StoreLogo.png 26 | 27 | 28 | 6.3.0 29 | 6.3.0 30 | 31 | 32 | 33 | 34 | 35 | 36 | 42 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | -------------------------------------------------------------------------------- /spec/unit/fixtures/testProj/platforms/windows/package.windows10.appxmanifest: -------------------------------------------------------------------------------- 1 | 2 | 20 | 25 | 26 | 30 | 31 | 32 | 33 | 34 | $projectname$ 35 | $username$ 36 | images\StoreLogo.png 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 51 | 52 | 58 | 59 | 60 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | -------------------------------------------------------------------------------- /spec/unit/fixtures/testProj/platforms/windows/package.windows80.appxmanifest: -------------------------------------------------------------------------------- 1 |  2 | 20 | 21 | 22 | 23 | CordovaApp 24 | $username$ 25 | images\storelogo.png 26 | 27 | 28 | 6.2.1 29 | 6.2.1 30 | 31 | 32 | 33 | 34 | 35 | 36 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | -------------------------------------------------------------------------------- /spec/unit/fixtures/testProj/plugins/org.test.plugins.dummyplugin/plugin.xml: -------------------------------------------------------------------------------- 1 | 2 | 20 | 21 | 25 | 26 | 27 | dummyplugin 28 | 29 | my description 30 | Jackson Badman 31 | dummy,plugin 32 | BSD 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | -------------------------------------------------------------------------------- /spec/unit/fixtures/testProj/plugins/org.test.plugins.dummyplugin/src/windows/dummer.js: -------------------------------------------------------------------------------- 1 | ./org.test.plugins.dummyplugin/src/windows8/dummer.js 2 | -------------------------------------------------------------------------------- /spec/unit/fixtures/testProj/plugins/org.test.plugins.dummyplugin/src/windows/dummy1.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/cordova-windows/5e7f2ac9795600dab4ae7ffebd53bbda96bc2386/spec/unit/fixtures/testProj/plugins/org.test.plugins.dummyplugin/src/windows/dummy1.dll -------------------------------------------------------------------------------- /spec/unit/fixtures/testProj/plugins/org.test.plugins.dummyplugin/src/windows/dummy1.vcxproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | {ef7dd979-6f12-4bdf-8754-9468ce799c4d} 5 | dummy1 6 | 7 | 8 | -------------------------------------------------------------------------------- /spec/unit/fixtures/testProj/plugins/org.test.plugins.dummyplugin/src/windows/dummy2.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/cordova-windows/5e7f2ac9795600dab4ae7ffebd53bbda96bc2386/spec/unit/fixtures/testProj/plugins/org.test.plugins.dummyplugin/src/windows/dummy2.dll -------------------------------------------------------------------------------- /spec/unit/fixtures/testProj/plugins/org.test.plugins.dummyplugin/src/windows/dummy2.vcxproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | {6a760eea-8c27-442e-b98b-a487964ded42} 5 | dummy2 6 | 7 | 8 | -------------------------------------------------------------------------------- /spec/unit/fixtures/testProj/plugins/org.test.plugins.dummyplugin/src/windows/dummy3.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/cordova-windows/5e7f2ac9795600dab4ae7ffebd53bbda96bc2386/spec/unit/fixtures/testProj/plugins/org.test.plugins.dummyplugin/src/windows/dummy3.dll -------------------------------------------------------------------------------- /spec/unit/fixtures/testProj/plugins/org.test.plugins.dummyplugin/src/windows/dummy3.vcxproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | {5318c3c8-0921-4870-b4ad-8cce06c88238} 5 | dummy3 6 | 7 | 8 | -------------------------------------------------------------------------------- /spec/unit/fixtures/testProj/plugins/org.test.plugins.dummyplugin/src/windows/dummy4.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/cordova-windows/5e7f2ac9795600dab4ae7ffebd53bbda96bc2386/spec/unit/fixtures/testProj/plugins/org.test.plugins.dummyplugin/src/windows/dummy4.dll -------------------------------------------------------------------------------- /spec/unit/fixtures/testProj/plugins/org.test.plugins.dummyplugin/src/windows/dummy4.vcxproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | {8e430a1b-094b-4c27-8b76-fdd7021dbfe9} 5 | dummy4 6 | 7 | 8 | -------------------------------------------------------------------------------- /spec/unit/fixtures/testProj/plugins/org.test.plugins.dummyplugin/src/windows/dummy5.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/cordova-windows/5e7f2ac9795600dab4ae7ffebd53bbda96bc2386/spec/unit/fixtures/testProj/plugins/org.test.plugins.dummyplugin/src/windows/dummy5.dll -------------------------------------------------------------------------------- /spec/unit/fixtures/testProj/plugins/org.test.plugins.dummyplugin/src/windows/dummy6.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/cordova-windows/5e7f2ac9795600dab4ae7ffebd53bbda96bc2386/spec/unit/fixtures/testProj/plugins/org.test.plugins.dummyplugin/src/windows/dummy6.dll -------------------------------------------------------------------------------- /spec/unit/fixtures/testProj/plugins/org.test.plugins.dummyplugin/src/windows/text_sample1.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/cordova-windows/5e7f2ac9795600dab4ae7ffebd53bbda96bc2386/spec/unit/fixtures/testProj/plugins/org.test.plugins.dummyplugin/src/windows/text_sample1.txt -------------------------------------------------------------------------------- /spec/unit/fixtures/testProj/plugins/org.test.plugins.dummyplugin/src/windows/text_sample2.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/cordova-windows/5e7f2ac9795600dab4ae7ffebd53bbda96bc2386/spec/unit/fixtures/testProj/plugins/org.test.plugins.dummyplugin/src/windows/text_sample2.txt -------------------------------------------------------------------------------- /spec/unit/fixtures/testProj/plugins/org.test.plugins.dummyplugin/src/windows/text_sample3.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/cordova-windows/5e7f2ac9795600dab4ae7ffebd53bbda96bc2386/spec/unit/fixtures/testProj/plugins/org.test.plugins.dummyplugin/src/windows/text_sample3.txt -------------------------------------------------------------------------------- /spec/unit/fixtures/testProj/plugins/org.test.plugins.dummyplugin/src/windows/text_sample4.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/cordova-windows/5e7f2ac9795600dab4ae7ffebd53bbda96bc2386/spec/unit/fixtures/testProj/plugins/org.test.plugins.dummyplugin/src/windows/text_sample4.txt -------------------------------------------------------------------------------- /spec/unit/fixtures/testProj/plugins/org.test.plugins.dummyplugin/www/dummyplugin.js: -------------------------------------------------------------------------------- 1 | ./org.test.plugins.dummyplugin/www/dummyplugin.js 2 | -------------------------------------------------------------------------------- /spec/unit/fixtures/testProj/plugins/org.test.plugins.dummyplugin/www/dummyplugin/image.jpg: -------------------------------------------------------------------------------- 1 | ./org.test.plugins.dummyplugin/www/dummyplugin/image.jpg 2 | -------------------------------------------------------------------------------- /spec/unit/fixtures/testProj/plugins/testPlugin/plugin.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | testPlugin 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /spec/unit/fixtures/testProj/plugins/testPlugin/src/deps/ARM/arm.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/cordova-windows/5e7f2ac9795600dab4ae7ffebd53bbda96bc2386/spec/unit/fixtures/testProj/plugins/testPlugin/src/deps/ARM/arm.dll -------------------------------------------------------------------------------- /spec/unit/fixtures/testProj/plugins/testPlugin/src/deps/ARM/arm.winmd: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/cordova-windows/5e7f2ac9795600dab4ae7ffebd53bbda96bc2386/spec/unit/fixtures/testProj/plugins/testPlugin/src/deps/ARM/arm.winmd -------------------------------------------------------------------------------- /spec/unit/fixtures/testProj/plugins/testPlugin/src/deps/x64/x64.UWP.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/cordova-windows/5e7f2ac9795600dab4ae7ffebd53bbda96bc2386/spec/unit/fixtures/testProj/plugins/testPlugin/src/deps/x64/x64.UWP.dll -------------------------------------------------------------------------------- /spec/unit/fixtures/testProj/plugins/testPlugin/src/deps/x64/x64.winmd: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/cordova-windows/5e7f2ac9795600dab4ae7ffebd53bbda96bc2386/spec/unit/fixtures/testProj/plugins/testPlugin/src/deps/x64/x64.winmd -------------------------------------------------------------------------------- /spec/unit/fixtures/testProj/plugins/testPlugin/src/deps/x86/x86.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/cordova-windows/5e7f2ac9795600dab4ae7ffebd53bbda96bc2386/spec/unit/fixtures/testProj/plugins/testPlugin/src/deps/x86/x86.dll -------------------------------------------------------------------------------- /spec/unit/fixtures/testProj/plugins/testPlugin/src/deps/x86/x86.winmd: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/cordova-windows/5e7f2ac9795600dab4ae7ffebd53bbda96bc2386/spec/unit/fixtures/testProj/plugins/testPlugin/src/deps/x86/x86.winmd -------------------------------------------------------------------------------- /template/CordovaApp.projitems: -------------------------------------------------------------------------------- 1 |  2 | 20 | 21 | 22 | $(MSBuildAllProjects);$(MSBuildThisFileFullPath) 23 | true 24 | 9ebdb27f-d75b-4d8c-b53f-7be4a1fe89f9 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | -------------------------------------------------------------------------------- /template/CordovaApp.shproj: -------------------------------------------------------------------------------- 1 |  2 | 20 | 21 | 22 | {9ebdb27f-d75b-4d8c-b53f-7be4a1fe89f9} 23 | 24 | 25 | 26 | Debug 27 | AnyCPU 28 | 29 | 30 | Debug 31 | ARM 32 | 33 | 34 | Debug 35 | x64 36 | 37 | 38 | Debug 39 | x86 40 | 41 | 42 | Release 43 | AnyCPU 44 | 45 | 46 | Release 47 | ARM 48 | 49 | 50 | Release 51 | x64 52 | 53 | 54 | Release 55 | x86 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | -------------------------------------------------------------------------------- /template/CordovaApp_TemporaryKey.pfx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/cordova-windows/5e7f2ac9795600dab4ae7ffebd53bbda96bc2386/template/CordovaApp_TemporaryKey.pfx -------------------------------------------------------------------------------- /template/Properties/Default.rd.xml: -------------------------------------------------------------------------------- 1 | 42 | 43 | 44 | 45 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | -------------------------------------------------------------------------------- /template/config.xml: -------------------------------------------------------------------------------- 1 |  2 | 22 | 23 | HelloCordova 24 | 25 | A sample Apache Cordova application that responds to the deviceready event. 26 | 27 | 28 | Apache Cordova Team 29 | 30 | 31 | -------------------------------------------------------------------------------- /template/cordova/build: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env node 2 | 3 | /* 4 | Licensed to the Apache Software Foundation (ASF) under one 5 | or more contributor license agreements. See the NOTICE file 6 | distributed with this work for additional information 7 | regarding copyright ownership. The ASF licenses this file 8 | to you under the Apache License, Version 2.0 (the 9 | "License"); you may not use this file except in compliance 10 | with the License. You may obtain a copy of the License at 11 | 12 | http://www.apache.org/licenses/LICENSE-2.0 13 | 14 | Unless required by applicable law or agreed to in writing, 15 | software distributed under the License is distributed on an 16 | "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 17 | KIND, either express or implied. See the License for the 18 | specific language governing permissions and limitations 19 | under the License. 20 | */ 21 | 22 | var Api = require('./Api'); 23 | var nopt = require('nopt'); 24 | var path = require('path'); 25 | 26 | // Support basic help commands 27 | if (['--help', '/?', '-h', 'help', '-help', '/help'].indexOf(process.argv[2]) >= 0) { 28 | console.log(''); 29 | console.log('Usage: build [--debug | --release] [--phone | --win] [--bundle]'); 30 | console.log(' [--archs=""'); 31 | console.log(' [--packageCertificateKeyFile="key path"]'); 32 | console.log(' [--packageThumbprint="thumbprint"] [--publisherId]'); 33 | console.log(' [--buildConfig="file path"]'); 34 | console.log(' --help : Displays this dialog.'); 35 | console.log(' --debug : Builds project in debug mode. (Default).'); 36 | console.log(' --release (-r) : Builds project in release mode.'); 37 | console.log(' --phone, --win : Specifies, what type of project to build.'); 38 | console.log(' --bundle : Tells the compiler to create a .appxbundle.'); 39 | console.log(' Bundling is disabled when `anycpu` is built.'); 40 | console.log(' --archs : Builds project binaries for specific chip'); 41 | console.log(' architectures (`anycpu`, `arm`, `x86`, `x64`).'); 42 | console.log(' Separate multiple choices with spaces and if'); 43 | console.log(' passing multiple choices, enclose with " ".'); 44 | console.log(' --appx=<8.1-win|8.1-phone|uap|uwp>'); 45 | console.log(' : Overrides windows-target-version to build'); 46 | console.log(' Windows 8.1, Windows Phone 8.1, or'); 47 | console.log(' Windows 10 Universal.'); 48 | console.log(' --packageCertificateKeyFile : Builds the project using provided certificate.'); 49 | console.log(' --packageThumbprint : Thumbprint associated with the certificate.'); 50 | console.log(' --publisherId : Sets publisher id field in manifest.'); 51 | console.log(' --buildConfig : Sets build settings from configuration file.'); 52 | console.log(' --buildFlag : Sets build flag to pass to MSBuild (can be specified multiple times)'); 53 | console.log(''); 54 | console.log('examples:'); 55 | console.log(' build '); 56 | console.log(' build --debug'); 57 | console.log(' build --release'); 58 | console.log(' build --release --archs="arm x86" --bundle'); 59 | console.log(' build --appx=8.1-phone -r'); 60 | console.log(' build --packageCertificateKeyFile="CordovaApp_TemporaryKey.pfx"'); 61 | console.log(' build --publisherId="CN=FakeCorp, C=US"'); 62 | console.log(' build --buildConfig="build.json"'); 63 | console.log(' build --buildFlag="/clp:Verbosity=normal" --buildFlag="/p:myBuildProperty=Foo"'); 64 | console.log(''); 65 | 66 | process.exit(0); 67 | } 68 | 69 | // Do some basic argument parsing 70 | var buildOpts = nopt({ 71 | silent: Boolean, 72 | verbose: Boolean, 73 | debug: Boolean, 74 | release: Boolean, 75 | nobuild: Boolean, 76 | buildConfig: path, 77 | buildFlag: [String, Array] 78 | }, { d: '--verbose', r: '--release' }); 79 | 80 | // Make buildOptions compatible with PlatformApi build method spec 81 | buildOpts.argv = buildOpts.argv.original; 82 | 83 | require('./lib/loggingHelper').adjustLoggerLevel(buildOpts); 84 | 85 | new Api().build(buildOpts).catch(err => { 86 | console.error(err); 87 | process.exit(2); 88 | }); 89 | -------------------------------------------------------------------------------- /template/cordova/build.bat: -------------------------------------------------------------------------------- 1 | :: Licensed to the Apache Software Foundation (ASF) under one 2 | :: or more contributor license agreements. See the NOTICE file 3 | :: distributed with this work for additional information 4 | :: regarding copyright ownership. The ASF licenses this file 5 | :: to you under the Apache License, Version 2.0 (the 6 | :: "License"); you may not use this file except in compliance 7 | :: with the License. You may obtain a copy of the License at 8 | :: 9 | :: http://www.apache.org/licenses/LICENSE-2.0 10 | :: 11 | :: Unless required by applicable law or agreed to in writing, 12 | :: software distributed under the License is distributed on an 13 | :: "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | :: KIND, either express or implied. See the License for the 15 | :: specific language governing permissions and limitations 16 | :: under the License 17 | @ECHO OFF 18 | SET script_path="%~dp0build" 19 | IF EXIST %script_path% ( 20 | node %script_path% %* 21 | ) ELSE ( 22 | ECHO. 23 | ECHO ERROR: Could not find 'build' script in 'cordova' folder, aborting...>&2 24 | EXIT /B 1 25 | ) -------------------------------------------------------------------------------- /template/cordova/clean: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env node 2 | 3 | /* 4 | Licensed to the Apache Software Foundation (ASF) under one 5 | or more contributor license agreements. See the NOTICE file 6 | distributed with this work for additional information 7 | regarding copyright ownership. The ASF licenses this file 8 | to you under the Apache License, Version 2.0 (the 9 | "License"); you may not use this file except in compliance 10 | with the License. You may obtain a copy of the License at 11 | 12 | http://www.apache.org/licenses/LICENSE-2.0 13 | 14 | Unless required by applicable law or agreed to in writing, 15 | software distributed under the License is distributed on an 16 | "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 17 | KIND, either express or implied. See the License for the 18 | specific language governing permissions and limitations 19 | under the License. 20 | */ 21 | 22 | var Api = require('./Api'); 23 | var nopt = require('nopt'); 24 | 25 | // Support basic help commands 26 | if (['--help', '/?', '-h', 'help', '-help', '/help'].indexOf(process.argv[2]) >= 0) { 27 | console.log('Usage: \n clean\n'); 28 | console.log('Cleans the project directory.'); 29 | process.exit(0); 30 | } 31 | 32 | // Do some basic argument parsing 33 | var opts = nopt({ 34 | verbose: Boolean, 35 | silent: Boolean 36 | }, { d: '--verbose' }); 37 | 38 | // Make buildOptions compatible with PlatformApi clean method spec 39 | opts.argv = opts.argv.original; 40 | 41 | // Skip cleaning prepared files when not invoking via cordova CLI. 42 | opts.noPrepare = true; 43 | 44 | require('./lib/loggingHelper').adjustLoggerLevel(opts); 45 | 46 | new Api().clean(opts) 47 | .catch(function (err) { 48 | console.error(err.stack); 49 | process.exit(2); 50 | }); 51 | -------------------------------------------------------------------------------- /template/cordova/clean.bat: -------------------------------------------------------------------------------- 1 | :: Licensed to the Apache Software Foundation (ASF) under one 2 | :: or more contributor license agreements. See the NOTICE file 3 | :: distributed with this work for additional information 4 | :: regarding copyright ownership. The ASF licenses this file 5 | :: to you under the Apache License, Version 2.0 (the 6 | :: "License"); you may not use this file except in compliance 7 | :: with the License. You may obtain a copy of the License at 8 | :: 9 | :: http://www.apache.org/licenses/LICENSE-2.0 10 | :: 11 | :: Unless required by applicable law or agreed to in writing, 12 | :: software distributed under the License is distributed on an 13 | :: "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | :: KIND, either express or implied. See the License for the 15 | :: specific language governing permissions and limitations 16 | :: under the License 17 | @ECHO OFF 18 | SET script_path="%~dp0clean" 19 | IF EXIST %script_path% ( 20 | node %script_path% %* 21 | ) ELSE ( 22 | ECHO. 23 | ECHO ERROR: Could not find 'clean' script in 'cordova' folder, aborting...>&2 24 | EXIT /B 1 25 | ) -------------------------------------------------------------------------------- /template/cordova/defaults.xml: -------------------------------------------------------------------------------- 1 | 2 | 22 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /template/cordova/lib/MRTImage.js: -------------------------------------------------------------------------------- 1 | /** 2 | Licensed to the Apache Software Foundation (ASF) under one 3 | or more contributor license agreements. See the NOTICE file 4 | distributed with this work for additional information 5 | regarding copyright ownership. The ASF licenses this file 6 | to you under the Apache License, Version 2.0 (the 7 | "License"); you may not use this file except in compliance 8 | with the License. You may obtain a copy of the License at 9 | 10 | http://www.apache.org/licenses/LICENSE-2.0 11 | 12 | Unless required by applicable law or agreed to in writing, 13 | software distributed under the License is distributed on an 14 | "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | KIND, either express or implied. See the License for the 16 | specific language governing permissions and limitations 17 | under the License. 18 | */ 19 | 20 | var path = require('path'); 21 | 22 | function MRTImage (filePath) { 23 | this.path = filePath; 24 | this.location = path.dirname(filePath); 25 | this.extension = path.extname(filePath); 26 | this.basename = path.basename(filePath, this.extension); 27 | // 'scale-100' is the default qualifier 28 | this.qualifiers = 'scale-100'; 29 | 30 | var nameParts = this.basename.split('.'); 31 | if (nameParts.length > 1) { 32 | // Qualifiers is the dotted segment in the file just before the file extension 33 | // If no such segment in filename, then qualifiers is empty string 34 | this.qualifiers = nameParts[nameParts.length - 1]; 35 | // Basename it everything before that segment 36 | this.basename = nameParts.slice(0, -1).join('.'); 37 | } 38 | } 39 | 40 | /** 41 | * Indicates whether the current instance is matches to another one 42 | * (base names and extensions are equal) 43 | * 44 | * @param {MRTImage} anotherImage Another instance of MRTImage class. 45 | * @returns {Boolean} True if the current instance is matches to another one 46 | */ 47 | MRTImage.prototype.matchesTo = function (anotherImage) { 48 | return anotherImage instanceof MRTImage && 49 | anotherImage.basename === this.basename && 50 | anotherImage.extension === this.extension; 51 | }; 52 | 53 | /** 54 | * Generates a new filename based on new base name for the file. for example 55 | * new MRTImage('myFileName.scale-400.png').replaceBaseName('otherFileName') 56 | * -> 'otherFileName.scale-400.png' 57 | * 58 | * @param {String} baseName A new base name to use 59 | * @returns {String} A new filename 60 | */ 61 | MRTImage.prototype.generateFilenameFrom = function (baseName) { 62 | return [baseName, this.qualifiers].join('.') + this.extension; 63 | }; 64 | 65 | module.exports = MRTImage; 66 | -------------------------------------------------------------------------------- /template/cordova/lib/PluginInfo.js: -------------------------------------------------------------------------------- 1 | /* 2 | Licensed to the Apache Software Foundation (ASF) under one 3 | or more contributor license agreements. See the NOTICE file 4 | distributed with this work for additional information 5 | regarding copyright ownership. The ASF licenses this file 6 | to you under the Apache License, Version 2.0 (the 7 | "License"); you may not use this file except in compliance 8 | with the License. You may obtain a copy of the License at 9 | 10 | http://www.apache.org/licenses/LICENSE-2.0 11 | 12 | Unless required by applicable law or agreed to in writing, 13 | software distributed under the License is distributed on an 14 | "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | KIND, either express or implied. See the License for the 16 | specific language governing permissions and limitations 17 | under the License. 18 | */ 19 | var CommonPluginInfo = require('cordova-common').PluginInfo; 20 | var AppxManifest = require('./AppxManifest'); 21 | 22 | /* 23 | A class for holidng the information currently stored in plugin.xml 24 | It's inherited from cordova-common's PluginInfo class 25 | In addition it overrides getConfigFiles, getEditConfigs, getFrameworks methods to use windows-specific logic 26 | */ 27 | function PluginInfo (dirname) { 28 | // We're not using `util.inherit' because original PluginInfo defines 29 | // its' methods inside of constructor 30 | CommonPluginInfo.apply(this, arguments); 31 | var parentGetConfigFiles = this.getConfigFiles; 32 | var parentGetEditConfigs = this.getEditConfigs; 33 | 34 | this.getEditConfigs = function (platform) { 35 | var editConfigs = parentGetEditConfigs(platform); 36 | return AppxManifest.processChanges(editConfigs); 37 | }; 38 | 39 | this.getConfigFiles = function (platform) { 40 | var configFiles = parentGetConfigFiles(platform); 41 | return AppxManifest.processChanges(configFiles); 42 | }; 43 | } 44 | 45 | exports.PluginInfo = PluginInfo; 46 | -------------------------------------------------------------------------------- /template/cordova/lib/Version.js: -------------------------------------------------------------------------------- 1 | /* 2 | Licensed to the Apache Software Foundation (ASF) under one 3 | or more contributor license agreements. See the NOTICE file 4 | distributed with this work for additional information 5 | regarding copyright ownership. The ASF licenses this file 6 | to you under the Apache License, Version 2.0 (the 7 | "License"); you may not use this file except in compliance 8 | with the License. You may obtain a copy of the License at 9 | 10 | http://www.apache.org/licenses/LICENSE-2.0 11 | 12 | Unless required by applicable law or agreed to in writing, 13 | software distributed under the License is distributed on an 14 | "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | KIND, either express or implied. See the License for the 16 | specific language governing permissions and limitations 17 | under the License. 18 | */ 19 | 20 | function Version (major, minor, build, qfe) { 21 | this.major = major; 22 | this.minor = zeroIfUndefined(minor); 23 | this.build = zeroIfUndefined(build); 24 | this.qfe = zeroIfUndefined(qfe); 25 | } 26 | 27 | function zeroIfUndefined (val) { 28 | if (typeof val === 'undefined') { return 0; } 29 | 30 | return val; 31 | } 32 | 33 | Version.Expression = /^\d{1,8}(\.\d{1,8}){0,3}$/; 34 | Version.fromString = function (str) { 35 | var result = Version.tryParse(str); 36 | if (!result) { throw new RangeError('Could not parse a version from the provided value "' + str + '".'); } 37 | 38 | return result; 39 | }; 40 | 41 | Version.tryParse = function (str) { 42 | if (Version.Expression.test(str)) { 43 | var parts = str.split('.').map(function (part) { 44 | return parseInt(part, 10); 45 | }); 46 | 47 | var result = new Version(parts[0], parts[1], parts[2], parts[3]); 48 | return result; 49 | } 50 | 51 | return false; 52 | }; 53 | 54 | Version.comparer = function (a, b) { 55 | if (a.constructor !== Version || b.constructor !== Version) { throw new TypeError('Must compare only Versions'); } 56 | 57 | if (a.gt(b)) { return 1; } else if (a.eq(b)) { return 0; } 58 | 59 | return -1; 60 | }; 61 | 62 | Version.prototype.gt = function (other) { 63 | if (other.constructor !== Version) { throw new TypeError('other is not a Version.'); } 64 | 65 | if (this.major > other.major) return true; 66 | if (this.major < other.major) return false; 67 | if (this.minor > other.minor) return true; 68 | if (this.minor < other.minor) return false; 69 | if (this.build > other.build) return true; 70 | if (this.build < other.build) return false; 71 | if (this.qfe > other.qfe) return true; 72 | if (this.qfe < other.qfe) return false; 73 | 74 | return false; 75 | }; 76 | 77 | Version.prototype.gte = function (other) { 78 | if (other.constructor !== Version) { throw new TypeError('other is not a Version.'); } 79 | 80 | if (this.major > other.major) return true; 81 | if (this.major < other.major) return false; 82 | if (this.minor > other.minor) return true; 83 | if (this.minor < other.minor) return false; 84 | if (this.build > other.build) return true; 85 | if (this.build < other.build) return false; 86 | if (this.qfe > other.qfe) return true; 87 | if (this.qfe < other.qfe) return false; 88 | 89 | return true; 90 | }; 91 | 92 | Version.prototype.eq = function (other) { 93 | if (other.constructor !== Version) { throw new TypeError('other is not a Version.'); } 94 | 95 | if (this.major === other.major && this.minor === other.minor && this.build === other.build && this.qfe === other.qfe) { return true; } 96 | 97 | return false; 98 | }; 99 | 100 | Version.prototype.toString = function () { 101 | return this.major + '.' + this.minor + '.' + this.build + '.' + this.qfe; 102 | }; 103 | 104 | module.exports = Version; 105 | -------------------------------------------------------------------------------- /template/cordova/lib/clean.js: -------------------------------------------------------------------------------- 1 | /* 2 | Licensed to the Apache Software Foundation (ASF) under one 3 | or more contributor license agreements. See the NOTICE file 4 | distributed with this work for additional information 5 | regarding copyright ownership. The ASF licenses this file 6 | to you under the Apache License, Version 2.0 (the 7 | "License"); you may not use this file except in compliance 8 | with the License. You may obtain a copy of the License at 9 | 10 | http://www.apache.org/licenses/LICENSE-2.0 11 | 12 | Unless required by applicable law or agreed to in writing, 13 | software distributed under the License is distributed on an 14 | "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | KIND, either express or implied. See the License for the 16 | specific language governing permissions and limitations 17 | under the License. 18 | */ 19 | 20 | var path = require('path'); 21 | var shell = require('shelljs'); 22 | 23 | var ROOT = path.join(__dirname, '..', '..'); 24 | 25 | // cleans the project, removes AppPackages and build folders. 26 | module.exports.run = function (argv) { 27 | var projectPath = ROOT; 28 | ['AppPackages', 'build'].forEach(function (dir) { 29 | shell.rm('-rf', path.join(projectPath, dir)); 30 | }); 31 | return Promise.resolve(); 32 | }; 33 | -------------------------------------------------------------------------------- /template/cordova/lib/list-devices.bat: -------------------------------------------------------------------------------- 1 | :: Licensed to the Apache Software Foundation (ASF) under one 2 | :: or more contributor license agreements. See the NOTICE file 3 | :: distributed with this work for additional information 4 | :: regarding copyright ownership. The ASF licenses this file 5 | :: to you under the Apache License, Version 2.0 (the 6 | :: "License"); you may not use this file except in compliance 7 | :: with the License. You may obtain a copy of the License at 8 | :: 9 | :: http://www.apache.org/licenses/LICENSE-2.0 10 | :: 11 | :: Unless required by applicable law or agreed to in writing, 12 | :: software distributed under the License is distributed on an 13 | :: "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | :: KIND, either express or implied. See the License for the 15 | :: specific language governing permissions and limitations 16 | :: under the License 17 | @ECHO OFF 18 | SET script_path="%~dp0target-list.js" 19 | IF EXIST %script_path% ( 20 | node %script_path% %* --devices 21 | ) ELSE ( 22 | ECHO. 23 | ECHO ERROR: Could not find 'target-list.js' in cordova/lib, aborting...>&2 24 | EXIT /B 1 25 | ) -------------------------------------------------------------------------------- /template/cordova/lib/list-emulator-images.bat: -------------------------------------------------------------------------------- 1 | :: Licensed to the Apache Software Foundation (ASF) under one 2 | :: or more contributor license agreements. See the NOTICE file 3 | :: distributed with this work for additional information 4 | :: regarding copyright ownership. The ASF licenses this file 5 | :: to you under the Apache License, Version 2.0 (the 6 | :: "License"); you may not use this file except in compliance 7 | :: with the License. You may obtain a copy of the License at 8 | :: 9 | :: http://www.apache.org/licenses/LICENSE-2.0 10 | :: 11 | :: Unless required by applicable law or agreed to in writing, 12 | :: software distributed under the License is distributed on an 13 | :: "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | :: KIND, either express or implied. See the License for the 15 | :: specific language governing permissions and limitations 16 | :: under the License 17 | @ECHO OFF 18 | SET script_path="%~dp0target-list.js" 19 | IF EXIST %script_path% ( 20 | node %script_path% %* --emulators 21 | ) ELSE ( 22 | ECHO. 23 | ECHO ERROR: Could not find 'target-list.js' in cordova/lib, aborting...>&2 24 | EXIT /B 1 25 | ) -------------------------------------------------------------------------------- /template/cordova/lib/list-started-emulators.bat: -------------------------------------------------------------------------------- 1 | :: Licensed to the Apache Software Foundation (ASF) under one 2 | :: or more contributor license agreements. See the NOTICE file 3 | :: distributed with this work for additional information 4 | :: regarding copyright ownership. The ASF licenses this file 5 | :: to you under the Apache License, Version 2.0 (the 6 | :: "License"); you may not use this file except in compliance 7 | :: with the License. You may obtain a copy of the License at 8 | :: 9 | :: http://www.apache.org/licenses/LICENSE-2.0 10 | :: 11 | :: Unless required by applicable law or agreed to in writing, 12 | :: software distributed under the License is distributed on an 13 | :: "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | :: KIND, either express or implied. See the License for the 15 | :: specific language governing permissions and limitations 16 | :: under the License 17 | @ECHO OFF 18 | ECHO Sorry, list-started-emulators is not availible yet for Windows. 1>&2 19 | EXIT /B 1 -------------------------------------------------------------------------------- /template/cordova/lib/loggingHelper.js: -------------------------------------------------------------------------------- 1 | /* 2 | Licensed to the Apache Software Foundation (ASF) under one 3 | or more contributor license agreements. See the NOTICE file 4 | distributed with this work for additional information 5 | regarding copyright ownership. The ASF licenses this file 6 | to you under the Apache License, Version 2.0 (the 7 | "License"); you may not use this file except in compliance 8 | with the License. You may obtain a copy of the License at 9 | 10 | http://www.apache.org/licenses/LICENSE-2.0 11 | 12 | Unless required by applicable law or agreed to in writing, 13 | software distributed under the License is distributed on an 14 | "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | KIND, either express or implied. See the License for the 16 | specific language governing permissions and limitations 17 | under the License. 18 | */ 19 | 20 | var CordovaLogger = require('cordova-common').CordovaLogger; 21 | 22 | module.exports = { 23 | adjustLoggerLevel: function (opts) { 24 | if (opts instanceof Array) { 25 | opts.silent = opts.indexOf('--silent') !== -1; 26 | opts.verbose = opts.indexOf('--verbose') !== -1 || opts.indexOf('-d') !== -1; 27 | } 28 | 29 | if (opts.verbose) { 30 | CordovaLogger.get().setLevel('verbose'); 31 | } 32 | 33 | if (opts.silent) { 34 | CordovaLogger.get().setLevel('error'); 35 | } 36 | } 37 | }; 38 | -------------------------------------------------------------------------------- /template/cordova/lib/target-list.js: -------------------------------------------------------------------------------- 1 | /* 2 | Licensed to the Apache Software Foundation (ASF) under one 3 | or more contributor license agreements. See the NOTICE file 4 | distributed with this work for additional information 5 | regarding copyright ownership. The ASF licenses this file 6 | to you under the Apache License, Version 2.0 (the 7 | "License"); you may not use this file except in compliance 8 | with the License. You may obtain a copy of the License at 9 | 10 | http://www.apache.org/licenses/LICENSE-2.0 11 | 12 | Unless required by applicable law or agreed to in writing, 13 | software distributed under the License is distributed on an 14 | "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | KIND, either express or implied. See the License for the 16 | specific language governing permissions and limitations 17 | under the License. 18 | */ 19 | 20 | var deploy = require('./deployment'); 21 | var args = process.argv.slice(2); 22 | 23 | // help/usage function 24 | function help () { 25 | console.log(''); 26 | console.log('Usage: node target-list.js [--win10] [ --emulators | --devices | --started_emulators | --all ]'); 27 | console.log(' --win10 : Chooses to list Windows 10 devices (Windows 8.1 is default).'); 28 | console.log(' --emulators : List the possible target emulators availible.'); 29 | console.log(' --devices : List the possible target devices availible.'); 30 | console.log(' --started_emulators : List any started emulators availible. *NOT IMPLEMENTED YET*'); 31 | console.log(' --all : List all available devices'); 32 | console.log('examples:'); 33 | console.log(' node target-list.js --emulators'); 34 | console.log(' node target-list.js --win10 --devices'); 35 | console.log(' node target-list.js --started_emulators'); 36 | console.log(' node target-list.js --all'); 37 | console.log(''); 38 | } 39 | 40 | // Handle help flag 41 | if (['--help', '/?', '-h', 'help', '-help', '/help'].indexOf(args[0]) > -1) { 42 | help(); 43 | } else { 44 | var version = '8.1'; 45 | if (args.indexOf('--win10') >= 0) { 46 | version = '10.0'; 47 | } 48 | 49 | var onlyDevices = false; 50 | if (args.indexOf('--devices') >= 0) { 51 | onlyDevices = true; 52 | } 53 | 54 | var onlyEmulators = false; 55 | if (args.indexOf('--emulators') >= 0) { 56 | onlyEmulators = true; 57 | } 58 | 59 | if (onlyDevices && onlyEmulators) { 60 | console.error('Cannot specify both --emulators and --devices'); 61 | help(); 62 | } 63 | 64 | var deploymentTool = deploy.getDeploymentTool(version); 65 | deploymentTool.enumerateDevices().then(function (deviceList) { 66 | if (onlyDevices || onlyEmulators) { 67 | deviceList = deviceList.filter(function (device) { 68 | return (onlyDevices && device.type === 'device') || (onlyEmulators && device.type === 'emulator'); 69 | }); 70 | } 71 | 72 | deviceList.forEach(function (device) { 73 | console.log(device.toString()); 74 | }); 75 | 76 | if (deviceList.length === 0) { 77 | console.error('No devices found matching the specified criteria.'); 78 | } 79 | }); 80 | } 81 | -------------------------------------------------------------------------------- /template/cordova/lib/utils.js: -------------------------------------------------------------------------------- 1 | /* 2 | Licensed to the Apache Software Foundation (ASF) under one 3 | or more contributor license agreements. See the NOTICE file 4 | distributed with this work for additional information 5 | regarding copyright ownership. The ASF licenses this file 6 | to you under the Apache License, Version 2.0 (the 7 | "License"); you may not use this file except in compliance 8 | with the License. You may obtain a copy of the License at 9 | 10 | http://www.apache.org/licenses/LICENSE-2.0 11 | 12 | Unless required by applicable law or agreed to in writing, 13 | software distributed under the License is distributed on an 14 | "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | KIND, either express or implied. See the License for the 16 | specific language governing permissions and limitations 17 | under the License. 18 | */ 19 | 20 | var fs = require('fs'); 21 | var path = require('path'); 22 | var spawn = require('cordova-common').superspawn.spawn; 23 | var DeploymentTool = require('./deployment'); 24 | 25 | // unblocks and returns path to WindowsStoreAppUtils.ps1 26 | // which provides helper functions to install/unistall/start Windows Store app 27 | module.exports.getAppStoreUtils = function () { 28 | var appStoreUtils = path.join(__dirname, 'WindowsStoreAppUtils.ps1'); 29 | if (!fs.existsSync(appStoreUtils)) { 30 | return Promise.reject('Can\'t unblock AppStoreUtils script'); 31 | } 32 | return spawn('powershell', ['Unblock-File', module.exports.quote(appStoreUtils)], { stdio: 'ignore' }) 33 | .then(() => appStoreUtils); 34 | }; 35 | 36 | // returns path to AppDeploy util from Windows Phone 8.1 SDK 37 | module.exports.getAppDeployUtils = function (targetWin10) { 38 | var version = targetWin10 ? '10.0' : '8.1'; 39 | var tool = DeploymentTool.getDeploymentTool(version); 40 | 41 | if (!tool.isAvailable()) { 42 | return Promise.reject('App deployment utilities: "' + tool.path + '", not found. Ensure the Windows SDK is installed.'); 43 | } 44 | 45 | return Promise.resolve(tool); 46 | }; 47 | 48 | // checks to see if a .jsproj file exists in the project root 49 | module.exports.isCordovaProject = function (platformpath) { 50 | if (fs.existsSync(platformpath)) { 51 | var files = fs.readdirSync(platformpath); 52 | for (var i in files) { 53 | if (path.extname(files[i]) === '.shproj') { 54 | return true; 55 | } 56 | } 57 | } 58 | return false; 59 | }; 60 | 61 | module.exports.quote = function (str) { 62 | return '"' + str + '"'; 63 | }; 64 | -------------------------------------------------------------------------------- /template/cordova/log: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env node 2 | 3 | /* 4 | Licensed to the Apache Software Foundation (ASF) under one 5 | or more contributor license agreements. See the NOTICE file 6 | distributed with this work for additional information 7 | regarding copyright ownership. The ASF licenses this file 8 | to you under the Apache License, Version 2.0 (the 9 | "License"); you may not use this file except in compliance 10 | with the License. You may obtain a copy of the License at 11 | 12 | http://www.apache.org/licenses/LICENSE-2.0 13 | 14 | Unless required by applicable law or agreed to in writing, 15 | software distributed under the License is distributed on an 16 | "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 17 | KIND, either express or implied. See the License for the 18 | specific language governing permissions and limitations 19 | under the License. 20 | */ 21 | 22 | var log = require('./lib/log'); 23 | var args = process.argv; 24 | 25 | // Usage support for when args are given 26 | Promise.resolve().then(function () { 27 | var argsToPass = []; 28 | if (args.length > 2) { 29 | argsToPass = args.slice(2); 30 | } 31 | log.run(argsToPass); 32 | }, function (err) { 33 | console.error(err); 34 | process.exit(2); 35 | }); 36 | -------------------------------------------------------------------------------- /template/cordova/log.bat: -------------------------------------------------------------------------------- 1 | :: Licensed to the Apache Software Foundation (ASF) under one 2 | :: or more contributor license agreements. See the NOTICE file 3 | :: distributed with this work for additional information 4 | :: regarding copyright ownership. The ASF licenses this file 5 | :: to you under the Apache License, Version 2.0 (the 6 | :: "License"); you may not use this file except in compliance 7 | :: with the License. You may obtain a copy of the License at 8 | :: 9 | :: http://www.apache.org/licenses/LICENSE-2.0 10 | :: 11 | :: Unless required by applicable law or agreed to in writing, 12 | :: software distributed under the License is distributed on an 13 | :: "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | :: KIND, either express or implied. See the License for the 15 | :: specific language governing permissions and limitations 16 | :: under the License. 17 | 18 | @ECHO OFF 19 | SET script_path="%~dp0log" 20 | IF EXIST %script_path% ( 21 | node %script_path% %* 22 | ) ELSE ( 23 | ECHO. 24 | ECHO ERROR: Could not find 'log' script in 'cordova' folder, aborting...>&2 25 | EXIT /B 1 26 | ) -------------------------------------------------------------------------------- /template/cordova/prebuild-10.js: -------------------------------------------------------------------------------- 1 | /** 2 | Licensed to the Apache Software Foundation (ASF) under one 3 | or more contributor license agreements. See the NOTICE file 4 | distributed with this work for additional information 5 | regarding copyright ownership. The ASF licenses this file 6 | to you under the Apache License, Version 2.0 (the 7 | "License"); you may not use this file except in compliance 8 | with the License. You may obtain a copy of the License at 9 | 10 | http://www.apache.org/licenses/LICENSE-2.0 11 | 12 | Unless required by applicable law or agreed to in writing, 13 | software distributed under the License is distributed on an 14 | "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | KIND, either express or implied. See the License for the 16 | specific language governing permissions and limitations 17 | under the License. 18 | */ 19 | var patch = require('./prebuild'); 20 | patch('10'); 21 | -------------------------------------------------------------------------------- /template/cordova/prebuild-81.js: -------------------------------------------------------------------------------- 1 | /** 2 | Licensed to the Apache Software Foundation (ASF) under one 3 | or more contributor license agreements. See the NOTICE file 4 | distributed with this work for additional information 5 | regarding copyright ownership. The ASF licenses this file 6 | to you under the Apache License, Version 2.0 (the 7 | "License"); you may not use this file except in compliance 8 | with the License. You may obtain a copy of the License at 9 | 10 | http://www.apache.org/licenses/LICENSE-2.0 11 | 12 | Unless required by applicable law or agreed to in writing, 13 | software distributed under the License is distributed on an 14 | "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | KIND, either express or implied. See the License for the 16 | specific language governing permissions and limitations 17 | under the License. 18 | */ 19 | var patch = require('./prebuild'); 20 | patch('8.1'); 21 | -------------------------------------------------------------------------------- /template/cordova/prebuild-phone-81.js: -------------------------------------------------------------------------------- 1 | /** 2 | Licensed to the Apache Software Foundation (ASF) under one 3 | or more contributor license agreements. See the NOTICE file 4 | distributed with this work for additional information 5 | regarding copyright ownership. The ASF licenses this file 6 | to you under the Apache License, Version 2.0 (the 7 | "License"); you may not use this file except in compliance 8 | with the License. You may obtain a copy of the License at 9 | 10 | http://www.apache.org/licenses/LICENSE-2.0 11 | 12 | Unless required by applicable law or agreed to in writing, 13 | software distributed under the License is distributed on an 14 | "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | KIND, either express or implied. See the License for the 16 | specific language governing permissions and limitations 17 | under the License. 18 | */ 19 | var patch = require('./prebuild'); 20 | patch('phone-8.1'); 21 | -------------------------------------------------------------------------------- /template/cordova/prebuild.js: -------------------------------------------------------------------------------- 1 | /** 2 | Licensed to the Apache Software Foundation (ASF) under one 3 | or more contributor license agreements. See the NOTICE file 4 | distributed with this work for additional information 5 | regarding copyright ownership. The ASF licenses this file 6 | to you under the Apache License, Version 2.0 (the 7 | "License"); you may not use this file except in compliance 8 | with the License. You may obtain a copy of the License at 9 | 10 | http://www.apache.org/licenses/LICENSE-2.0 11 | 12 | Unless required by applicable law or agreed to in writing, 13 | software distributed under the License is distributed on an 14 | "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | KIND, either express or implied. See the License for the 16 | specific language governing permissions and limitations 17 | under the License. 18 | */ 19 | 20 | // https://issues.apache.org/jira/browse/CB-11658 activated event is not fired on Windows 10 RS1 21 | // Patching start page to include WinJS/base.js reference to HTML as a workaround 22 | 23 | /* eslint no-useless-escape : 0 */ 24 | 25 | module.exports = function patch (platform) { 26 | console.log('prebuild.js: Patching platform `' + platform + '`'); 27 | 28 | var shell = require('shelljs'); 29 | var path = require('path'); 30 | var url = require('url'); 31 | 32 | var basejsSrcMap = { 33 | '10': '/www/WinJS/js/base.js', // eslint-disable-line quote-props 34 | '8.1': '//Microsoft.WinJS.2.0/js/base.js', // eslint-disable-line quote-props 35 | 'phone-8.1': '//Microsoft.Phone.WinJS.2.1/js/base.js' 36 | }; 37 | var escapedBasejsSrcMap = { 38 | '10': '\/www\/WinJS\/js\/base\.js', // eslint-disable-line quote-props 39 | '8.1': '\/\/Microsoft\.WinJS\.2\.0\/js\/base\.js', // eslint-disable-line quote-props 40 | 'phone-8.1': '\/\/Microsoft\.Phone\.WinJS\.2\.1\/js\/base\.js' 41 | }; 42 | var basejsSrc = basejsSrcMap[platform]; 43 | 44 | var appxmanifestMap = { 45 | '10': 'package.windows10.appxmanifest', // eslint-disable-line quote-props 46 | '8.1': 'package.windows.appxmanifest', // eslint-disable-line quote-props 47 | 'phone-8.1': 'package.phone.appxmanifest' 48 | }; 49 | 50 | // 1. Find start page path in appxmanifest 51 | var AppxManifest = require('./lib/AppxManifest'); 52 | var appxmanifest = AppxManifest.get(path.join(__dirname, '..', appxmanifestMap[platform])); 53 | 54 | // @todo Use 'url.URL' constructor instead 55 | var startPage = url.parse(appxmanifest.getApplication().getStartPage()); // eslint-disable-line 56 | 57 | if (startPage.protocol && startPage.protocol.indexOf('http') === 0) { 58 | console.warn('Warning: Can\'t modify external content.src. You should update your server-side pages to reference WinJS directly in HTML.'); 59 | return; 60 | } 61 | 62 | // Discard scheme and identity name (host) 63 | startPage = startPage.pathname; 64 | 65 | // 2. Check if start page HTML contains base.js reference 66 | var startPageFilePath = shell.ls(path.join(__dirname, '..', startPage))[0]; 67 | var reBaseJs = new RegExp(escapedBasejsSrcMap[platform], 'i'); 68 | 69 | if (!startPageFilePath) { 70 | console.warn('Warning: Start page is missing on the disk. The build must go on but note that this will cause WACK failures.'); 71 | return; 72 | } 73 | 74 | if (shell.grep(reBaseJs, startPageFilePath).length === 0) { 75 | // 3. If it doesn't - patch page to include base.js ref before cordova.js 76 | var appendBaseJsRe = /( *)(\s*<\/script>)/; 77 | var subst = '$1\n$1$2'; 78 | 79 | shell.sed('-i', appendBaseJsRe, subst, startPageFilePath); 80 | console.log('- Injected `base.js` reference to `' + startPage + '`'); 81 | 82 | // 4. Remove all 'wrong' base.js references, which might left from another project type build: 83 | for (var plat in basejsSrcMap) { 84 | if (plat !== platform) { 85 | var wrongBaseJsRe = new RegExp('( *)(\\s*<\\/script>)(\\s*)'); 86 | console.log('- Removing ' + wrongBaseJsRe + ' from ' + startPage); 87 | shell.sed('-i', wrongBaseJsRe, '$1', startPageFilePath); 88 | } 89 | } 90 | } 91 | }; 92 | -------------------------------------------------------------------------------- /template/cordova/prepare: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env node 2 | 3 | /* 4 | Licensed to the Apache Software Foundation (ASF) under one 5 | or more contributor license agreements. See the NOTICE file 6 | distributed with this work for additional information 7 | regarding copyright ownership. The ASF licenses this file 8 | to you under the Apache License, Version 2.0 (the 9 | "License"); you may not use this file except in compliance 10 | with the License. You may obtain a copy of the License at 11 | 12 | http://www.apache.org/licenses/LICENSE-2.0 13 | 14 | Unless required by applicable law or agreed to in writing, 15 | software distributed under the License is distributed on an 16 | "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 17 | KIND, either express or implied. See the License for the 18 | specific language governing permissions and limitations 19 | under the License. 20 | */ 21 | 22 | var Api = require('./Api'); 23 | var nopt = require('nopt'); 24 | var path = require('path'); 25 | var ConfigParser = require('cordova-common').ConfigParser; 26 | 27 | // Support basic help commands 28 | if (['--help', '/?', '-h', 'help', '-help', '/help'].indexOf(process.argv[2]) >= 0) { 29 | console.log('Usage: \n prepare\n'); 30 | process.exit(0); 31 | } 32 | 33 | // Do some basic argument parsing 34 | var opts = nopt({ 35 | verbose: Boolean, 36 | silent: Boolean 37 | }, { d: '--verbose' }); 38 | 39 | // Make buildOptions compatible with PlatformApi clean method spec 40 | opts.argv = opts.argv.original; 41 | 42 | // Skip cleaning prepared files when not invoking via cordova CLI. 43 | opts.noPrepare = true; 44 | 45 | require('./lib/loggingHelper').adjustLoggerLevel(opts); 46 | 47 | var projectRoot = path.join(__dirname, '../../..'); 48 | var project = { 49 | root: projectRoot, 50 | projectConfig: new ConfigParser(path.join(projectRoot, 'config.xml')), 51 | locations: { 52 | plugins: path.join(projectRoot, 'plugins'), 53 | www: path.join(projectRoot, 'www') 54 | } 55 | }; 56 | 57 | new Api().prepare(project, opts) 58 | .catch(function (err) { 59 | console.error(err.stack); 60 | process.exit(2); 61 | }); 62 | -------------------------------------------------------------------------------- /template/cordova/prepare.bat: -------------------------------------------------------------------------------- 1 | :: Licensed to the Apache Software Foundation (ASF) under one 2 | :: or more contributor license agreements. See the NOTICE file 3 | :: distributed with this work for additional information 4 | :: regarding copyright ownership. The ASF licenses this file 5 | :: to you under the Apache License, Version 2.0 (the 6 | :: "License"); you may not use this file except in compliance 7 | :: with the License. You may obtain a copy of the License at 8 | :: 9 | :: http://www.apache.org/licenses/LICENSE-2.0 10 | :: 11 | :: Unless required by applicable law or agreed to in writing, 12 | :: software distributed under the License is distributed on an 13 | :: "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | :: KIND, either express or implied. See the License for the 15 | :: specific language governing permissions and limitations 16 | :: under the License 17 | @ECHO OFF 18 | SET script_path="%~dp0prepare" 19 | IF EXIST %script_path% ( 20 | node %script_path% %* 21 | ) ELSE ( 22 | ECHO. 23 | ECHO ERROR: Could not find 'preapre' script in 'cordova' folder, aborting...>&2 24 | EXIT /B 1 25 | ) -------------------------------------------------------------------------------- /template/cordova/run: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env node 2 | 3 | /* 4 | Licensed to the Apache Software Foundation (ASF) under one 5 | or more contributor license agreements. See the NOTICE file 6 | distributed with this work for additional information 7 | regarding copyright ownership. The ASF licenses this file 8 | to you under the Apache License, Version 2.0 (the 9 | "License"); you may not use this file except in compliance 10 | with the License. You may obtain a copy of the License at 11 | 12 | http://www.apache.org/licenses/LICENSE-2.0 13 | 14 | Unless required by applicable law or agreed to in writing, 15 | software distributed under the License is distributed on an 16 | "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 17 | KIND, either express or implied. See the License for the 18 | specific language governing permissions and limitations 19 | under the License. 20 | */ 21 | 22 | var args = process.argv; 23 | var Api = require('./Api'); 24 | var nopt = require('nopt'); 25 | var path = require('path'); 26 | 27 | // Handle help flag 28 | if (['--help', '/?', '-h', 'help', '-help', '/help'].indexOf(args[2]) > -1) { 29 | console.log('\nUsage: run [ --device | --emulator | --target= ] [ --debug | --release | --nobuild ]'); 30 | console.log(' [ --x86 | --x64 | --arm | --archs="list" ] [--bundle] [--phone | --win]'); 31 | console.log(' --device : Deploys and runs the project on the connected device.'); 32 | console.log(' --emulator : Deploys and runs the project on an emulator.'); 33 | console.log(' --target= : Deploys and runs the project on the specified target.'); 34 | console.log(' --debug : Builds project in debug mode.'); 35 | console.log(' --release : Builds project in release mode.'); 36 | console.log(' --nobuild : Uses pre-built package, or errors if project is not built.'); 37 | console.log(' --archs : Specific chip architectures (`anycpu`, `arm`, `x86`, `x64`).'); 38 | console.log(' Separate multiple choices with a space and, if choosing'); 39 | console.log(' multiple choices, enclose in quotes (").'); 40 | console.log(' --bundle : Generates an .appxbundle. Not valid if anycpu AND chip-specific'); 41 | console.log(' architectures are used.'); 42 | console.log(' --phone, --win'); 43 | console.log(' : Specifies project type to deploy'); 44 | console.log(' --appx=<8.1-win|8.1-phone|uap|uwp>'); 45 | console.log(' : Overrides windows-target-version to build Windows 8.1, '); 46 | console.log(' Windows Phone 8.1, or Windows 10.'); 47 | console.log(' --win10tools : Uses Windows 10 deployment tools (used for a Windows 8.1 app when'); 48 | console.log(' being deployed to a Windows 10 device)'); 49 | console.log('Examples:'); 50 | console.log(' run'); 51 | console.log(' run --emulator'); 52 | console.log(' run --device'); 53 | console.log(' run --target=7988B8C3-3ADE-488d-BA3E-D052AC9DC710'); 54 | console.log(' run --device --release'); 55 | console.log(' run --emulator --debug'); 56 | console.log(' run --archs="x64 x86 arm" --no-bundle'); 57 | console.log(' run --device --appx=phone-8.1'); 58 | console.log(' run --device --archs="x64 x86 arm"'); 59 | console.log(''); 60 | 61 | process.exit(0); 62 | } 63 | 64 | // Do some basic argument parsing 65 | var runOpts = nopt({ 66 | silent: Boolean, 67 | verbose: Boolean, 68 | debug: Boolean, 69 | release: Boolean, 70 | nobuild: Boolean, 71 | device: Boolean, 72 | emulator: Boolean, 73 | target: String, 74 | buildConfig: path 75 | }, { d: '--verbose', r: '--release' }); 76 | 77 | // Make buildOptions compatible with PlatformApi build method spec 78 | runOpts.argv = runOpts.argv.original; 79 | 80 | require('./lib/loggingHelper').adjustLoggerLevel(runOpts); 81 | 82 | new Api().run(runOpts).catch(err => { 83 | console.error(err); 84 | process.exit(2); 85 | }); 86 | -------------------------------------------------------------------------------- /template/cordova/run.bat: -------------------------------------------------------------------------------- 1 | :: Licensed to the Apache Software Foundation (ASF) under one 2 | :: or more contributor license agreements. See the NOTICE file 3 | :: distributed with this work for additional information 4 | :: regarding copyright ownership. The ASF licenses this file 5 | :: to you under the Apache License, Version 2.0 (the 6 | :: "License"); you may not use this file except in compliance 7 | :: with the License. You may obtain a copy of the License at 8 | :: 9 | :: http://www.apache.org/licenses/LICENSE-2.0 10 | :: 11 | :: Unless required by applicable law or agreed to in writing, 12 | :: software distributed under the License is distributed on an 13 | :: "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | :: KIND, either express or implied. See the License for the 15 | :: specific language governing permissions and limitations 16 | :: under the License 17 | @ECHO OFF 18 | SET script_path="%~dp0run" 19 | IF EXIST %script_path% ( 20 | node %script_path% %* 21 | ) ELSE ( 22 | ECHO. 23 | ECHO ERROR: Could not find 'run' script in 'cordova' folder, aborting...>&2 24 | EXIT /B 1 25 | ) 26 | -------------------------------------------------------------------------------- /template/cordova/version: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env node 2 | 3 | /* 4 | Licensed to the Apache Software Foundation (ASF) under one 5 | or more contributor license agreements. See the NOTICE file 6 | distributed with this work for additional information 7 | regarding copyright ownership. The ASF licenses this file 8 | to you under the Apache License, Version 2.0 (the 9 | "License"); you may not use this file except in compliance 10 | with the License. You may obtain a copy of the License at 11 | 12 | http://www.apache.org/licenses/LICENSE-2.0 13 | 14 | Unless required by applicable law or agreed to in writing, 15 | software distributed under the License is distributed on an 16 | "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 17 | KIND, either express or implied. See the License for the 18 | specific language governing permissions and limitations 19 | under the License. 20 | */ 21 | 22 | // Coho updates this line: 23 | var VERSION = '8.0.0-dev'; 24 | 25 | module.exports.version = VERSION; 26 | 27 | if (!module.parent) { 28 | console.log(VERSION); 29 | } 30 | -------------------------------------------------------------------------------- /template/cordova/version.bat: -------------------------------------------------------------------------------- 1 | :: Licensed to the Apache Software Foundation (ASF) under one 2 | :: or more contributor license agreements. See the NOTICE file 3 | :: distributed with this work for additional information 4 | :: regarding copyright ownership. The ASF licenses this file 5 | :: to you under the Apache License, Version 2.0 (the 6 | :: "License"); you may not use this file except in compliance 7 | :: with the License. You may obtain a copy of the License at 8 | :: 9 | :: http://www.apache.org/licenses/LICENSE-2.0 10 | :: 11 | :: Unless required by applicable law or agreed to in writing, 12 | :: software distributed under the License is distributed on an 13 | :: "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | :: KIND, either express or implied. See the License for the 15 | :: specific language governing permissions and limitations 16 | :: under the License 17 | @ECHO OFF 18 | SET full_path="%~dp0" 19 | IF EXIST %full_path%..\VERSION ( 20 | type %full_path%..\VERSION 21 | ) ELSE ( 22 | ECHO. 23 | ECHO ERROR: Could not find file VERSION in project folder 24 | EXIT /B 1 25 | ) 26 | -------------------------------------------------------------------------------- /template/images/SplashScreen.scale-100.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/cordova-windows/5e7f2ac9795600dab4ae7ffebd53bbda96bc2386/template/images/SplashScreen.scale-100.png -------------------------------------------------------------------------------- /template/images/SplashScreenPhone.scale-240.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/cordova-windows/5e7f2ac9795600dab4ae7ffebd53bbda96bc2386/template/images/SplashScreenPhone.scale-240.png -------------------------------------------------------------------------------- /template/images/Square150x150Logo.scale-100.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/cordova-windows/5e7f2ac9795600dab4ae7ffebd53bbda96bc2386/template/images/Square150x150Logo.scale-100.png -------------------------------------------------------------------------------- /template/images/Square150x150Logo.scale-240.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/cordova-windows/5e7f2ac9795600dab4ae7ffebd53bbda96bc2386/template/images/Square150x150Logo.scale-240.png -------------------------------------------------------------------------------- /template/images/Square30x30Logo.scale-100.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/cordova-windows/5e7f2ac9795600dab4ae7ffebd53bbda96bc2386/template/images/Square30x30Logo.scale-100.png -------------------------------------------------------------------------------- /template/images/Square310x310Logo.scale-100.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/cordova-windows/5e7f2ac9795600dab4ae7ffebd53bbda96bc2386/template/images/Square310x310Logo.scale-100.png -------------------------------------------------------------------------------- /template/images/Square44x44Logo.scale-100.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/cordova-windows/5e7f2ac9795600dab4ae7ffebd53bbda96bc2386/template/images/Square44x44Logo.scale-100.png -------------------------------------------------------------------------------- /template/images/Square44x44Logo.scale-240.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/cordova-windows/5e7f2ac9795600dab4ae7ffebd53bbda96bc2386/template/images/Square44x44Logo.scale-240.png -------------------------------------------------------------------------------- /template/images/Square70x70Logo.scale-100.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/cordova-windows/5e7f2ac9795600dab4ae7ffebd53bbda96bc2386/template/images/Square70x70Logo.scale-100.png -------------------------------------------------------------------------------- /template/images/Square71x71Logo.scale-100.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/cordova-windows/5e7f2ac9795600dab4ae7ffebd53bbda96bc2386/template/images/Square71x71Logo.scale-100.png -------------------------------------------------------------------------------- /template/images/Square71x71Logo.scale-240.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/cordova-windows/5e7f2ac9795600dab4ae7ffebd53bbda96bc2386/template/images/Square71x71Logo.scale-240.png -------------------------------------------------------------------------------- /template/images/StoreLogo.scale-100.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/cordova-windows/5e7f2ac9795600dab4ae7ffebd53bbda96bc2386/template/images/StoreLogo.scale-100.png -------------------------------------------------------------------------------- /template/images/StoreLogo.scale-240.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/cordova-windows/5e7f2ac9795600dab4ae7ffebd53bbda96bc2386/template/images/StoreLogo.scale-240.png -------------------------------------------------------------------------------- /template/images/Wide310x150Logo.scale-100.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/cordova-windows/5e7f2ac9795600dab4ae7ffebd53bbda96bc2386/template/images/Wide310x150Logo.scale-100.png -------------------------------------------------------------------------------- /template/images/Wide310x150Logo.scale-240.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/cordova-windows/5e7f2ac9795600dab4ae7ffebd53bbda96bc2386/template/images/Wide310x150Logo.scale-240.png -------------------------------------------------------------------------------- /template/package.phone.appxmanifest: -------------------------------------------------------------------------------- 1 |  2 | 20 | 21 | 22 | 23 | 24 | $projectname$ 25 | $username$ 26 | images\StoreLogo.png 27 | 28 | 29 | 6.3.1 30 | 6.3.1 31 | 32 | 33 | 34 | 35 | 36 | 37 | 43 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | -------------------------------------------------------------------------------- /template/package.windows.appxmanifest: -------------------------------------------------------------------------------- 1 |  2 | 20 | 21 | 22 | 23 | $projectname$ 24 | $username$ 25 | images\StoreLogo.png 26 | 27 | 28 | 6.3.0 29 | 6.3.0 30 | 31 | 32 | 33 | 34 | 35 | 36 | 42 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | -------------------------------------------------------------------------------- /template/package.windows10.appxmanifest: -------------------------------------------------------------------------------- 1 |  2 | 20 | 25 | 26 | 30 | 31 | 32 | 33 | 34 | $projectname$ 35 | $username$ 36 | images\StoreLogo.png 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 51 | 52 | 58 | 59 | 60 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | -------------------------------------------------------------------------------- /template/www/css/index.css: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | * { 20 | -webkit-tap-highlight-color: rgba(0,0,0,0); /* make transparent link selection, adjust last value opacity 0 to 1.0 */ 21 | } 22 | 23 | body { 24 | -webkit-touch-callout: none; /* prevent callout to copy image, etc when tap to hold */ 25 | -webkit-text-size-adjust: none; /* prevent webkit from resizing text to fit */ 26 | -webkit-user-select: none; /* prevent copy paste, to allow, change 'none' to 'text' */ 27 | background-color:#E4E4E4; 28 | background-image:linear-gradient(top, #A7A7A7 0%, #E4E4E4 51%); 29 | background-image:-webkit-linear-gradient(top, #A7A7A7 0%, #E4E4E4 51%); 30 | background-image:-ms-linear-gradient(top, #A7A7A7 0%, #E4E4E4 51%); 31 | background-image:-webkit-gradient( 32 | linear, 33 | left top, 34 | left bottom, 35 | color-stop(0, #A7A7A7), 36 | color-stop(0.51, #E4E4E4) 37 | ); 38 | background-attachment:fixed; 39 | font-family:'HelveticaNeue-Light', 'HelveticaNeue', Helvetica, Arial, sans-serif; 40 | font-size:12px; 41 | height:100%; 42 | margin:0px; 43 | padding:0px; 44 | text-transform:uppercase; 45 | width:100%; 46 | } 47 | 48 | /* Portrait layout (default) */ 49 | .app { 50 | background:url(../img/logo.png) no-repeat center top; /* 170px x 200px */ 51 | position:absolute; /* position in the center of the screen */ 52 | left:50%; 53 | top:50%; 54 | height:50px; /* text area height */ 55 | width:225px; /* text area width */ 56 | text-align:center; 57 | padding:180px 0px 0px 0px; /* image height is 200px (bottom 20px are overlapped with text) */ 58 | margin:-115px 0px 0px -112px; /* offset vertical: half of image height and text area height */ 59 | /* offset horizontal: half of text area width */ 60 | } 61 | 62 | /* Landscape layout (with min-width) */ 63 | @media screen and (min-aspect-ratio: 1/1) and (min-width:400px) { 64 | .app { 65 | background-position:left center; 66 | padding:75px 0px 75px 170px; /* padding-top + padding-bottom + text area = image height */ 67 | margin:-90px 0px 0px -198px; /* offset vertical: half of image height */ 68 | /* offset horizontal: half of image width and text area width */ 69 | } 70 | } 71 | 72 | h1 { 73 | font-size:24px; 74 | font-weight:normal; 75 | margin:0px; 76 | overflow:visible; 77 | padding:0px; 78 | text-align:center; 79 | } 80 | 81 | .event { 82 | border-radius:4px; 83 | -webkit-border-radius:4px; 84 | color:#FFFFFF; 85 | font-size:12px; 86 | margin:0px 30px; 87 | padding:2px 0px; 88 | } 89 | 90 | .event.listening { 91 | background-color:#333333; 92 | display:block; 93 | } 94 | 95 | .event.received { 96 | background-color:#4B946A; 97 | display:none; 98 | } 99 | 100 | @keyframes fade { 101 | from { opacity: 1.0; } 102 | 50% { opacity: 0.4; } 103 | to { opacity: 1.0; } 104 | } 105 | 106 | @-webkit-keyframes fade { 107 | from { opacity: 1.0; } 108 | 50% { opacity: 0.4; } 109 | to { opacity: 1.0; } 110 | } 111 | 112 | .blink { 113 | animation:fade 3000ms infinite; 114 | -webkit-animation:fade 3000ms infinite; 115 | } 116 | -------------------------------------------------------------------------------- /template/www/css/splashscreen.css: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * Licensed to the Apache Software Foundation (ASF) under one 4 | * or more contributor license agreements. See the NOTICE file 5 | * distributed with this work for additional information 6 | * regarding copyright ownership. The ASF licenses this file 7 | * to you under the Apache License, Version 2.0 (the 8 | * "License"); you may not use this file except in compliance 9 | * with the License. You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, 14 | * software distributed under the License is distributed on an 15 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16 | * KIND, either express or implied. See the License for the 17 | * specific language governing permissions and limitations 18 | * under the License. 19 | * 20 | */ 21 | 22 | /* Container */ 23 | .extendedSplashScreen { 24 | background-color:#464646; 25 | height: 100%; 26 | width: 100%; 27 | position: absolute; 28 | top: 0px; 29 | left: 0px; 30 | text-align: center; 31 | z-index: 2147483647; 32 | } 33 | 34 | .extendedSplashScreen.hidden { 35 | display: none; 36 | } 37 | 38 | #extendedSplashImageHelper { 39 | vertical-align: middle; 40 | display: inline-block; 41 | height: 100%; 42 | } 43 | 44 | #extendedSplashImage { 45 | position: absolute; 46 | left: 0px; 47 | max-height: 100%; 48 | max-width: 100%; 49 | vertical-align: middle; 50 | } 51 | 52 | #extendedSplashImage.phone { 53 | position: relative; 54 | margin: 0 auto; 55 | display: inline-block; 56 | } 57 | 58 | /* ProgressRing */ 59 | .win-progress-ring.win-medium, 60 | .win-ring.win-medium { 61 | width: 40px; 62 | height: 40px; 63 | } 64 | 65 | .win-progress-ring:indeterminate::-ms-fill, 66 | .win-ring:indeterminate::-ms-fill { 67 | animation-name: -ms-ring; 68 | } 69 | 70 | .win-progress-bar::-ms-fill, 71 | .win-progress-ring::-ms-fill, 72 | .win-ring::-ms-fill { 73 | background-color: Highlight; 74 | } 75 | 76 | .win-ring.win-medium.extended-splash-progress-phone { 77 | position: absolute; 78 | width: 100%; 79 | top: calc(100% - 140px); 80 | text-align: center; 81 | display: block; 82 | } 83 | 84 | .win-ring.win-medium.extended-splash-progress-wp10 { 85 | position: absolute; 86 | top: calc(82.5% - 20px); 87 | left: calc(50% - 20px); 88 | } 89 | 90 | .win-ring.win-medium.extended-splash-progress-desktop { 91 | position: absolute; 92 | width: 100%; 93 | top: 0px; 94 | left: 0px; 95 | } 96 | 97 | #extendedSplashProgress.hidden { 98 | display: none; 99 | } 100 | -------------------------------------------------------------------------------- /template/www/img/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/cordova-windows/5e7f2ac9795600dab4ae7ffebd53bbda96bc2386/template/www/img/logo.png -------------------------------------------------------------------------------- /template/www/img/smalllogo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/cordova-windows/5e7f2ac9795600dab4ae7ffebd53bbda96bc2386/template/www/img/smalllogo.png -------------------------------------------------------------------------------- /template/www/img/splashscreen.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/cordova-windows/5e7f2ac9795600dab4ae7ffebd53bbda96bc2386/template/www/img/splashscreen.png -------------------------------------------------------------------------------- /template/www/img/storelogo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/cordova-windows/5e7f2ac9795600dab4ae7ffebd53bbda96bc2386/template/www/img/storelogo.png -------------------------------------------------------------------------------- /template/www/index.html: -------------------------------------------------------------------------------- 1 | 2 | 20 | 21 | 22 | 31 | 32 | 33 | 34 | 35 | 36 | Hello World 37 | 38 | 39 |
40 |

Apache Cordova

41 | 45 |
46 | 47 | 48 | 49 | 50 | -------------------------------------------------------------------------------- /template/www/js/index.js: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | var app = { 20 | // Application Constructor 21 | initialize: function () { 22 | this.bindEvents(); 23 | }, 24 | // Bind Event Listeners 25 | // 26 | // Bind any events that are required on startup. Common events are: 27 | // 'load', 'deviceready', 'offline', and 'online'. 28 | bindEvents: function () { 29 | document.addEventListener('deviceready', this.onDeviceReady, false); 30 | }, 31 | // deviceready Event Handler 32 | // 33 | // The scope of 'this' is the event. In order to call the 'receivedEvent' 34 | // function, we must explicitly call 'app.receivedEvent(...);' 35 | onDeviceReady: function () { 36 | app.receivedEvent('deviceready'); 37 | }, 38 | // Update DOM on a Received Event 39 | receivedEvent: function (id) { 40 | var parentElement = document.getElementById(id); 41 | var listeningElement = parentElement.querySelector('.listening'); 42 | var receivedElement = parentElement.querySelector('.received'); 43 | 44 | listeningElement.setAttribute('style', 'display:none;'); 45 | receivedElement.setAttribute('style', 'display:block;'); 46 | 47 | console.log('Received Event: ' + id); 48 | } 49 | }; 50 | 51 | app.initialize(); 52 | --------------------------------------------------------------------------------