Build: Remove the build task and it's dependencies. Will bring back testing against minified files later.

This commit is contained in:
Jörn Zaefferer 2013-09-20 18:15:55 +02:00
parent 041e0ec492
commit 9ef09edc79
4 changed files with 4 additions and 86 deletions

View File

@ -67,19 +67,6 @@ var
}
},
minifyCSS = {
options: {
keepSpecialComments: 0
},
main: {
options: {
keepSpecialComments: "*"
},
src: "dist/jquery-ui.css",
dest: "dist/jquery-ui.min.css"
}
},
compareFiles = {
all: [
"dist/jquery-ui.js",
@ -107,16 +94,6 @@ uiFiles.concat( allI18nFiles ).forEach(function( file ) {
minify[ file ].files[ mapMinFile( file ) ] = file;
});
cssFiles.forEach(function( file ) {
minifyCSS[ file ] = {
options: {
banner: createBanner()
},
src: file,
dest: "dist/" + file.replace( /\.css$/, ".min.css" ).replace( /themes\/base\//, "themes/base/minified/" )
};
});
uiFiles.forEach(function( file ) {
// TODO this doesn't do anything until https://github.com/rwldrn/grunt-compare-size/issues/13
compareFiles[ file ] = [ file, mapMinFile( file ) ];
@ -128,7 +105,6 @@ grunt.loadNpmTasks( "grunt-contrib-uglify" );
grunt.loadNpmTasks( "grunt-contrib-concat" );
grunt.loadNpmTasks( "grunt-contrib-qunit" );
grunt.loadNpmTasks( "grunt-contrib-csslint" );
grunt.loadNpmTasks( "grunt-contrib-cssmin" );
grunt.loadNpmTasks( "grunt-html" );
grunt.loadNpmTasks( "grunt-compare-size" );
grunt.loadNpmTasks( "grunt-git-authors" );
@ -186,20 +162,12 @@ grunt.initConfig({
}
},
uglify: minify,
cssmin: minifyCSS,
htmllint: {
// ignore files that contain invalid html, used only for ajax content testing
all: grunt.file.expand( [ "demos/**/*.html", "tests/**/*.html" ] ).filter(function( file ) {
return !/(?:ajax\/content\d\.html|tabs\/data\/test\.html|tests\/unit\/core\/core.*\.html)/.test( file );
})
},
copy: {
dist_units_images: {
src: "themes/base/images/*",
strip: /^themes\/base\//,
dest: "dist/"
}
},
qunit: {
files: expandFiles( "tests/unit/**/*.html" ).filter(function( file ) {
// disabling everything that doesn't (quite) work with PhantomJS for now
@ -249,7 +217,4 @@ grunt.registerTask( "test", [ "qunit" ] );
grunt.registerTask( "sizer", [ "concat:ui", "uglify:main", "compare_size:all" ] );
grunt.registerTask( "sizer_all", [ "concat:ui", "uglify", "compare_size" ] );
// "copy:dist_units_images" is used by unit tests
grunt.registerTask( "build", [ "concat", "uglify", "cssmin", "copy:dist_units_images" ] );
};

View File

@ -2,21 +2,6 @@ module.exports = function( grunt ) {
"use strict";
var fs = require( "fs" );
function expandFiles( files ) {
return grunt.util._.pluck( grunt.file.expandMapping( files ), "src" ).filter(function(filepath) {
// restrict to files, exclude folders
try {
return fs.statSync( filepath[ 0 ] ).isFile();
} catch(e) {
throw grunt.task.taskError(e.message, e);
}
}).map(function( values ) {
return values[ 0 ];
});
}
grunt.registerTask( "manifest", "Generate jquery.json manifest files", function() {
var pkg = grunt.config( "pkg" ),
base = {
@ -96,41 +81,6 @@ grunt.registerTask( "manifest", "Generate jquery.json manifest files", function(
});
});
grunt.registerMultiTask( "copy", "Copy files to destination folder and replace @VERSION with pkg.version", function() {
function replaceVersion( source ) {
return source.replace( /@VERSION/g, grunt.config( "pkg.version" ) );
}
function copyFile( src, dest ) {
if ( /(js|css)$/.test( src ) ) {
grunt.file.copy( src, dest, {
process: replaceVersion
});
} else {
grunt.file.copy( src, dest );
}
}
var files = expandFiles( this.filesSrc ),
target = this.data.dest + "/",
strip = this.data.strip,
renameCount = 0,
fileName;
if ( typeof strip === "string" ) {
strip = new RegExp( "^" + grunt.template.process( strip, grunt.config() ).replace( /[\-\[\]{}()*+?.,\\\^$|#\s]/g, "\\$&" ) );
}
files.forEach(function( fileName ) {
var targetFile = strip ? fileName.replace( strip, "" ) : fileName;
copyFile( fileName, target + targetFile );
});
grunt.log.writeln( "Copied " + files.length + " files." );
for ( fileName in this.data.renames ) {
renameCount += 1;
copyFile( fileName, target + grunt.template.process( this.data.renames[ fileName ], grunt.config() ) );
}
if ( renameCount ) {
grunt.log.writeln( "Renamed " + renameCount + " files." );
}
});
grunt.registerTask( "clean", function() {
require( "rimraf" ).sync( "dist" );
});

View File

@ -62,7 +62,6 @@
"grunt-contrib-concat": "0.1.3",
"grunt-contrib-qunit": "0.2.0",
"grunt-contrib-csslint": "0.1.1",
"grunt-contrib-cssmin": "0.4.2",
"grunt-compare-size": "0.4.0-rc.3",
"grunt-html": "0.3.3",
"grunt-git-authors": "1.2.0",

View File

@ -27,11 +27,15 @@ QUnit.reset = function() {
QUnit.config.requireExpects = true;
/*
// TODO: Add back the ability to test against minified files
// see QUnit.urlParams.min usage below
QUnit.config.urlConfig.push({
id: "min",
label: "Minified source",
tooltip: "Load minified source files instead of the regular unminified ones."
});
*/
TestHelpers.loadResources = QUnit.urlParams.min ?
function() {