Skip to content

Commit b150daf

Browse files
committed
Automatic date and version number in header
1 parent 5718a0a commit b150daf

3 files changed

Lines changed: 49 additions & 9 deletions

File tree

gulpfile.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,15 @@
1+
var fs = require('fs');
12
var gulp = require('gulp');
23
var concat = require('gulp-concat');
34
var rename = require("gulp-rename");
45
var uglify = require('gulp-uglify');
56
var gutil = require('gulp-util');
7+
var header = require('gulp-header');
8+
9+
var pkg = require('./package.json');
610

711
gulp.task('build', function() {
812
return gulp.src([
9-
'src/wrapper/prefix.js',
1013
'src/parser.js',
1114
'src/utils.js',
1215
'src/texture.js',
@@ -20,6 +23,7 @@ gulp.task('build', function() {
2023
'src/wrapper/suffix.js'
2124
])
2225
.pipe(concat('gpu.js'))
26+
.pipe(header(fs.readFileSync('src/wrapper/prefix.js', 'utf8'), { pkg : pkg } ))
2327
.pipe(gulp.dest('bin'));
2428
});
2529

package.json

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
{
2+
"name": "gpu.js",
3+
"version": "0.0.0",
4+
"description": "GPU Accelerated JavaScript",
5+
"main": "",
6+
"directories": {
7+
"doc": "doc",
8+
"test": "test"
9+
},
10+
"dependencies": {},
11+
"devDependencies": {
12+
"babel-plugin-syntax-async-functions": "^6.5.0",
13+
"gulp": "^3.9.1",
14+
"gulp-concat": "^2.6.0",
15+
"gulp-header": "^1.7.1",
16+
"gulp-uglify": "^1.5.2",
17+
"gulp-util": "^3.0.7"
18+
},
19+
"scripts": {
20+
"test": "echo \"Error: no test specified\" && exit 1"
21+
},
22+
"repository": {
23+
"type": "git",
24+
"url": "git+https://github.com/gpujs/gpu.js.git"
25+
},
26+
"keywords": [
27+
"gpgpu",
28+
"webgl"
29+
],
30+
"author": "The gpu.js Team",
31+
"license": "MIT",
32+
"bugs": {
33+
"url": "https://github.com/gpujs/gpu.js/issues"
34+
},
35+
"homepage": "https://github.com/gpujs/gpu.js#readme"
36+
}

src/wrapper/prefix.js

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
///
2-
/// gpu.js
3-
/// http://gpu.rocks
2+
/// <%= pkg.name %>
3+
/// <%= pkg.homepage %>
44
///
5-
/// GPU Accelerated JavaScript
5+
/// <%= pkg.description %>
66
///
7-
/// @version 0.0.0
8-
/// @date 2016-02-23
7+
/// @version <%= pkg.version %>
8+
/// @date <%= new Date() %>
99
///
10-
/// @license
10+
/// @license <%= pkg.license %>
1111
/// The MIT License
1212
///
13-
/// Copyright (c) 2016 Fazli Sapuan, Matthew Saw, Eugene Cheah and Julia Low
13+
/// Copyright (c) <%= new Date().getFullYear() %> Fazli Sapuan, Matthew Saw, Eugene Cheah and Julia Low
1414
///
1515
/// Permission is hereby granted, free of charge, to any person obtaining a copy
1616
/// of this software and associated documentation files (the "Software"), to deal
@@ -29,7 +29,7 @@
2929
/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
3030
/// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
3131
/// THE SOFTWARE.
32-
///
32+
///
3333

3434
/// Making sure the parser, and all the various messy class files
3535
/// have proper closure, and does not leak out

0 commit comments

Comments
 (0)