Skip to content

Commit 0aae4ce

Browse files
committed
ng-app: copy angular files using renderer grunt target.
1 parent 84b8a9b commit 0aae4ce

File tree

2 files changed

+10
-24
lines changed

2 files changed

+10
-24
lines changed

gruntfile.js

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -61,18 +61,10 @@ module.exports = function(grunt) {
6161
copy: {
6262
angularSource: {
6363
expand: true,
64-
rename: function(dest, src) {
65-
if (/\.js$/i.test(src)) {
66-
return dest + src.substring(0, src.length - 3) + '.ts';
67-
}
68-
if (/\.es6$/i.test(src)) {
69-
return dest + src.substring(0, src.length - 4) + '.ts';
70-
}
71-
return dest + src;
72-
},
7364
cwd: './deps/angular/modules',
7465
src: [
7566
'angular2/**/*',
67+
'!angular2/**/*.dart',
7668
'!angular2/test/**/*',
7769
'!angular2/angular2_sfx*',
7870
'!angular2/router*',

ng-sample/gruntfile.js

Lines changed: 9 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,14 @@ module.exports = function(grunt) {
6363
},
6464
},
6565
shell: {
66+
updateAngular: {
67+
command: "grunt copy:angularSource --angularDest ng-sample/src",
68+
options: {
69+
execOptions: {
70+
cwd: '..',
71+
}
72+
}
73+
},
6674
localInstallModules: {
6775
command: "npm install \"<%= nsPackagePath %>\""
6876
},
@@ -90,15 +98,6 @@ module.exports = function(grunt) {
9098
}
9199
});
92100

93-
grunt.registerTask("checkAngular", function() {
94-
if (!grunt.file.exists(path.join(angularSrcPath, 'angular2'))) {
95-
grunt.fail.fatal("angular2 path does not exist.");
96-
}
97-
if (!grunt.file.exists(path.join(angularSrcPath, 'nativescript-angular'))) {
98-
grunt.fail.fatal("nativescript-angular path does not exist.");
99-
}
100-
});
101-
102101
grunt.registerTask("app", [
103102
"copy:appFiles",
104103
"ts:build",
@@ -125,11 +124,6 @@ module.exports = function(grunt) {
125124
"shell:localInstallModules",
126125
]);
127126

128-
grunt.registerTask("updateAngular", [
129-
"checkAngular",
130-
"copy:angularFiles",
131-
]);
132-
133127
grunt.registerTask("prepareQuerystringPackage", function() {
134128
//The {N} require doesn't look for index.js automatically
135129
//so we need to declare it as main
@@ -142,7 +136,7 @@ module.exports = function(grunt) {
142136

143137
grunt.registerTask("prepare", [
144138
"updateModules",
145-
"updateAngular",
139+
"shell:updateAngular",
146140
"prepareQuerystringPackage",
147141
]);
148142

0 commit comments

Comments
 (0)