forked from cornerstonejs/openjpeg
-
Notifications
You must be signed in to change notification settings - Fork 0
/
gruntfile.js
111 lines (105 loc) · 3.23 KB
/
gruntfile.js
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
98
99
100
101
102
103
104
105
106
107
108
109
110
111
module.exports = function(grunt) {
// Project configuration.
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
clean: [
'dist',
'build',
'bin'
],
version: {
// options: {},
defaults: {
src: ['wrapping/js/openjp2/header.js']
}
},
run: {
options: {
// Task-specific options go here.
},
cmakegen: {
cmd: 'cmake',
args: [
'-DCMAKE_TOOLCHAIN_FILE=/Users/chafey/emsdk_portable/emscripten/1.35.0/cmake/Modules/Platform/Emscripten.cmake',
'-DCMAKE_BUILD_TYPE=Release',
'-DBUILD_CODEC=OFF',
'-DBUILD_JS=ON',
'-DBUILD_SHARED_LIBS=OFF',
'-GUnix Makefiles',
'.'
]
},
cmakedot: {
cmd: 'cmake',
args: [
'.'
]
},
make: {
cmd: 'make',
args: [
]
},
emccbuild: {
cmd: './emccbuild.sh'
}
},
concat: {
distOpenJPEGFixedMemoryBrowser: {
options: {
stripBanners: true,
banner: '/*! <%= pkg.name %> - v<%= pkg.version %> - ' +
'<%= grunt.template.today("yyyy-mm-dd") %> ' +
'| (c) 2016 Chris Hafey | https://github.com/chafey/openjpeg */\n'
},
src : ['build/openJPEG-FixedMemory-browser.js'],
dest: 'dist/openJPEG-FixedMemory-browser.js'
},
distOpenJPEGDynamicMemoryBrowser: {
options: {
stripBanners: true,
banner: '/*! <%= pkg.name %> - v<%= pkg.version %> - ' +
'<%= grunt.template.today("yyyy-mm-dd") %> ' +
'| (c) 2016 Chris Hafey | https://github.com/chafey/openjpeg */\n'
},
src : ['build/openJPEG-DynamicMemory-browser.js'],
dest: 'dist/openJPEG-DynamicMemory-browser.js'
},
distOpenJPEGFixedMemoryCommonJS: {
options: {
stripBanners: true,
banner: '/*! <%= pkg.name %> - v<%= pkg.version %> - ' +
'<%= grunt.template.today("yyyy-mm-dd") %> ' +
'| (c) 2016 Chris Hafey | https://github.com/chafey/openjpeg */\n'
},
src : ['build/openJPEG-FixedMemory-commonJS.js'],
dest: 'dist/openJPEG-FixedMemory-commonJS.js'
},
distOpenJPEGDynamicMemoryCommonJS: {
options: {
stripBanners: true,
banner: '/*! <%= pkg.name %> - v<%= pkg.version %> - ' +
'<%= grunt.template.today("yyyy-mm-dd") %> ' +
'| (c) 2016 Chris Hafey | https://github.com/chafey/openjpeg */\n'
},
src : ['build/openJPEG-DynamicMemory-commonJS.js'],
dest: 'dist/openJPEG-DynamicMemory-commonJS.js'
}
},
});
require('load-grunt-tasks')(grunt);
grunt.registerTask('buildAll', ['clean','run:cmakegen','run:cmakedot','run:make', 'version', 'run:emccbuild', 'concat']);
grunt.registerTask('default', ['buildAll']);
};
// Release process:
// 1) Update version number in package.json
// 2) do a build (needed to update dist versions with correct build number)
// grunt
// 3) commit changes
// git commit -am "Changes...."
// 4) tag the commit
// git tag -a 0.1.0 -m "Version 0.1.0"
// 5) push to github
// git push origin master --tags
// 6) Update npm
// npm publish