]> source.dussan.org Git - jquery-ui.git/commitdiff
Build: Validate number of generated manifests 1241/head
authorJörn Zaefferer <joern.zaefferer@gmail.com>
Thu, 8 May 2014 18:57:19 +0000 (20:57 +0200)
committerJörn Zaefferer <joern.zaefferer@gmail.com>
Fri, 9 May 2014 16:07:20 +0000 (18:07 +0200)
Closes gh-1241

build/tasks/build.js

index 3d399884e7598fc96d00e7e0e16a9fef39bb38a1..ca8eca9bfb4d486c325c13e20a721206bc4a48ea 100644 (file)
@@ -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() {