forked from GrimoireGL/GrimoireJS
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgulpfile.coffee
97 lines (90 loc) · 2.7 KB
/
gulpfile.coffee
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
args = require('yargs').argv
ts = require 'gulp-typescript'
TaskManager = require './build/task-manager'
CleanTask = require './build/task/clean'
SampleTask = require './build/task/sample'
TsLintTask = require './build/task/tslint'
DocTask = require './build/task/doc'
TsConfig = require './build/task/tsconfig'
ServerTask = require './build/task/server'
BuildTask = require './build/task/build'
ReloadTask = require './build/task/reload'
WatchTask = require './build/task/watch'
TestTask = require './build/task/test'
BundleTask = require './build/task/bundle'
CoverTask = require './build/task/cover'
env_production = false
###
TASK SUMMARY
* clean clean directories
* build build product
* server start simple server
* watch watch file tree and build, and start simple server with liveReload
* doc construct document with typedoc
* test run test
* tscfg update tscofig.json by filesGlob in itself
###
config =
entries:
main:
entries: './lib/jThree.js'
name: 'j3.js'
extensions: ['.js', '.json', '.glsl', '.html','.xmml']
dest: ['./wwwroot', './bin/product']
target: 'web'
minify: false
sourcemap: !args.nosourcemap
transform: [
'shaderify'
'txtify'
{name: 'babelify', opt: {presets: 'es2015',plugins:["transform-es2015-modules-commonjs","add-module-exports"]}}
{name: 'envify', opt: {NODE_ENV: (if env_production then 'production' else 'development')}}
]
detectGlobals: true
debug:
entries: './debug/debug.coffee'
name: 'j3-debug.js'
extensions: ['.json', '.coffee']
dest:['./wwwroot/debug']
target: 'web'
minify: false
sourcemap: !args.nosourcemap
transform: [
'coffee-reactify'
{name: 'envify', opt: {NODE_ENV: (if env_production then 'production' else 'development')}}
]
detectGlobals: true
cleaner_files : ['./src/**/*.js']
cleaner_files_silent : ['./lib/**/*']
tsEntries:['./src/**/*.ts']
tsDest:'./lib'
jsEntries:['./lib/**/*.js']
tsBase:'./src'
refsEntries:['./src/refs/**/*.ts']
branch : args.branch || 'unknown'
typedocSrc : ['./src/**/*.ts']
typedocDest : 'ci/docs'
tsconfigPath : './tsconfig.json'
gulpDir:__dirname
serverRoot : './wwwroot'
watchForReload:['./wwwroot/**/*.js', './wwwroot/**/*.html', './wwwroot/**/*.goml']
watching:false
buildSuccess:true
testTarget:['./test/**/*.js']
bundleSuccess:true
config.tsProject = ts.createProject config.tsconfigPath, {noExternalResolve: true}
### TASK REGISTRATION###
TaskManager.register config,[
CleanTask,
SampleTask,
TsLintTask,
DocTask,
TsConfig,
ServerTask,
BuildTask,
ReloadTask,
WatchTask,
TestTask,
BundleTask,
CoverTask
]