/* jshint node: true */
/* global require, module, process */

var EmberAddon = require( 'ember-cli/lib/broccoli/ember-addon' );
var replace = require( 'broccoli-string-replace' );
var env = require( './config/environment' );
var isProduction = ( process.env.EMBER_ENV || 'development' ) === 'production';
var package = require( './package.json' );
var tree;

var app = new EmberAddon({
    fingerprint: {
        enabled: true,
        exclude: [],
        extensions: [ 'png', 'jpg', 'gif' ],
        prepend: env().baseAssetsURL,
        replaceExtensions: [ 'html', 'css', 'js' ]
    }
});

// Use `app.import` to add additional libraries to the generated
// output files.
//
// If you need to use different assets in different
// environments, specify an object as the first parameter. That
// object's keys should be the environment name and the values
// should be the asset to use in that environment.
//
// If the library that you are including contains AMD or ES6
// modules that you would like to import into your application
// please specify an object with the list of modules as keys
// along with the exports of each module as its value.

// Development dependencies
if ( !isProduction ) {
    app.import( app.bowerDirectory + '/sinonjs/sinon.js', {
        type: 'test'
    });

    app.import( app.bowerDirectory + '/sinon-qunit/lib/sinon-qunit.js', {
        type: 'test'
    });

    app.import( app.bowerDirectory + '/ember/ember-template-compiler.js', {
        type: 'test'
    });
}

tree = replace( app.toTree(), {
    files: [
        'index.html',
        'assets/dummy.js'
    ],

    patterns: [
        {
            match: /REPLACE_META_DESCRIPTION/g,
            replacement: package[ 'description' ]
        }, {
            match: /REPLACE_META_KEYWORDS/g,
            replacement: package[ 'keywords' ].join( ', ' ) + ', ember, ember cli'
        }, {
            match: /REPLACE_APPLICATION_VERSION/g,
            replacement: package[ 'version' ]
        }
    ]
});

module.exports = tree;

@@ -310,16 +310,22 @@
  package
+Config
  = requi
@@ -1713,16 +1713,22 @@
  package
+Config
 %5B 'descr
@@ -1827,16 +1827,22 @@
  package
+Config
 %5B 'keywo
@@ -1980,16 +1980,22 @@
  package
+Config
 %5B 'versi

Change var name to non-reserved word