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

This commit is contained in:
Eric Rowell 2013-07-27 21:09:33 -07:00
parent 57a9313a7b
commit e5c52a92f0
10 changed files with 51 additions and 14 deletions

View File

@ -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']);
};

View File

@ -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",

View File

@ -6,7 +6,7 @@
</style>
<link rel="stylesheet" type="text/css"href="../base.css">
<script src="../../dist/kinetic-v0.0.0.js"></script>
<script src="../../dist/kinetic-dev.js"></script>
<script src="../js/Test.js"></script>
<script src="../js/functionalTests.js"></script>
<script>

View File

@ -2,7 +2,7 @@
<html>
<head>
<link rel="stylesheet" type="text/css"href="../base.css">
<script src="../../dist/kinetic-v0.0.0.js"></script>
<script src="../../dist/kinetic-dev.js"></script>
<!-- assets -->
<script src="../js/Test.js"></script>

View File

@ -34,7 +34,7 @@
run(Kinetic);
</script>
<script src="../../dist/kinetic-v0.0.0.js"></script>
<script src="../../dist/kinetic-dev.js"></script>
<script>
run(Kinetic);
</script>

View File

@ -9,7 +9,7 @@
</head>
<body>
<div id="container"></div>
<script src="../../../dist/kinetic-v0.0.0.js"></script>
<script src="../../../dist/kinetic-dev.js"></script>
<script src="../../js/Test.js"></script>
<script>
var stage = new Kinetic.Stage({

View File

@ -7,7 +7,7 @@
</head>
<body>
<div id="container"></div>
<script src="../../../dist/kinetic-v0.0.0.js"></script>
<script src="../../../dist/kinetic-dev.js"></script>
<script src="../../js/Test.js"></script>
<script>
var stage = new Kinetic.Stage({

View File

@ -2,7 +2,7 @@
<html>
<head>
<link rel="stylesheet" type="text/css"href="../base.css">
<script src="../../dist/kinetic-v0.0.0.js"></script>
<script src="../../dist/kinetic-dev.js"></script>
<!-- assets -->
<script src="../assets/worldMap.js"></script>

View File

@ -6,7 +6,7 @@
</style>
<link rel="stylesheet" type="text/css"href="../base.css">
<script src="../../dist/kinetic-v0.0.0.js"></script>
<script src="../../dist/kinetic-dev.js"></script>
<script src="../assets/dataUrls.js"></script>
<script src="../js/Test.js"></script>
<script src="../js/visualTests.js"></script>

View File

@ -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');
}
};