Skip to content

Commit 5bbf276

Browse files
committed
Build: Validate number of generated manifests
Closes jquerygh-1241
1 parent 0645ac4 commit 5bbf276

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

build/tasks/build.js

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,9 @@ module.exports = function( grunt ) {
33
"use strict";
44

55
grunt.registerTask( "manifest", "Generate jquery.json manifest files", function() {
6-
var pkg = grunt.config( "pkg" ),
6+
var uiFiles,
7+
totalManifests = 0,
8+
pkg = grunt.config( "pkg" ),
79
base = {
810
core: {
911
name: "ui.{plugin}",
@@ -76,8 +78,16 @@ grunt.registerTask( "manifest", "Generate jquery.json manifest files", function(
7678

7779
grunt.file.write( manifest.name + ".jquery.json",
7880
JSON.stringify( manifest, null, "\t" ) + "\n" );
81+
totalManifests += 1;
7982
});
8083
});
84+
85+
uiFiles = grunt.file.expand( "ui/*.js" ).length;
86+
if ( totalManifests !== uiFiles ) {
87+
grunt.log.error( "Generated " + totalManifests + " manifest files, but there are " +
88+
uiFiles + " ui/*.js files. Do all of them have entries?" );
89+
return false;
90+
}
8191
});
8292

8393
grunt.registerTask( "clean", function() {

0 commit comments

Comments
 (0)