├── app
└── .gitkeep
├── addon
└── .gitkeep
├── vendor
└── .gitkeep
├── tests
├── unit
│ └── .gitkeep
├── integration
│ └── .gitkeep
├── dummy
│ ├── app
│ │ ├── helpers
│ │ │ └── .gitkeep
│ │ ├── models
│ │ │ └── .gitkeep
│ │ ├── routes
│ │ │ └── .gitkeep
│ │ ├── styles
│ │ │ └── app.css
│ │ ├── components
│ │ │ └── .gitkeep
│ │ ├── controllers
│ │ │ └── .gitkeep
│ │ ├── templates
│ │ │ ├── components
│ │ │ │ └── .gitkeep
│ │ │ └── application.hbs
│ │ ├── resolver.js
│ │ ├── router.js
│ │ ├── app.js
│ │ └── index.html
│ ├── public
│ │ ├── robots.txt
│ │ └── crossdomain.xml
│ └── config
│ │ └── environment.js
├── test-helper.js
├── helpers
│ ├── destroy-app.js
│ ├── resolver.js
│ ├── start-app.js
│ └── module-for-acceptance.js
├── .jshintrc
└── index.html
├── .watchmanconfig
├── .bowerrc
├── index.js
├── config
├── environment.js
└── ember-try.js
├── testem.json
├── .npmignore
├── .ember-cli
├── .gitignore
├── bower.json
├── ember-cli-build.js
├── .jshintrc
├── .editorconfig
├── .travis.yml
├── LICENSE.md
├── package.json
└── README.md
/app/.gitkeep:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/addon/.gitkeep:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/vendor/.gitkeep:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/tests/unit/.gitkeep:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/tests/integration/.gitkeep:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/tests/dummy/app/helpers/.gitkeep:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/tests/dummy/app/models/.gitkeep:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/tests/dummy/app/routes/.gitkeep:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/tests/dummy/app/styles/app.css:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/tests/dummy/app/components/.gitkeep:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/tests/dummy/app/controllers/.gitkeep:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/tests/dummy/app/templates/components/.gitkeep:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/.watchmanconfig:
--------------------------------------------------------------------------------
1 | {
2 | "ignore_dirs": ["tmp", "dist"]
3 | }
4 |
--------------------------------------------------------------------------------
/.bowerrc:
--------------------------------------------------------------------------------
1 | {
2 | "directory": "bower_components",
3 | "analytics": false
4 | }
5 |
--------------------------------------------------------------------------------
/tests/dummy/public/robots.txt:
--------------------------------------------------------------------------------
1 | # http://www.robotstxt.org
2 | User-agent: *
3 | Disallow:
4 |
--------------------------------------------------------------------------------
/tests/dummy/app/templates/application.hbs:
--------------------------------------------------------------------------------
1 |
Welcome to Ember
2 |
3 | {{outlet}}
4 |
--------------------------------------------------------------------------------
/tests/dummy/app/resolver.js:
--------------------------------------------------------------------------------
1 | import Resolver from 'ember-resolver';
2 |
3 | export default Resolver;
4 |
--------------------------------------------------------------------------------
/index.js:
--------------------------------------------------------------------------------
1 | /* jshint node: true */
2 | 'use strict';
3 |
4 | module.exports = {
5 | name: 'ember-cli-platforms'
6 | };
7 |
--------------------------------------------------------------------------------
/config/environment.js:
--------------------------------------------------------------------------------
1 | /*jshint node:true*/
2 | 'use strict';
3 |
4 | module.exports = function(/* environment, appConfig */) {
5 | return { };
6 | };
7 |
--------------------------------------------------------------------------------
/tests/test-helper.js:
--------------------------------------------------------------------------------
1 | import resolver from './helpers/resolver';
2 | import {
3 | setResolver
4 | } from 'ember-qunit';
5 |
6 | setResolver(resolver);
7 |
--------------------------------------------------------------------------------
/tests/helpers/destroy-app.js:
--------------------------------------------------------------------------------
1 | import Ember from 'ember';
2 |
3 | export default function destroyApp(application) {
4 | Ember.run(application, 'destroy');
5 | }
6 |
--------------------------------------------------------------------------------
/testem.json:
--------------------------------------------------------------------------------
1 | {
2 | "framework": "qunit",
3 | "test_page": "tests/index.html?hidepassed",
4 | "disable_watching": true,
5 | "launch_in_ci": [
6 | "PhantomJS"
7 | ],
8 | "launch_in_dev": [
9 | "PhantomJS",
10 | "Chrome"
11 | ]
12 | }
13 |
--------------------------------------------------------------------------------
/tests/dummy/app/router.js:
--------------------------------------------------------------------------------
1 | import Ember from 'ember';
2 | import config from './config/environment';
3 |
4 | const Router = Ember.Router.extend({
5 | location: config.locationType
6 | });
7 |
8 | Router.map(function() {
9 | });
10 |
11 | export default Router;
12 |
--------------------------------------------------------------------------------
/.npmignore:
--------------------------------------------------------------------------------
1 | /bower_components
2 | /config/ember-try.js
3 | /dist
4 | /tests
5 | /tmp
6 | **/.gitkeep
7 | .bowerrc
8 | .editorconfig
9 | .ember-cli
10 | .gitignore
11 | .jshintrc
12 | .watchmanconfig
13 | .travis.yml
14 | bower.json
15 | ember-cli-build.js
16 | testem.json
17 |
--------------------------------------------------------------------------------
/.ember-cli:
--------------------------------------------------------------------------------
1 | {
2 | /**
3 | Ember CLI sends analytics information by default. The data is completely
4 | anonymous, but there are times when you might want to disable this behavior.
5 |
6 | Setting `disableAnalytics` to true will prevent any data from being sent.
7 | */
8 | "disableAnalytics": false
9 | }
10 |
--------------------------------------------------------------------------------
/tests/helpers/resolver.js:
--------------------------------------------------------------------------------
1 | import Resolver from '../../resolver';
2 | import config from '../../config/environment';
3 |
4 | const resolver = Resolver.create();
5 |
6 | resolver.namespace = {
7 | modulePrefix: config.modulePrefix,
8 | podModulePrefix: config.podModulePrefix
9 | };
10 |
11 | export default resolver;
12 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | # See http://help.github.com/ignore-files/ for more about ignoring files.
2 |
3 | # compiled output
4 | /dist
5 | /tmp
6 |
7 | # dependencies
8 | /node_modules
9 | /bower_components
10 |
11 | # misc
12 | /.sass-cache
13 | /connect.lock
14 | /coverage/*
15 | /libpeerconnection.log
16 | npm-debug.log
17 | testem.log
18 |
--------------------------------------------------------------------------------
/bower.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "ember-cli-platforms",
3 | "dependencies": {
4 | "ember": "2.3.0",
5 | "ember-cli-shims": "0.1.0",
6 | "ember-cli-test-loader": "0.2.2",
7 | "ember-qunit-notifications": "0.1.0",
8 | "jquery": "1.11.3"
9 | },
10 | "resolutions": {
11 | "ember": "2.3.0"
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/tests/dummy/app/app.js:
--------------------------------------------------------------------------------
1 | import Ember from 'ember';
2 | import Resolver from './resolver';
3 | import loadInitializers from 'ember-load-initializers';
4 | import config from './config/environment';
5 |
6 | let App;
7 |
8 | Ember.MODEL_FACTORY_INJECTIONS = true;
9 |
10 | App = Ember.Application.extend({
11 | modulePrefix: config.modulePrefix,
12 | podModulePrefix: config.podModulePrefix,
13 | Resolver
14 | });
15 |
16 | loadInitializers(App, config.modulePrefix);
17 |
18 | export default App;
19 |
--------------------------------------------------------------------------------
/tests/helpers/start-app.js:
--------------------------------------------------------------------------------
1 | import Ember from 'ember';
2 | import Application from '../../app';
3 | import config from '../../config/environment';
4 |
5 | export default function startApp(attrs) {
6 | let application;
7 |
8 | let attributes = Ember.merge({}, config.APP);
9 | attributes = Ember.merge(attributes, attrs); // use defaults, but you can override;
10 |
11 | Ember.run(() => {
12 | application = Application.create(attributes);
13 | application.setupForTesting();
14 | application.injectTestHelpers();
15 | });
16 |
17 | return application;
18 | }
19 |
--------------------------------------------------------------------------------
/ember-cli-build.js:
--------------------------------------------------------------------------------
1 | /*jshint node:true*/
2 | /* global require, module */
3 | var EmberAddon = require('ember-cli/lib/broccoli/ember-addon');
4 |
5 | module.exports = function(defaults) {
6 | var app = new EmberAddon(defaults, {
7 | // Add options here
8 | });
9 |
10 | /*
11 | This build file specifies the options for the dummy test app of this
12 | addon, located in `/tests/dummy`
13 | This build file does *not* influence how the addon or the app using it
14 | behave. You most likely want to be modifying `./index.js` or app's build file
15 | */
16 |
17 | return app.toTree();
18 | };
19 |
--------------------------------------------------------------------------------
/tests/helpers/module-for-acceptance.js:
--------------------------------------------------------------------------------
1 | import { module } from 'qunit';
2 | import startApp from '../helpers/start-app';
3 | import destroyApp from '../helpers/destroy-app';
4 |
5 | export default function(name, options = {}) {
6 | module(name, {
7 | beforeEach() {
8 | this.application = startApp();
9 |
10 | if (options.beforeEach) {
11 | options.beforeEach.apply(this, arguments);
12 | }
13 | },
14 |
15 | afterEach() {
16 | destroyApp(this.application);
17 |
18 | if (options.afterEach) {
19 | options.afterEach.apply(this, arguments);
20 | }
21 | }
22 | });
23 | }
24 |
--------------------------------------------------------------------------------
/.jshintrc:
--------------------------------------------------------------------------------
1 | {
2 | "predef": [
3 | "document",
4 | "window",
5 | "-Promise"
6 | ],
7 | "browser": true,
8 | "boss": true,
9 | "curly": true,
10 | "debug": false,
11 | "devel": true,
12 | "eqeqeq": true,
13 | "evil": true,
14 | "forin": false,
15 | "immed": false,
16 | "laxbreak": false,
17 | "newcap": true,
18 | "noarg": true,
19 | "noempty": false,
20 | "nonew": false,
21 | "nomen": false,
22 | "onevar": false,
23 | "plusplus": false,
24 | "regexp": false,
25 | "undef": true,
26 | "sub": true,
27 | "strict": false,
28 | "white": false,
29 | "eqnull": true,
30 | "esnext": true,
31 | "unused": true
32 | }
33 |
--------------------------------------------------------------------------------
/tests/dummy/public/crossdomain.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
15 |
16 |
--------------------------------------------------------------------------------
/.editorconfig:
--------------------------------------------------------------------------------
1 | # EditorConfig helps developers define and maintain consistent
2 | # coding styles between different editors and IDEs
3 | # editorconfig.org
4 |
5 | root = true
6 |
7 |
8 | [*]
9 | end_of_line = lf
10 | charset = utf-8
11 | trim_trailing_whitespace = true
12 | insert_final_newline = true
13 | indent_style = space
14 | indent_size = 2
15 |
16 | [*.js]
17 | indent_style = space
18 | indent_size = 2
19 |
20 | [*.hbs]
21 | insert_final_newline = false
22 | indent_style = space
23 | indent_size = 2
24 |
25 | [*.css]
26 | indent_style = space
27 | indent_size = 2
28 |
29 | [*.html]
30 | indent_style = space
31 | indent_size = 2
32 |
33 | [*.{diff,md}]
34 | trim_trailing_whitespace = false
35 |
--------------------------------------------------------------------------------
/.travis.yml:
--------------------------------------------------------------------------------
1 | ---
2 | language: node_js
3 | node_js:
4 | - "0.12"
5 |
6 | sudo: false
7 |
8 | cache:
9 | directories:
10 | - node_modules
11 |
12 | env:
13 | - EMBER_TRY_SCENARIO=default
14 | - EMBER_TRY_SCENARIO=ember-release
15 | - EMBER_TRY_SCENARIO=ember-beta
16 | - EMBER_TRY_SCENARIO=ember-canary
17 |
18 | matrix:
19 | fast_finish: true
20 | allow_failures:
21 | - env: EMBER_TRY_SCENARIO=ember-canary
22 |
23 | before_install:
24 | - export PATH=/usr/local/phantomjs-2.0.0/bin:$PATH
25 | - "npm config set spin false"
26 | - "npm install -g npm@^2"
27 |
28 | install:
29 | - npm install -g bower
30 | - npm install
31 | - bower install
32 |
33 | script:
34 | - ember try $EMBER_TRY_SCENARIO test
35 |
--------------------------------------------------------------------------------
/tests/dummy/app/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | Dummy
7 |
8 |
9 |
10 | {{content-for "head"}}
11 |
12 |
13 |
14 |
15 | {{content-for "head-footer"}}
16 |
17 |
18 | {{content-for "body"}}
19 |
20 |
21 |
22 |
23 | {{content-for "body-footer"}}
24 |
25 |
26 |
--------------------------------------------------------------------------------
/config/ember-try.js:
--------------------------------------------------------------------------------
1 | /*jshint node:true*/
2 | module.exports = {
3 | scenarios: [
4 | {
5 | name: 'default',
6 | dependencies: { }
7 | },
8 | {
9 | name: 'ember-release',
10 | dependencies: {
11 | 'ember': 'components/ember#release'
12 | },
13 | resolutions: {
14 | 'ember': 'release'
15 | }
16 | },
17 | {
18 | name: 'ember-beta',
19 | dependencies: {
20 | 'ember': 'components/ember#beta'
21 | },
22 | resolutions: {
23 | 'ember': 'beta'
24 | }
25 | },
26 | {
27 | name: 'ember-canary',
28 | dependencies: {
29 | 'ember': 'components/ember#canary'
30 | },
31 | resolutions: {
32 | 'ember': 'canary'
33 | }
34 | }
35 | ]
36 | };
37 |
--------------------------------------------------------------------------------
/tests/.jshintrc:
--------------------------------------------------------------------------------
1 | {
2 | "predef": [
3 | "document",
4 | "window",
5 | "location",
6 | "setTimeout",
7 | "$",
8 | "-Promise",
9 | "define",
10 | "console",
11 | "visit",
12 | "exists",
13 | "fillIn",
14 | "click",
15 | "keyEvent",
16 | "triggerEvent",
17 | "find",
18 | "findWithAssert",
19 | "wait",
20 | "DS",
21 | "andThen",
22 | "currentURL",
23 | "currentPath",
24 | "currentRouteName"
25 | ],
26 | "node": false,
27 | "browser": false,
28 | "boss": true,
29 | "curly": true,
30 | "debug": false,
31 | "devel": false,
32 | "eqeqeq": true,
33 | "evil": true,
34 | "forin": false,
35 | "immed": false,
36 | "laxbreak": false,
37 | "newcap": true,
38 | "noarg": true,
39 | "noempty": false,
40 | "nonew": false,
41 | "nomen": false,
42 | "onevar": false,
43 | "plusplus": false,
44 | "regexp": false,
45 | "undef": true,
46 | "sub": true,
47 | "strict": false,
48 | "white": false,
49 | "eqnull": true,
50 | "esnext": true,
51 | "unused": true
52 | }
53 |
--------------------------------------------------------------------------------
/LICENSE.md:
--------------------------------------------------------------------------------
1 | The MIT License (MIT)
2 |
3 | Copyright (c) 2016
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
6 |
7 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
8 |
9 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
10 |
--------------------------------------------------------------------------------
/tests/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | Dummy Tests
7 |
8 |
9 |
10 | {{content-for "head"}}
11 | {{content-for "test-head"}}
12 |
13 |
14 |
15 |
16 |
17 | {{content-for "head-footer"}}
18 | {{content-for "test-head-footer"}}
19 |
20 |
21 | {{content-for "body"}}
22 | {{content-for "test-body"}}
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 | {{content-for "body-footer"}}
32 | {{content-for "test-body-footer"}}
33 |
34 |
35 |
--------------------------------------------------------------------------------
/tests/dummy/config/environment.js:
--------------------------------------------------------------------------------
1 | /* jshint node: true */
2 |
3 | module.exports = function(environment) {
4 | var ENV = {
5 | modulePrefix: 'dummy',
6 | environment: environment,
7 | baseURL: '/',
8 | locationType: 'auto',
9 | EmberENV: {
10 | FEATURES: {
11 | // Here you can enable experimental features on an ember canary build
12 | // e.g. 'with-controller': true
13 | }
14 | },
15 |
16 | APP: {
17 | // Here you can pass flags/options to your application instance
18 | // when it is created
19 | }
20 | };
21 |
22 | if (environment === 'development') {
23 | // ENV.APP.LOG_RESOLVER = true;
24 | // ENV.APP.LOG_ACTIVE_GENERATION = true;
25 | // ENV.APP.LOG_TRANSITIONS = true;
26 | // ENV.APP.LOG_TRANSITIONS_INTERNAL = true;
27 | // ENV.APP.LOG_VIEW_LOOKUPS = true;
28 | }
29 |
30 | if (environment === 'test') {
31 | // Testem prefers this...
32 | ENV.baseURL = '/';
33 | ENV.locationType = 'none';
34 |
35 | // keep test console output quieter
36 | ENV.APP.LOG_ACTIVE_GENERATION = false;
37 | ENV.APP.LOG_VIEW_LOOKUPS = false;
38 |
39 | ENV.APP.rootElement = '#ember-testing';
40 | }
41 |
42 | if (environment === 'production') {
43 |
44 | }
45 |
46 | return ENV;
47 | };
48 |
--------------------------------------------------------------------------------
/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "ember-cli-platforms",
3 | "version": "0.0.0",
4 | "description": "The default blueprint for ember-cli addons.",
5 | "directories": {
6 | "doc": "doc",
7 | "test": "tests"
8 | },
9 | "scripts": {
10 | "build": "ember build",
11 | "start": "ember server",
12 | "test": "ember try:testall"
13 | },
14 | "repository": "",
15 | "engines": {
16 | "node": ">= 0.10.0"
17 | },
18 | "author": "",
19 | "license": "MIT",
20 | "devDependencies": {
21 | "broccoli-asset-rev": "^2.2.0",
22 | "ember-ajax": "0.7.1",
23 | "ember-cli": "2.3.0-beta.2",
24 | "ember-cli-app-version": "^1.0.0",
25 | "ember-cli-dependency-checker": "^1.2.0",
26 | "ember-cli-htmlbars": "^1.0.1",
27 | "ember-cli-htmlbars-inline-precompile": "^0.3.1",
28 | "ember-cli-inject-live-reload": "^1.3.1",
29 | "ember-cli-qunit": "^1.2.1",
30 | "ember-cli-release": "0.2.8",
31 | "ember-cli-sri": "^2.0.0",
32 | "ember-cli-uglify": "^1.2.0",
33 | "ember-data": "^2.3.0",
34 | "ember-disable-prototype-extensions": "^1.1.0",
35 | "ember-disable-proxy-controllers": "^1.0.1",
36 | "ember-export-application-global": "^1.0.4",
37 | "ember-load-initializers": "^0.5.0",
38 | "ember-resolver": "^2.0.3",
39 | "ember-try": "~0.0.8",
40 | "loader.js": "^4.0.0"
41 | },
42 | "keywords": [
43 | "ember-addon"
44 | ],
45 | "dependencies": {
46 | "ember-cli-babel": "^5.1.5"
47 | },
48 | "ember-addon": {
49 | "configPath": "tests/dummy/config"
50 | }
51 | }
52 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | Ember-cli-platforms
2 | ===================
3 |
4 | # Evolving Proposal
5 |
6 | This addon is currently just a proposal (not implemented) and is becoming an RFC.
7 | You can track the RFC here: https://github.com/ember-cli/rfcs/pull/35
8 |
9 |
10 |
11 | ----
12 |
13 | Powerful workflow and build pipeline for cross-platform Ember CLI Applications.
14 |
15 | `ember-cli-platforms` treats platforms as build targets, and gives you a powerful
16 | workflow for producing builds customized to the platform.
17 |
18 | Whether you're building for just one platform, or a dozen `ember-cli-platforms`,
19 | provides streamlined tooling, enhanced resuability, and better separation of concerns.
20 |
21 | ## What are platforms?
22 |
23 | Platforms are roughly equivalent to web views, or a shell which provides a web view
24 | such as a browser.
25 |
26 | Chrome and Firefox extensions as well as projects such as `electron`, `cordova`,
27 | `crosswalk`, `cef`, and `NW.js` provide their own specialized web views which allow you
28 | to ship your Ember application as an installable app.
29 |
30 | ## Installation
31 |
32 | - `ember install ember-cli-platforms`
33 |
34 | ## Plugins
35 |
36 | Platform addons should also implement a default deployment process for ember-cli-deploy.
37 | Custom deployments (such as to phonegap-build or cloudfive or Telerik) should be their
38 | own addons.
39 |
40 | - [Cordova]() `ember install ember-cli-platform-cordova`
41 | - [Crosswalk]() `ember install ember-cli-platform-crosswalk`
42 | - [Chrome]() `ember install ember-cli-platform-chrome`
43 | - [Firefox]() `ember install ember-cli-platform-firefox`
44 | - [MacGap]() `ember install ember-cli-platform-macgap`
45 | - [CEF]() `ember install ember-cli-platform-cef`
46 |
47 | **Advanced Usage**
48 |
49 | The following plugins are available for advanced user. These platforms
50 | come with [security risks]() you should understand before you choose them.
51 |
52 | - [Electron]() `ember install ember-cli-platform-electron`
53 | - [NW.js]() `ember install ember-cli-platform-nwjs`
54 |
55 |
56 | ## Usage
57 |
58 | These are the docs for using `ember-cli-platforms` with an installed platform plugin.
59 | For the docs on creating a platform plugin, [skip ahead](./README.md#creating-plugins).
60 |
61 | **Create a platform.**
62 | ```cli
63 | ember platform [-t ""]
64 | ```
65 |
66 | Generates a new platform of `` with an optional `` parameter used when more than
67 | one instance of a platform is desired.
68 |
69 | For all commands, `platform` can be abbreviated as `p`, and
70 | commands that mirror `ember-cli` commands preserve the `ember-cli`
71 | shorthands for those methods as well.
72 |
73 | **Serve a specific platform.**
74 | ```cli
75 | ember p:s [-]
76 | ```
77 |
78 | This is shorthand for:
79 | ```cli
80 | ember platform:serve --platform="" [--target=""] --environment="development"
81 | ```
82 |
83 | **Build a specific platform.**
84 | ```cli
85 | ember p:b [-]
86 | ```
87 |
88 | **Test a specific platform.**
89 | ```cli
90 | ember p:t [-]
91 | ```
92 |
93 | **Deploy a specific platform.**
94 | ```cli
95 | ember p:d [-]
96 | ```
97 |
98 | This is short hand for:
99 | ```cli
100 | ember platform:deploy --platform="" [--target=""] --deployTarget="" --environment="development"
101 | ```
102 |
103 |
104 | ### Platform Specific Code
105 |
106 | `ember-cli-platforms` leverages in-repo-addon semantics and Broccoli plugins to enable
107 | you to sprinkle platform specific code into your app as needed with "platform addons".
108 |
109 | A platform addon is generated automatically for each platform you create with `ember platform`.
110 |
111 | ```
112 |
113 | /lib
114 | /[-]
115 | ```
116 |
117 | These "addons" function differently from normal addons. Instead of code in the app overriding or importing
118 | code from the addon, the addon take precedence. This let's you selectively replace or add entire modules
119 | as needed.
120 |
121 | You can import the `app` version of a module into the addon.
122 |
123 | ```js
124 | import Foo from '/routes/foo';
125 |
126 | // our platform version of routes/foo
127 | export default Foo.extend({
128 | hello: 'World!'
129 | });
130 | ```
131 |
132 | ### Platform Specific Config
133 |
134 | A platform config file is generated automatically for each platform you create with `ember platform`.
135 | ```
136 |
137 | /config
138 | /platforms
139 | /[-].js
140 | ```
141 |
142 | This configuration will be merged with your primary configuration.
143 |
144 |
145 | ## Creating Plugins
146 |
147 | `ember-cli-platforms` has two forms of plugins:
148 |
149 | 1. `process hooks` which add behaviors to ember-cli-platforms.
150 | 2. `platform plugins` which implement support for a specific platform.
151 | 3. `deploy plugins` which implement support for deployment
152 |
153 | Platform plugins (generally) are also process hooks.
154 |
155 | ## All plugins
156 |
157 | ember-cli-platforms plugins are nothing more than standard ember-cli addons
158 | with 3 small ember-cli-platforms specific traits:
159 |
160 | 1. they contain a package.json keyword to identify them as plugins
161 | 2. they are named ember-cli-platform-*
162 | 3. they return an object that implements one or more of the ember-cli-platforms pipeline hooks
163 |
164 |
165 | ### Creating a Process Hook
166 |
167 | #### Create an addon
168 |
169 | ```cli
170 | ember addon ember-cli-platform-
171 | ```
172 |
173 | #### Mark the addon as a plugin
174 |
175 | Identify your addon as a plugin by updating the package.json like so:
176 |
177 | ```js
178 | // package.json
179 |
180 | "keywords": [
181 | "ember-addon",
182 |
183 | // if present, indicates this addon contains process hooks for ember-cli-platforms
184 | "ember-cli-platform-plugin",
185 |
186 | // if present, indicates this addon contains a platform implementation for ember-cli-platforms
187 | "ember-cli-platform",
188 |
189 | // if present, indicates this addon implements deployment hooks
190 | "ember-cli-platform-deploy"
191 | ]
192 | ```
193 |
194 |
195 | #### Implement one or more pipeline hooks
196 |
197 | In order for a plugin to be useful it must implement one or more of the ember-cli-platforms
198 | pipeline hooks.
199 |
200 | To do this you must implement a function called `createPlatformPlugin` in your `index.js` file.
201 | This function must return an object that contains:
202 |
203 | 1. A name property which is what your plugin will be referred to.
204 | 2. One or more implemented pipeline hooks
205 |
206 | **Example:**
207 |
208 | ```js
209 | module.exports = {
210 | name: 'ember-cli-platform-live-reload',
211 |
212 | createPlatformPlugin: function(options) {
213 | return {
214 | name: "live-reload",
215 |
216 | didBuild: function(context) {
217 | //do something amazing here once the project has been built
218 | }
219 | };
220 | }
221 |
222 | };
223 | ```
224 |
225 | #### Process Hooks
226 |
227 | - configure
228 | - setup
229 | - willBuild
230 | - build
231 | - didBuild
232 | - teardown
233 |
234 |
235 |
236 | ### Creating a Deployment Plugin
237 |
238 | This is built overtop of [ember-cli-deploy](http://ember-cli.com/ember-cli-deploy/docs/v0.5.x/pipeline-hooks/),
239 | but integrates with your platform flow.
240 |
241 | To create a deploy plugin, follow the same steps as for `process hooks`, making sure to
242 | add the keyword `ember-cli-platform-deploy` to `package.json`. The following is a full list
243 | of hooks which can be returned by `createPlatformPlugin` for use with deployment.
244 |
245 | #### All Hooks (including deployment)
246 |
247 | - configure
248 | - setup
249 | - willDeploy
250 | - willBuild, build, didBuild,
251 | - willPrepare, prepare, didPrepare,
252 | - willUpload, upload, didUpload,
253 | - willActivate, activate, didActivate, (only if --activate flag is passed)
254 | - didDeploy,
255 | - teardown
256 |
257 |
258 |
259 | ### Creating a Platform Plugin
260 |
261 | Platform plugins have several concerns they need to manage. They should
262 |
263 | - implement the build hooks of the pipeline
264 | - provide a starter kit for the platform
265 | - provide a CLI proxy for SDK commands
266 | - provide a blueprint for project installation
267 | - run any necessary SDK installation commands
268 | - handle SDK specific file inclusion
269 |
270 | **Command Runners**
271 |
272 | - ember-cli-platform supplied a commandRunner you can use to run CLI commands directly from
273 | the pipeline if necessary.
274 |
275 | **Command Proxies**
276 |
277 | - If your ember-cli-platform-plugin specifies a `commandName`, it will be used to generate
278 | a command proxy for that platform. For instance:
279 |
280 | ```cli
281 | {
282 | commandName: 'cordova'
283 | }
284 | ```
285 |
286 | If a user generates a cordova platform with the following command
287 |
288 | ```cli
289 | ember platform cordova -t "ios"
290 | ```
291 |
292 | Then an `npm` command script will be generated and installed that proxies use of
293 | `cordova-ios` into the cordova project directory ios, allowing you to easily use
294 | the cordova-cli.
295 |
296 | **Minimum Settings**
297 | - `outputDestination`
298 | - `addon-name`
299 |
300 |
301 |
302 | ## FAQ
303 |
304 | **Q: Can I have multiple projects for a given platform?**
305 |
306 | Yes. With Cordova this might look like the following.
307 |
308 | Default setup (one project)
309 | ```cli
310 | ember platform cordova
311 | ```
312 |
313 | Advanced setup (multiple projects)
314 | ```cli
315 | ember platform cordova -t "android"
316 | ```
317 |
318 | **Q: Can I use Live Reload?**
319 |
320 | Yes: platform plugins implement hooks to allow you to live reload when working with simulators
321 | or attached devices. When you `ember s`, it will just work.
322 |
323 | > N.B. here's how ember-cli-cordova was approaching this
324 | > - ember-cli-remote-livereload
325 | > - auto add ``
326 | > - cordova.liveReload.enabled = true
327 | > - cordova.liveReload.platform = 'android'
328 | > - cordova.emberUrl
329 | > - PR https://github.com/poetic/ember-cli-cordova/pull/56
330 |
331 | **Q: Can I use the Ember Inspector?**
332 |
333 | Yes. There's a project specifically for that: [ember-cli-remote-inspector](https://github.com/joostdevries/ember-cli-remote-inspector)
334 |
335 | **Q: Are there platform focused addons I should use?**
336 |
337 | [Suggested Addons]()
338 |
339 |
340 | **Challenge List (unresolved implementation questions)**
341 |
342 | The following concerns are difficult challenges that will need to be fleshed out to properly provide
343 | an abstract process for each platform to be able to utilize.
344 |
345 | - ember serve doesn't resolve promise when serving, nw.js had to hook it
346 | - testing: run tests within the deployment target
347 | - view based tests
348 | - special test runner
349 | - special qunit adapter for testem
350 | - special test command
351 | - testing: run tests for each platform on travis/circle/etc.
352 | - a way to configure `environment.js` if needed (beyond the platform config file, probably just a merge)
353 |
354 | ## Wish List
355 |
356 | - automated iTunesStore and GooglePlay release processes
357 | - device hot-reload deployment
358 | - develop multiple projects with live-reload at once
359 |
--------------------------------------------------------------------------------