From 5bbf27620504ec92cbeb3a907535f100b8d9586f Mon Sep 17 00:00:00 2001 From: =?utf8?q?Jo=CC=88rn=20Zaefferer?= Date: Thu, 8 May 2014 20:57:19 +0200 Subject: [PATCH] Build: Validate number of generated manifests Closes gh-1241 --- build/tasks/build.js | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/build/tasks/build.js b/build/tasks/build.js index 3d399884e..ca8eca9bf 100644 --- a/build/tasks/build.js +++ b/build/tasks/build.js @@ -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}", @@ -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() { -- 2.39.5