
import path from 'path'

let cleanLifecycle = ['pre-clean', 'clean', 'post-clean']

let buildLifecycle = ['validate', 'initialize', 'resources', 'compile', 'test-compile', 'test', 'package', 'deploy']

let extensions = {
  javascript: '.js',
  typescript: '.ts',
  css: '.css',
  sass: '.scss',
  html: '.html',
  sourcemap: '.map',
  png: '.png',
  jpg: '.jpg',
  jpeg: '.jpeg',
  gif: '.gif',
  svg: '.svg'
}

let src = './src/main/app/'

let folders = {
  root: './',
  dist: './dist',
  temp: './.tmp',
  src: src,
  styles: src + 'styles',
  scripts: src + 'scripts',
  images: src + 'images',
  typings: './typings',
  nodeModules: './node_modules',
  jspmPackages: './jspm_packages'
}

let globs = {
  any: '/**/*',
  scripts: {
    javascript: '/**/*' + extensions.javascript,
    typescript: '/**/*' + extensions.typescript
  },
  styles: {
    css: '/**/*' + extensions.css,
    sass: '/**/*' + extensions.sass,
    vendor: path.join(folders.styles, '/vendor' + '{' + extensions.sass + ',' + extensions.css + '}')
  },
  images: path.join(folders.images, '/**/*' + '{' + extensions.png + ',' + extensions.jpg + ',' + extensions.jpeg + ',' + extensions.gif + ',' + extensions.svg + '}'),
  html: '/**/*' + extensions.html,
  sourcemaps: '/**/*' + extensions.sourcemap
}

let files = {
  any: '*',
  packageJSON: path.join(folders.root, 'package.json'),
  typeScriptDefinitions: path.join(folders.typings, globs.scripts.typescript),
  systemjsConfigDefault: 'jspm.conf.js'
}

export default {
  buildLifecycle,
  cleanLifecycle,
  extensions,
  files,
  folders,
  globs
}

@@ -23,183 +23,35 @@
 h'%0A%0A
-let cleanLifecycle = %5B'pre-clean', 'clean', 'post-clean'%5D%0A%0Alet buildLifecycle = %5B'validate', 'initialize', 'resources', 'compile', 'test-compile', 'test', 'package', 'deploy'%5D
+import utils from './utils'
 %0A%0Ale
@@ -1334,101 +1334,1863 @@
 %0A%7D%0A%0A
-export default %7B%0A  buildLifecycle,%0A  cleanLifecycle,%0A  extensions,%0A  files,%0A  folders,%0A  globs
+let buildTime = new Date().toISOString().replace(/-%7C:/g, '')%0A%0Alet finalJsBundleName = 'bundle.min.' + buildTime + extensions.javascript%0A%0Alet javascript = %7B%0A  src: %5B%0A    path.join(folders.src, globs.scripts.javascript)%0A  %5D,%0A  srcDist: path.join(folders.temp, '/core/boot.js'),%0A  dest: folders.temp,%0A  destDist: path.join(folders.dist, folders.scripts, finalJsBundleName),%0A  finalJsBundlePath: path.join(folders.scripts, finalJsBundleName)%0A%7D%0A%0Alet typescript = %7B%0A  srcAppOnly: %5B%0A    path.join(folders.src, globs.scripts.typescript)%0A  %5D,%0A  dest: folders.temp // JavaScript code is emitted in the temp folder%0A%7D%0A%0Alet finalCSSBundleName = 'bundle.min.' + buildTime + '.css'%0Alet finalCSSVendorBundleName = 'vendor.min.' + buildTime + '.css'%0A%0Alet styles = %7B%0A  src: %5B%0A    path.join(folders.src, globs.styles.css),%0A    path.join(folders.src, globs.styles.sass)%0A  %5D,%0A  srcVendorOnly: %5B%0A    path.join(folders.src, globs.styles.vendor)%0A  %5D,%0A  srcWithoutVendor: %5B%0A    path.join(folders.src, globs.styles.css),%0A    path.join(folders.src, globs.styles.sass),%0A    utils.exclude(path.join(folders.src, globs.styles.vendor))%0A  %5D,%0A  dest: folders.temp, // for DEV%0A  destFiles: path.join(folders.temp, globs.styles.css), // for DEV%0A  destDist: path.join(folders.dist, folders.styles), // for PROD%0A  finalCssBundleFilename: finalCSSBundleName,%0A  finalCssBundlePath: path.join(folders.styles, finalCSSBundleName),%0A  finalVendorCssBundleFilename: finalCSSVendorBundleName,%0A  finalVendorCssBundlePath: path.join(folders.styles, finalCSSVendorBundleName)%0A%7D%0A%0Alet images = %7B%0A  src: %5B%0A    path.join(folders.src, globs.images)%0A  %5D,%0A  dest: path.join(folders.dist, folders.images)%0A%7D%0A%0Alet html = %7B%0A  src: %5B%0A    path.join(folders.src, globs.html)%0A  %5D,%0A  dest: folders.dist%0A%7D%0A%0Aexport default %7B%0A  extensions,%0A  files,%0A  folders,%0A  globs,%0A  javascript,%0A  typescript,%0A  styles,%0A  images,%0A  html
 %0A%7D%0A

Add config necessary for new tasks: