Skip to content

Commit 8db77f2

Browse files
committed
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 angular#284
1 parent e32ddcc commit 8db77f2

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

75 files changed

+728
-866
lines changed

.gitignore

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
11
# Don’t commit the following directories created by pub.
2-
build/
3-
benchpress-build/
2+
/dist/
43
packages/
54
.buildlog
65
node_modules
7-
packages
86
.pub
97
.DS_STORE
108

@@ -21,4 +19,4 @@ pubspec.lock
2119
.idea/
2220

2321

24-
docs/bower_components/
22+
/docs/bower_components/

README.md

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,13 @@
2525

2626
### Build:
2727

28-
1. `gulp build` -> result is in `build` folder
28+
1. `gulp build` -> result is in `dist` folder
2929

3030
* will also run `pub get` for the subfolders in `modules`
3131
and run `dartanalyzer` for every file that matches
3232
`<module>/src/<module>.dart`, e.g. `di/src/di.dart`
3333

34-
2. `gulp clean` -> cleans the `build` folder
34+
2. `gulp clean` -> cleans the `dist` folder
3535

3636
### Tests:
3737

@@ -45,25 +45,18 @@ the transpiler is reloaded. With that it is possible to make changes
4545
to the preprocessor and run the tests without exiting karma
4646
(just touch a test file that you would like to run).
4747

48-
Restriction for Dart tests (for now):
49-
50-
* Due to a bug `karma-dart` plugin,
51-
this will use the files in the `build` folder for resolving
52-
`package:` dependencies (created e.g. for `import ... from 'di:di'`).
53-
So you need to execute `gulp build` before this.
54-
5548
### Examples:
5649

5750
To see the examples, first build the project as described above.
5851

5952
#### Hello World Example
6053
This example consists of three basic pieces - a component, a decorator and a service.
6154
They are all constructed via injection. For more information see the comments in the
62-
source `modules/examples/src/hello_world/app.js`.
55+
source `modules/examples/src/hello_world/index.js`.
6356

6457
You can build this example as either JS or Dart app:
65-
* (JS) `gulp serve` and open `localhost:8000/js/examples/lib/hello_world/` in Chrome.
66-
* (Dart) `gulp examples/pub.serve` and open `localhost:8080` in Chrome(for dart2js) or dartium(for dart vm).
58+
* (JS) `gulp serve.js.dev` and open `localhost:8000/examples/web/hello_world/` in Chrome.
59+
* (Dart) `gulp serve/examples.dart` and open `localhost:8080` in Chrome(for dart2js) or dartium(for dart vm).
6760

6861
## Debug the transpiler
6962

docs/dgeni-package/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ module.exports = new Package('angular', [jsdocPackage, nunjucksPackage])
4545

4646
// Configure file writing
4747
.config(function(writeFilesProcessor) {
48-
writeFilesProcessor.outputFolder = 'build/docs';
48+
writeFilesProcessor.outputFolder = 'dist/docs';
4949
})
5050

5151

docs/dgeni-package/services/atParser.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
var traceur = require('traceur/src/node/traceur.js');
22
var ParseTreeVisitor = System.get(System.map.traceur + '/src/syntax/ParseTreeVisitor').ParseTreeVisitor;
3-
var file2modulename = require('../../../file2modulename');
3+
var file2modulename = require('../../../tools/build/file2modulename');
44
/**
55
* Wrapper around traceur that can parse the contents of a file
66
*/

0 commit comments

Comments
 (0)