Skip to content

Commit 841f878

Browse files
yjbanovtbosch
authored andcommitted
refactor(transformer): precompile stylesheets
Part of angular#3605
1 parent 52236bd commit 841f878

10 files changed

Lines changed: 771 additions & 17 deletions

File tree

gulpfile.js

Lines changed: 21 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -744,24 +744,31 @@ gulp.task('test.unit.cjs', ['build/clean.js', 'build.tools'], function (neverDon
744744
watch('modules/**', buildAndTest);
745745
});
746746

747-
747+
// Use this target to continuously run dartvm unit-tests (such as transformer
748+
// tests) while coding. Note: these tests do not use Karma.
748749
gulp.task('test.unit.dartvm', function (done) {
749750
runSequence(
750751
'build/tree.dart',
751752
'build/pure-packages.dart',
752-
'build/pubspec.dart',
753+
'!build/pubget.angular2.dart',
753754
'!build/change_detect.dart',
754755
'!test.unit.dartvm/run',
755756
function(error) {
756-
// if initial build failed (likely due to build or formatting step) then exit
757-
// otherwise karma server doesn't start and we can't continue running properly
758-
if (error) {
759-
done(error);
760-
return;
761-
}
762-
757+
// Watch for changes made in the TS and Dart code under "modules" and
758+
// run ts2dart and test change detector generator prior to rerunning the
759+
// tests.
763760
watch('modules/angular2/**', { ignoreInitial: true }, [
764761
'!build/tree.dart',
762+
'!build/change_detect.dart',
763+
'!test.unit.dartvm/run'
764+
]);
765+
766+
// Watch for changes made in Dart code under "modules_dart", then copy it
767+
// to dist and run test change detector generator prior to retunning the
768+
// tests.
769+
watch('modules_dart/**', { ignoreInitial: true }, [
770+
'build/pure-packages.dart',
771+
'!build/change_detect.dart',
765772
'!test.unit.dartvm/run'
766773
]);
767774
}
@@ -863,14 +870,17 @@ gulp.task('build/pure-packages.dart', function() {
863870
var transformStream = gulp
864871
.src([
865872
'modules_dart/transform/**/*',
866-
'!modules_dart/transform/**/*.proto'
873+
'!modules_dart/transform/**/*.proto',
874+
'!modules_dart/transform/pubspec.yaml',
875+
'!modules_dart/transform/**/packages{,/**}',
867876
])
868877
.pipe(gulp.dest(path.join(CONFIG.dest.dart, 'angular2')));
869878

870879
var moveStream = gulp.src([
871880
'modules_dart/**/*.dart',
872881
'modules_dart/**/pubspec.yaml',
873-
'!modules_dart/transform/**'
882+
'!modules_dart/transform/**',
883+
'!modules_dart/**/packages{,/**}'
874884
])
875885
.pipe(through2.obj(function(file, enc, done) {
876886
if (/pubspec.yaml$/.test(file.path)) {

modules/angular2/pubspec.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ environment:
1111
dependencies:
1212
analyzer: '>=0.24.4 <0.27.0'
1313
barback: '^0.15.2+2'
14+
csslib: '>=0.12.0 <1.0.0'
1415
code_transformers: '^0.2.8'
1516
dart_style: '>=0.1.8 <0.3.0'
1617
glob: '^1.0.0'

0 commit comments

Comments
 (0)