forked from OmniLayer/omniwallet
-
Notifications
You must be signed in to change notification settings - Fork 6
/
Gruntfile.js
96 lines (90 loc) · 2.36 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
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/curtislacy/mastercoin-tools.git',
branch: 'master',
directory: 'node_modules/mastercoin-tools'
},
},
"bitcoinjs-lib": {
options: {
repository: "https://github.com/BitGo/bitcoinjs-lib.git",
branch: 'master',
directory: 'www/bower_components/bitcoinjs-lib'
}
}
},
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'
},
submodules: {
options: {
stdout: true,
stderr: true,
execOptions: {
cwd: "www/bower_components/bitcoinjs-lib"
}
},
command: "git submodule update --init"
},
"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' ))
grunt.task.run( 'shell:submodules' );
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' );
} );
};