refactor(build): simplify and modularize

simplify:
- use same html file for dart and JS
- build benchmarks automatically when doing `gulp build`
- centralize configuration

modularize:
- move all build tasks into separate node.js modules under
  `tools/build`.

changes:
- the `build` folder is now the `dist` folder

Closes #284
This commit is contained in:
Tobias Bosch
2014-12-05 16:26:30 -08:00
parent e32ddcc7eb
commit 8db77f2405
75 changed files with 710 additions and 848 deletions

View File

@ -1,11 +0,0 @@
library injector_get_benchmark;
import './injector_instantiate_benchmark.dart' as b;
import 'dart:js' as js;
main () {
js.context['benchmarkSteps'].add(new js.JsObject.jsify({
"name": "Injector.instantiate",
"fn": new js.JsFunction.withThis((_) => b.run())
}));
}

View File

@ -1,15 +0,0 @@
System.import('benchmarks/di/injector_get_benchmark').then(function (bm) {
window.benchmarkSteps.push({name: 'Injector.get (token)', fn: bm.run});
}, console.log.bind(console));
System.import('benchmarks/di/injector_get_by_key_benchmark').then(function (bm) {
window.benchmarkSteps.push({name: 'Injector.get (key)', fn: bm.run});
}, console.log.bind(console));
System.import('benchmarks/di/injector_get_child_benchmark').then(function (bm) {
window.benchmarkSteps.push({name: 'Injector.get (grand x 5 child)', fn: bm.run});
}, console.log.bind(console));
System.import('benchmarks/di/injector_instantiate_benchmark').then(function (bm) {
window.benchmarkSteps.push({name: 'Injector.instantiate', fn: bm.run});
}, console.log.bind(console));

View File

@ -1,11 +0,0 @@
module.exports = function(config) {
config.set({
scripts: [
{src: '/js/traceur-runtime.js'},
{src: '/js/es6-module-loader-sans-promises.src.js'},
{src: '/js/extension-register.js'},
{src: 'register_system.js'},
{src: 'benchmark.js'}
]
});
};

View File

@ -0,0 +1 @@
$SCRIPTS$

View File

@ -0,0 +1,24 @@
import * as injector_get_benchmark from './injector_get_benchmark';
import * as injector_get_by_key_benchmark from './injector_get_by_key_benchmark';
import * as injector_get_child_benchmark from './injector_get_child_benchmark';
import * as injector_instantiate_benchmark from './injector_instantiate_benchmark';
import {benchmark, benchmarkStep} from 'benchpress/benchpress';
export function main() {
benchmark(`Injector.get (token)`, function() {
benchmarkStep('run', injector_get_benchmark.run);
});
benchmark(`Injector.get (key)`, function() {
benchmarkStep('run', injector_get_by_key_benchmark.run);
});
benchmark(`Injector.get (grand x 5 child)`, function() {
benchmarkStep('run', injector_get_child_benchmark.run);
});
benchmark(`Injector.instantiate`, function() {
benchmarkStep('run', injector_instantiate_benchmark.run);
});
}

View File

@ -1,11 +0,0 @@
System.paths = {
'core/*': '/js/core/lib/*.js',
'change_detection/*': '/js/change_detection/lib/*.js',
'facade/*': '/js/facade/lib/*.js',
'di/*': '/js/di/lib/*.js',
'rtts_assert/*': '/js/rtts_assert/lib/*.js',
'test_lib/*': '/js/test_lib/lib/*.js',
'benchmarks/*': '/js/benchmarks/lib/*.js',
'reflection/*': '/js/reflection/lib/*.js'
};
register(System);