@@ -115,13 +115,13 @@ module.exports = function(grunt) {
115
115
} ,
116
116
117
117
includereplace : {
118
- production : {
118
+ withGoogle : {
119
119
options : {
120
120
// Task-specific options go here.
121
- prefix : '@@' ,
121
+ prefix : '@Goo @' ,
122
122
includesDir : '.' ,
123
123
processIncludeContents : function ( includeContents , localVars , filePath ) {
124
- if ( filePath . indexOf ( grunt . config . get ( 'googleAdapterPath' ) ) != - 1 ) {
124
+ if ( filePath . indexOf ( grunt . config . get ( 'googleAdapterPath' ) ) !== - 1 ) {
125
125
// Indent file and indent Google's exports
126
126
return includeContents
127
127
// Comment export
@@ -141,7 +141,20 @@ module.exports = function(grunt) {
141
141
] ,
142
142
// Destination directory to copy files to
143
143
dest : './'
144
- }
144
+ } ,
145
+ withPluginInfo : {
146
+ options : {
147
+ // Task-specific options go here.
148
+ prefix : '@Tem@' ,
149
+ includesDir : '<%= pluginInfoRoot %>/' ,
150
+ } ,
151
+ // Files to perform replacements and includes with
152
+ src : [
153
+ '<%= production %>/*.js' ,
154
+ ] ,
155
+ // Destination directory to copy files to
156
+ dest : './'
157
+ } ,
145
158
} ,
146
159
147
160
jshint : {
@@ -159,7 +172,8 @@ module.exports = function(grunt) {
159
172
node : true
160
173
} , grunt . file . readJSON ( '.jshintrc' ) ) ,
161
174
src : [
162
- 'tests/*_test.js'
175
+ 'tests/*.js' ,
176
+ 'tests/unit/*.js'
163
177
]
164
178
} ,
165
179
app : {
@@ -279,6 +293,13 @@ module.exports = function(grunt) {
279
293
grunt . log . writeln ( 'bamboo/vars file successfully created' ) ;
280
294
} ) ;
281
295
296
+ grunt . registerTask ( 'CheckSubmodules' , 'Checks that third_party/adapter is properly checked out' , function ( ) {
297
+ if ( ! grunt . file . exists ( grunt . config . get ( 'googleAdapterPath' ) ) ) {
298
+ grunt . fail . fatal ( 'Couldn\'t find ' + grunt . config . get ( 'googleAdapterPath' ) + '\n' +
299
+ 'Output would be incomplete. Did you remember to initialize submodules?\nPlease run: git submodule update --init' ) ;
300
+ }
301
+ } ) ;
302
+
282
303
grunt . registerTask ( 'CheckPluginInfo' , 'Checks for existing config file' , function ( ) {
283
304
var fullPath = grunt . config . get ( 'pluginInfoRoot' ) + '/' + grunt . config . get ( 'pluginInfoFile' ) ;
284
305
grunt . verbose . writeln ( 'Checking that the plugin info file exists.' ) ;
@@ -290,18 +311,24 @@ module.exports = function(grunt) {
290
311
}
291
312
} ) ;
292
313
293
- grunt . registerTask ( 'dev' , [
294
- 'CheckPluginInfo' ,
295
- 'versionise' ,
296
- 'clean:production' ,
297
- 'concat' ,
298
- 'replace:production' ,
299
- 'includereplace:production' ,
300
- 'uglify'
301
- ] ) ;
314
+ // NOTE(J-O) Prep for webrtc-adapter 0.2.10, will need to be compiled
315
+ grunt . registerTask ( 'webrtc-adapter' , 'Build the webrtc-adapter submodule' , function ( ) {
316
+ grunt . verbose . writeln ( 'Spawning child process to compile webrtc-adapter subgrunt.' ) ;
317
+ var done = this . async ( ) ;
318
+ var child = grunt . util . spawn ( {
319
+ grunt : true ,
320
+ args : [ '--gruntfile' , './third_party/adapter/Gruntfile.js' , 'build' ] ,
321
+ opts : { stdio : 'inherit' } ,
322
+ } , function ( error , result ) { } ) ;
323
+ child . on ( 'close' , function ( code ) {
324
+ done ( code === 0 ) ;
325
+ } ) ;
326
+ } ) ;
302
327
303
328
grunt . registerTask ( 'publish' , [
329
+ 'CheckSubmodules' ,
304
330
'CheckPluginInfo' ,
331
+ // 'webrtc-adapter',
305
332
'versionise' ,
306
333
'clean:production' ,
307
334
'concat' ,
0 commit comments