Skip to content

Commit 3ab90bc

Browse files
committed
Merge branch 'testing' into release
Release 0.7.1 Conflicts: dist/crafty-min.js dist/crafty.js
2 parents 5c34e40 + 6e69aee commit 3ab90bc

File tree

11 files changed

+14420
-11430
lines changed

11 files changed

+14420
-11430
lines changed

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
/crafty.js
2-
/crafty-min.js
32
build/api/*
43
build/api.json
54
build/parseNodes.js

Gruntfile.js

Lines changed: 36 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,13 @@
11
require("coffee-script");
2-
var fs = require('fs');
32
var open = require("open");
43

54
module.exports = function (grunt) {
6-
var pkg = grunt.file.readJSON('package.json');
7-
var version = pkg.version;
8-
var banner = '/**\n' +
9-
' * <%= pkg.name %> <%= pkg.version %>\n' +
10-
' * <%= pkg.author.url %>\n *\n' +
11-
' * Copyright <%= grunt.template.today("yyyy") %>, <%= pkg.author.name %>\n' +
12-
' * Dual licensed under the MIT or GPL licenses.\n' +
13-
' */\n\n';
5+
var banner = '/**\n' +
6+
' * <%= pkg.name %> <%= pkg.version %>\n' +
7+
' * <%= pkg.author.url %>\n *\n' +
8+
' * Copyright <%= grunt.template.today("yyyy") %>, <%= pkg.author.name %>\n' +
9+
' * Dual licensed under the MIT or GPL licenses.\n' +
10+
' */\n\n';
1411

1512
var docGen = function() {
1613
var outputFile = "./build/api.json";
@@ -43,6 +40,15 @@ module.exports = function (grunt) {
4340

4441
usebanner: {
4542
dist: {
43+
options: {
44+
position: 'top',
45+
banner: banner
46+
},
47+
files: {
48+
src: ['dist/crafty.js']
49+
}
50+
},
51+
debug: {
4652
options: {
4753
position: 'top',
4854
banner: banner
@@ -56,7 +62,7 @@ module.exports = function (grunt) {
5662
browserify: {
5763
dist: {
5864
files: {
59-
'crafty.js': ['src/crafty.js']
65+
'dist/crafty.js': ['src/crafty.js']
6066
},
6167
options: {
6268
transform: ['brfs']
@@ -75,7 +81,7 @@ module.exports = function (grunt) {
7581

7682

7783
watch: {
78-
files: ['src/*.js'],
84+
files: ['src/*.js', 'src/**/*.js'],
7985
tasks: ['build:dev']
8086
},
8187

@@ -84,8 +90,8 @@ module.exports = function (grunt) {
8490
banner: banner
8591
},
8692
build: {
87-
src: 'crafty.js',
88-
dest: 'crafty-min.js'
93+
src: 'dist/crafty.js',
94+
dest: 'dist/crafty-min.js'
8995
}
9096
},
9197

@@ -176,15 +182,28 @@ module.exports = function (grunt) {
176182

177183

178184

179-
grunt.registerTask('version', 'Takes the version into src/version.js', function() {
180-
fs.writeFileSync('src/version.js', 'module.exports = "' + version + '";');
185+
grunt.registerTask('version', 'Propagates version changes', function() {
186+
var pkg = grunt.config.get('pkg');
187+
var version = grunt.option('crafty_version');
188+
if (!version) {
189+
grunt.warn("No command-line argument 'crafty_version' specified. Rerun the task with '--crafty_version=X.X.X'.");
190+
version = pkg.version;
191+
}
192+
if (version === pkg.version) {
193+
grunt.warn("Command-line argument 'crafty_version' is same as previous release version.");
194+
}
195+
pkg.version = version;
196+
grunt.config.set('pkg', pkg);
197+
198+
grunt.file.write('package.json', JSON.stringify(pkg, null, 2));
199+
grunt.file.write('src/core/version.js', 'module.exports = "' + version + '";');
181200
});
182201

183202
// Build development
184-
grunt.registerTask('build:dev', ['browserify:debug', 'usebanner']);
203+
grunt.registerTask('build:dev', ['browserify:debug', 'usebanner:debug']);
185204

186205
// Build release
187-
grunt.registerTask('build:release', ['browserify:dist', 'usebanner']);
206+
grunt.registerTask('build:release', ['browserify:dist', 'usebanner:dist']);
188207

189208
// Building the documentation
190209
grunt.registerTask('api', "Generate api documentation", docGen);

bower.json

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,20 @@
11
{
22
"name": "crafty",
3+
"description": "Crafty is a modern component and event based framework for developing games in JavaScript that targets DOM, Canvas and WebGL.",
4+
"keywords": [
5+
"framework",
6+
"javascript",
7+
"game",
8+
"engine"
9+
],
10+
"license": ["GPL", "MIT"],
311
"main": "dist/crafty.js",
4-
"license": "MIT",
512
"ignore": [
6-
"**/.*",
7-
"build",
8-
"playgrounds",
9-
"test",
10-
"*.md",
11-
"changelog.txt",
12-
"Gruntfile.js",
13-
"package.json"
13+
"**",
14+
"!bower.json",
15+
"!README.md",
16+
"!dist",
17+
"!dist/crafty.js",
18+
"!dist/crafty-min.js"
1419
]
1520
}

dist/crafty-min.js

Lines changed: 7 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)