Skip to content

Commit

Permalink
Build: Validate number of generated manifests
Browse files Browse the repository at this point in the history
Closes gh-1241
  • Loading branch information
jzaefferer committed May 9, 2014
1 parent 0645ac4 commit 5bbf276
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion build/tasks/build.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@ module.exports = function( grunt ) {
"use strict";

grunt.registerTask( "manifest", "Generate jquery.json manifest files", function() {
var pkg = grunt.config( "pkg" ),
var uiFiles,
totalManifests = 0,
pkg = grunt.config( "pkg" ),
base = {
core: {
name: "ui.{plugin}",
Expand Down Expand Up @@ -76,8 +78,16 @@ grunt.registerTask( "manifest", "Generate jquery.json manifest files", function(

grunt.file.write( manifest.name + ".jquery.json",
JSON.stringify( manifest, null, "\t" ) + "\n" );
totalManifests += 1;
});
});

uiFiles = grunt.file.expand( "ui/*.js" ).length;
if ( totalManifests !== uiFiles ) {
grunt.log.error( "Generated " + totalManifests + " manifest files, but there are " +
uiFiles + " ui/*.js files. Do all of them have entries?" );
return false;
}
});

grunt.registerTask( "clean", function() {
Expand Down

0 comments on commit 5bbf276

Please sign in to comment.