Skip to content
This repository has been archived by the owner on Feb 13, 2018. It is now read-only.

Commit

Permalink
grunt : build task 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
bnu committed Dec 11, 2014
1 parent bf29502 commit 3cd8b29
Show file tree
Hide file tree
Showing 3 changed files with 48 additions and 10 deletions.
5 changes: 5 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
.gitattributes export-ignore
.gitignore export-ignore
Gruntfile.js export-ignore
package.json export-ignore
.travis.yml export-ignore
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
/build/
/node_modules/
.DS_Srore
Thumbs.db
49 changes: 39 additions & 10 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,15 @@ module.exports = function(grunt) {
},

src: [
"**/*.php",
"!node_modules/**"
"**/*.php",
"!node_modules/**"
],
},
},
jshint: {
files: [
'Gruntfile.js',
'tpl/js/*.js',
'Gruntfile.js',
'tpl/js/*.js',
],
options : {
globalstrict: false,
Expand All @@ -32,10 +32,10 @@ module.exports = function(grunt) {
"window" : true
},
ignores : [
'**/jquery*.js',
'**/*.min.js',
'**/*-packed.js',
'**/*.compressed.js'
'**/jquery*.js',
'**/*.min.js',
'**/*-packed.js',
'**/*.compressed.js'
]
}
},
Expand All @@ -54,8 +54,8 @@ module.exports = function(grunt) {
'underscore-property-hack' : false,
},
src: [
'tpl/css/*.css',
'!**/*.min.css',
'tpl/css/*.css',
'!**/*.min.css',
]
}
},
Expand All @@ -79,6 +79,35 @@ module.exports = function(grunt) {
},
});

grunt.registerTask('build', '', function(branch) {
if(!branch) grunt.fail.warn('Undefined build target.');

var done = this.async();
var build_dir = 'build';

if(grunt.file.isDir(build_dir)) {
grunt.file.delete(build_dir);
}
grunt.file.mkdir(build_dir);

grunt.util.spawn({
cmd: "git",
args: ['archive', '--output=build/archived.full.tar.gz', branch, '.']
}, function (error, result, code) {
grunt.log.ok('Archived (full) : build/archived.full.tar.gz');

grunt.util.spawn({
cmd: "git",
args: ['archive', '--output=build/archived.full.zip', branch, '.']
}, function (error, result, code) {
grunt.log.ok('Archived (full) : build/archived.full.zip');
grunt.log.ok('Done!');
done();
});
});
});


grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks('grunt-contrib-csslint');
grunt.loadNpmTasks('grunt-phplint');
Expand Down

1 comment on commit 3cd8b29

@bjrambo
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

=_=b

Please sign in to comment.