Skip to content

Commit 3017b87

Browse files
committed
Adds gulp for build support. Prep for bower.
1 parent 3e86e27 commit 3017b87

File tree

4 files changed

+153
-0
lines changed

4 files changed

+153
-0
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
node_modules
2+
bower_components

bower.json

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
{
2+
"name": "glowscript",
3+
"version": "v1.1.0",
4+
"homepage": "http://www.glowscript.org/",
5+
"authors": [
6+
"Bruce Sherwood <[email protected]>"
7+
],
8+
"description": "GlowScript is an easy-to-use, powerful environment for creating 3D animations and publishing them on the web.",
9+
"main": [
10+
"package/glow.1.1.min.js",
11+
"package/compiler.1.1.min.js",
12+
"package/RSrun.1.1.min.js",
13+
"package/RScompiler.1.1.min.js"
14+
],
15+
"repository": {
16+
"type": "git",
17+
"url": "https://github.com/BruceSherwood/glowscript.git"
18+
},
19+
"keywords": [
20+
"vpython",
21+
"webgl",
22+
"javascript"
23+
],
24+
"ignore": [
25+
"**/.*",
26+
"node_modules",
27+
"bower_components",
28+
"test",
29+
"tests"
30+
]
31+
}

gulpfile.js

Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
var gulp = require('gulp')
2+
, uglify = require('gulp-uglify')
3+
, concat = require('gulp-concat-util')
4+
, wrap = require('gulp-wrap')
5+
, tap = require('gulp-tap')
6+
, header = require('gulp-header')
7+
, path = require('path')
8+
, version
9+
, glowscript_libraries;
10+
11+
version = '1.1';
12+
13+
glowscript_libraries = {
14+
"glow": [
15+
"lib/jquery/jquery.mousewheel.js",
16+
"lib/flot/jquery.flot.min.js",
17+
"lib/flot/jquery.flot.crosshair_GS.js",
18+
"lib/glMatrix.js",
19+
"lib/webgl-utils.js",
20+
"lib/glow/property.js",
21+
"lib/glow/vectors.js",
22+
"lib/glow/mesh.js",
23+
"lib/glow/canvas.js",
24+
"lib/glow/orbital_camera.js",
25+
"lib/glow/autoscale.js",
26+
"lib/glow/WebGLRenderer.js",
27+
"lib/glow/graph.js",
28+
"lib/glow/color.js",
29+
"lib/glow/primitives.js",
30+
"lib/glow/api_misc.js",
31+
"lib/glow/shaders.gen.js"
32+
],
33+
"compiler": [
34+
"lib/narcissus/lib/jsdefs.js",
35+
"lib/narcissus/lib/jslex.js",
36+
"lib/narcissus/lib/jsparse.js",
37+
"lib/narcissus/lib/jsdecomp.js",
38+
"lib/streamline/compiler/format.js",
39+
"lib/streamline/compiler/transform.js",
40+
"lib/compiler.js",
41+
"lib/coffee-script.js"
42+
],
43+
"RSrun": [
44+
"lib/rapydscript/stdlib.js"
45+
],
46+
"RScompiler": [
47+
"lib/narcissus/lib/jsdefs.js",
48+
"lib/narcissus/lib/jslex.js",
49+
"lib/narcissus/lib/jsparse.js",
50+
"lib/narcissus/lib/jsdecomp.js",
51+
"lib/streamline/compiler/format.js",
52+
"lib/streamline/compiler/transform.js",
53+
"lib/compiler.js",
54+
"lib/rapydscript/utils.js",
55+
"lib/rapydscript/ast.js",
56+
"lib/rapydscript/output.js",
57+
"lib/rapydscript/parse.js",
58+
"lib/rapydscript/baselib.js",
59+
"lib/rapydscript/stdlib.js"
60+
],
61+
};
62+
63+
gulp.task('default', function() {
64+
var shaders = []
65+
, shader_key;
66+
67+
gulp.src('./shaders/*.shader')
68+
.pipe(tap(function(file) {
69+
shader_key = path.basename(file.path, '.shader');
70+
file.contents = new Buffer('"' + shader_key + '":' + JSON.stringify(file.contents.toString()));
71+
return file;
72+
}))
73+
.pipe(concat('shaders.gen.js', { sep : ',\n' }))
74+
.pipe(wrap('Export({ shaders: {\n<%= contents %>\n}});'))
75+
.pipe(gulp.dest('./lib/glow/'));
76+
77+
Object.keys(glowscript_libraries).forEach(function(lib) {
78+
gulp.src(glowscript_libraries[lib])
79+
.pipe(uglify())
80+
.pipe(concat(lib + '.' + version + '.min.js'))
81+
.pipe(header("/*This is a combined, compressed file. Look at https://github.com/BruceSherwood/glowscript for source code and copyright information.*/"))
82+
.pipe(gulp.dest('./package/'));
83+
});
84+
});

package.json

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
{
2+
"name": "glowscript",
3+
"version": "1.1.0",
4+
"description": "GlowScript is an easy-to-use, powerful environment for creating 3D animations and publishing them on the web.",
5+
"main": "package/glow.1.1.min.js",
6+
"directories": {
7+
"doc": "docs",
8+
"example": "examples"
9+
},
10+
"scripts": {
11+
"test": "echo \"Error: no test specified\" && exit 1"
12+
},
13+
"repository": {
14+
"type": "git",
15+
"url": "https://github.com/BruceSherwood/glowscript.git"
16+
},
17+
"keywords": [
18+
"vpython",
19+
"webgl",
20+
"javascript"
21+
],
22+
"author": "Bruce Sherwood <[email protected]>",
23+
"bugs": {
24+
"url": "https://github.com/BruceSherwood/glowscript/issues"
25+
},
26+
"homepage": "https://github.com/BruceSherwood/glowscript",
27+
"devDependencies": {
28+
"gulp": "^3.8.11",
29+
"gulp-concat": "^2.5.2",
30+
"gulp-concat-util": "^0.5.2",
31+
"gulp-header": "^1.2.2",
32+
"gulp-tap": "^0.1.3",
33+
"gulp-uglify": "^1.2.0",
34+
"gulp-wrap": "^0.11.0"
35+
}
36+
}

0 commit comments

Comments
 (0)