Skip to content

Commit f85f496

Browse files
committed
Run composer no dev and clean up directories in grunt build script
1 parent 70c290d commit f85f496

File tree

3 files changed

+30
-3
lines changed

3 files changed

+30
-3
lines changed

Gruntfile.js

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,11 @@ module.exports = function( grunt ) {
2222
dest: 'assets/js/wp-user-manager.js'
2323
}
2424
},
25+
shell: {
26+
composerDependencies: {
27+
command: 'composer install --no-dev'
28+
}
29+
},
2530
jshint: {
2631
all: [
2732
'Gruntfile.js',
@@ -73,7 +78,14 @@ module.exports = function( grunt ) {
7378
test: {
7479
files: ['assets/js/test/**/*.js']
7580
},
76-
81+
composer : {
82+
options : {
83+
usePhp: true,
84+
flags: ['arg'],
85+
cwd: 'release/<%= pkg.version %>/',
86+
composerLocation: '/usr/local/bin/composer'
87+
},
88+
},
7789
sass: {
7890
all: {
7991
files: {
@@ -162,7 +174,8 @@ module.exports = function( grunt ) {
162174
}
163175
},
164176
clean: {
165-
main: ['release']
177+
main: ['release'],
178+
build: ['release/<%= pkg.version %>/build', 'release/<%= pkg.version %>/vendor/nikic/fast-route/test', 'release/<%= pkg.version %>/vendor/typisttech/imposter', 'release/<%= pkg.version %>/vendor/typisttech/imposter-plugin']
166179
},
167180
gittag: {
168181
addtag: {
@@ -199,6 +212,7 @@ module.exports = function( grunt ) {
199212
main: {
200213
src: [
201214
'**',
215+
'!vendor/**',
202216
'!node_modules/**',
203217
'!tests/**',
204218
'!release/**',
@@ -297,7 +311,7 @@ module.exports = function( grunt ) {
297311
grunt.registerTask( 'do_git', [ 'gitcommit', 'gittag', 'gitpush' ] );
298312
grunt.registerTask( 'release', [ 'pre_vcs', 'do_svn', 'do_git' ] );
299313

300-
grunt.registerTask( 'build', ['clean', 'copy', 'compress'] );
314+
grunt.registerTask( 'build', ['clean:main', 'copy', 'composer:install:no-dev', 'clean:build', 'compress'] );
301315

302316
grunt.util.linefeed = '\n';
303317
};

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@
5959
"git-changelog": "^0.1.8",
6060
"grunt": "~0.4.5",
6161
"grunt-bump": "latest",
62+
"grunt-composer": "^0.4.5",
6263
"grunt-contrib-clean": "~0.6.0",
6364
"grunt-contrib-compress": "~0.12.0",
6465
"grunt-contrib-concat": "~0.5.0",

yarn.lock

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3952,6 +3952,13 @@ grunt-cli@~1.3.2:
39523952
nopt "~4.0.1"
39533953
v8flags "~3.1.1"
39543954

3955+
grunt-composer@^0.4.5:
3956+
version "0.4.5"
3957+
resolved "https://registry.yarnpkg.com/grunt-composer/-/grunt-composer-0.4.5.tgz#92c5741707d1a52b530c12f9518f009875a1d0b7"
3958+
integrity sha512-TqTxpedQiDlP9rrOSJpEFLT0Hr6njsm3306+jHK8C8EdoHXTkzFl2LiJE09dz/uyH34O7MXVG4K6WBYOYrxw3g==
3959+
dependencies:
3960+
shelljs "~0.2.6"
3961+
39553962
grunt-contrib-clean@~0.6.0:
39563963
version "0.6.0"
39573964
resolved "https://registry.yarnpkg.com/grunt-contrib-clean/-/grunt-contrib-clean-0.6.0.tgz#f532dba4b8212674c7c013e146bda6638b9048f6"
@@ -8361,6 +8368,11 @@ shelljs@^0.7.6:
83618368
interpret "^1.0.0"
83628369
rechoir "^0.6.2"
83638370

8371+
shelljs@~0.2.6:
8372+
version "0.2.6"
8373+
resolved "https://registry.yarnpkg.com/shelljs/-/shelljs-0.2.6.tgz#90492d72ffcc8159976baba62fb0f6884f0c3378"
8374+
integrity sha512-LQiM15qPbSyzHDFfI4v7EVhjBXG5PUAKWVBnVMBXwdlQSHZtzKYeKGzDHBIqpenPrCsPWqBSOF5o7oSvSfX+CA==
8375+
83648376
shellwords@^0.1.1:
83658377
version "0.1.1"
83668378
resolved "https://registry.yarnpkg.com/shellwords/-/shellwords-0.1.1.tgz#d6b9181c1a48d397324c84871efbcfc73fc0654b"

0 commit comments

Comments
 (0)