-
Notifications
You must be signed in to change notification settings - Fork 8
/
ember-addon.js
60 lines (51 loc) · 1.46 KB
/
ember-addon.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
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
/* global require, module */
'use strict';
/**
@module ember-cli
*/
var defaults = require('merge-defaults');
var Funnel = require('broccoli-funnel');
var EmberApp = require('./ember-app');
module.exports = EmberAddon;
/**
EmberAddon is used during addon development.
@class EmberAddon
@extends EmberApp
@constructor
@param options
*/
function EmberAddon() {
var args = [];
var options = {};
console.log("Addon init")
for (var i = 0, l = arguments.length; i < l; i++) {
args.push(arguments[i]);
}
if (args.length === 1) {
options = args[0];
} else if (args.length > 1) {
args.reverse();
options = defaults.apply(null, args);
}
process.env.EMBER_ADDON_ENV = process.env.EMBER_ADDON_ENV || 'development';
this.appConstructor(defaults(options, {
name: 'dummy',
configPath: './tests/dummy/config/environment',
trees: {
app: 'tests/dummy/app',
styles: 'tests/dummy/app/styles',
templates: 'tests/dummy/app/templates',
public: 'tests/dummy/public',
tests: new Funnel('tests', {
exclude: [ /^dummy/ ]
})
},
jshintrc: {
tests: './tests',
app: './tests/dummy'
},
}));
}
EmberAddon.prototype = Object.create(EmberApp.prototype);
EmberAddon.prototype.constructor = EmberAddon;
EmberAddon.prototype.appConstructor = EmberApp.prototype.constructor;