From e5c52a92f001d11826d628bfa6e25ffc3791385a Mon Sep 17 00:00:00 2001 From: Eric Rowell Date: Sat, 27 Jul 2013 21:09:33 -0700 Subject: [PATCH] updated build process. dev version no longer pulls the version number from the package.json file. It instead always uses dev. Also set some things up for -beta build support --- Gruntfile.js | 47 +++++++++++++++++++++++--- package.json | 2 +- tests/html/functionalTests.html | 2 +- tests/html/manualTests.html | 2 +- tests/html/performanceTests.html | 2 +- tests/html/special/stageBelowFold.html | 2 +- tests/html/special/tallStage.html | 2 +- tests/html/unitTests.html | 2 +- tests/html/visualTests.html | 2 +- tests/js/unit/globalTests.js | 2 +- 10 files changed, 51 insertions(+), 14 deletions(-) diff --git a/Gruntfile.js b/Gruntfile.js index 52441e53..f1f030c0 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -81,7 +81,15 @@ module.exports = function(grunt) { options: { separator: ';' }, - source: { + dev: { + src: sourceFiles, + dest: 'dist/kinetic-dev.js' + }, + beta: { + src: sourceFiles, + dest: 'dist/kinetic-v<%= pkg.version %>-beta.js' + }, + prod: { src: sourceFiles, dest: 'dist/kinetic-v<%= pkg.version %>.js' }, @@ -92,6 +100,23 @@ module.exports = function(grunt) { }, replace: { dev: { + options: { + variables: { + version: 'dev', + date: '<%= grunt.template.today("yyyy-mm-dd") %>', + nodeParams: '<%= grunt.file.read("doc-includes/NodeParams.txt") %>', + containerParams: '<%= grunt.file.read("doc-includes/ContainerParams.txt") %>', + shapeParams: '<%= grunt.file.read("doc-includes/ShapeParams.txt") %>' + }, + prefix: '@@' + }, + + files: [{ + src: ['dist/kinetic-dev.js'], + dest: 'dist/kinetic-dev.js' + }] + }, + prod1: { options: { variables: { version: '<%= pkg.version %>', @@ -108,7 +133,7 @@ module.exports = function(grunt) { dest: 'dist/kinetic-v<%= pkg.version %>.js' }] }, - prod: { + prod2: { options: { variables: { version: '<%= pkg.version %>', @@ -119,6 +144,18 @@ module.exports = function(grunt) { src: ['dist/kinetic-Global-v<%= pkg.version %>.min.js'], dest: 'dist/kinetic-Global-v<%= pkg.version %>.min.js' }] + }, + prod3: { + options: { + variables: { + version: '<%= pkg.version %>', + }, + prefix: '@@' + }, + files: [{ + src: ['dist/kinetic-v<%= pkg.version %>.min.js'], + dest: 'dist/kinetic-v<%= pkg.version %>.min.js' + }] } }, uglify: { @@ -161,8 +198,8 @@ module.exports = function(grunt) { grunt.loadNpmTasks('grunt-contrib-jshint'); // Tasks - grunt.registerTask('dev', ['clean', 'concat:source', 'replace:dev']); - grunt.registerTask('full', ['clean', 'concat:source', 'replace:dev', 'uglify', 'replace:prod']); + grunt.registerTask('dev', ['clean', 'concat:dev', 'replace:dev']); + grunt.registerTask('full', ['clean', 'concat:prod', 'uglify', 'replace:prod1', 'replace:prod2', 'replace:prod3']); grunt.registerTask('test', ['concat:test']); - grunt.registerTask('hint', ['clean', 'concat:source', 'replace:dev', 'jshint']); + grunt.registerTask('hint', ['clean', 'concat:dev', 'replace:dev', 'jshint']); }; diff --git a/package.json b/package.json index 822aca39..66504bb5 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "KineticJS", - "version": "0.0.0", + "version": "4.5.5", "devDependencies": { "grunt": "~0.4.1", "grunt-contrib-jshint": "~0.5.4", diff --git a/tests/html/functionalTests.html b/tests/html/functionalTests.html index 54b807f4..fb08e7aa 100644 --- a/tests/html/functionalTests.html +++ b/tests/html/functionalTests.html @@ -6,7 +6,7 @@ - + + diff --git a/tests/html/performanceTests.html b/tests/html/performanceTests.html index 467554d1..ffb84efe 100644 --- a/tests/html/performanceTests.html +++ b/tests/html/performanceTests.html @@ -34,7 +34,7 @@ run(Kinetic); - + diff --git a/tests/html/special/stageBelowFold.html b/tests/html/special/stageBelowFold.html index 0faf4054..b46f6418 100644 --- a/tests/html/special/stageBelowFold.html +++ b/tests/html/special/stageBelowFold.html @@ -9,7 +9,7 @@
- + + + diff --git a/tests/html/visualTests.html b/tests/html/visualTests.html index c179c3c2..3d1afbf1 100644 --- a/tests/html/visualTests.html +++ b/tests/html/visualTests.html @@ -6,7 +6,7 @@ - + diff --git a/tests/js/unit/globalTests.js b/tests/js/unit/globalTests.js index b1cb8da6..92f95b17 100644 --- a/tests/js/unit/globalTests.js +++ b/tests/js/unit/globalTests.js @@ -1,5 +1,5 @@ Test.Modules.GLOBAL = { 'test Kinetic version number': function(containerId) { - test(Kinetic.version === '0.0.0', 'Kinetic.version should equal 0.0.0'); + test(Kinetic.version === 'dev', 'Kinetic.version should equal dev'); } };