-
Notifications
You must be signed in to change notification settings - Fork 187
/
Gruntfile.js
115 lines (109 loc) · 2.89 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
112
113
114
115
module.exports = function(grunt) {
grunt.loadNpmTasks('grunt-git');
grunt.loadNpmTasks('grunt-shell');
grunt.initConfig( {
clean: {
bower: ['www/bower_components', '.bowerrc'],
git: [ 'node_modules/mastercoin-tools' ],
},
gitclone: {
mastercointools: {
options: {
repository: 'https://github.com/mastercoin-MSC/mastercoin-tools.git',
branch: 'master',
directory: 'node_modules/mastercoin-tools'
},
},
"bitcoinjs-lib": {
options: {
repository: "https://github.com/Omniwallet/bitcoinjs-lib.git",
branch: 'master',
directory: 'www/bower_components/bitcoinjs-lib'
}
},
"crypto-js": {
options: {
repository: "https://github.com/scintill/crypto-js.git",
branch: 'master',
directory: 'www/bower_components/bitcoinjs-lib/src/crypto-js'
}
}
},
shell: {
html: {
command: "./gen_www.sh"
},
bower_install_directory: {
options: {
stdout: true,
stderr: true
},
command: 'echo \'{ "directory": "www/bower_components" }\' > .bowerrc'
},
bower: {
options: {
stdout: true,
stderr: true
},
command: 'bower install'
},
forge: {
options: {
stdout: true,
stderr: true,
execOptions: {
cwd: "www/bower_components/forge"
}
},
command: 'npm install ; npm run minify'
},
"omni-websocket": {
options: {
execOptions: {
cwd: "api/websocket"
}
},
command: 'npm install'
},
cryptolib: {
options: {
stdout: true,
stderr: true,
execOptions: {
cwd: "www/bower_components/bitcoinjs-lib/src/crypto-js"
}
},
command: "git checkout 17823c05f8b7338c077a2c00856a9c62263a6d16"
},
"bitcoinjs-lib": {
options: {
stdout: true,
stderr: true,
execOptions: {
cwd: "www/bower_components/bitcoinjs-lib",
}
},
command: ". ./build.sh"
}
}
} );
grunt.loadNpmTasks( 'grunt-contrib-clean' );
grunt.registerTask( 'default', function( file ) {
if( !grunt.file.exists( 'node_modules/mastercoin-tools' ))
grunt.task.run( 'gitclone:mastercointools' );
grunt.task.run( 'shell:bower' );
if( !grunt.file.exists( 'www/bower_components/bitcoinjs-lib' ))
grunt.task.run( 'gitclone:bitcoinjs-lib' );
if( !grunt.file.exists( 'www/bower_components/bitcoinjs-lib/src/crypto-js/src/SHA1.js' )) {
grunt.task.run( 'gitclone:crypto-js' );
grunt.task.run( 'shell:cryptolib' );
}
if( !grunt.file.exists( 'www/bower_components/bitcoinjs-lib/build/bitcoinjs-lib.js' ) ||
!grunt.file.exists( 'www/bower_components/bitcoinjs-lib/build/bitcoinjs-lib.min.js' ))
grunt.task.run( 'shell:bitcoinjs-lib' );
if( !grunt.file.exists( 'www/bower_components/forge/js/forge.min.js' ))
grunt.task.run( 'shell:forge' );
if( !grunt.file.exists( 'api/websocket/node_modules' ))
grunt.task.run( 'shell:omni-websocket' );
} );
};