Skip to content
This repository has been archived by the owner on Jul 24, 2019. It is now read-only.

Commit

Permalink
added grunt
Browse files Browse the repository at this point in the history
  • Loading branch information
claudiosanches committed Sep 7, 2013
1 parent 46e3376 commit d9cc19e
Show file tree
Hide file tree
Showing 3 changed files with 107 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .gitignore
@@ -0,0 +1,2 @@
.DS_Store
node_modules/
93 changes: 93 additions & 0 deletions Gruntfile.js
@@ -0,0 +1,93 @@
module.exports = function(grunt) {
"use strict";

grunt.initConfig({

// gets the package vars
pkg: grunt.file.readJSON("package.json"),
svn_settings: {
path: "../../../../wp_plugins/<%= pkg.name %>",
tag: "<%= svn_settings.path %>/tags/<%= pkg.version %>",
trunk: "<%= svn_settings.path %>/trunk",
exclude: [
".editorconfig",
".git/",
".gitignore",
"node_modules/",
"Gruntfile.js",
"README.md",
"package.json",
"*.zip"
]
},

// image optimization
imagemin: {
dist: {
options: {
optimizationLevel: 7,
progressive: true
},
files: [{
expand: true,
cwd: "./",
src: ["screenshot-*.png"],
dest: "./"
}]
}
},

// rsync commands used to take the files to svn repository
rsync: {
tag: {
src: "./",
dest: "<%= svn_settings.tag %>",
recursive: true,
exclude: "<%= svn_settings.exclude %>"
},
trunk: {
src: "./",
dest: "<%= svn_settings.trunk %>",
recursive: true,
exclude: "<%= svn_settings.exclude %>"
}
},

// shell command to commit the new version of the plugin
shell: {
svn_add: {
command: 'svn add --force * --auto-props --parents --depth infinity -q',
options: {
stdout: true,
stderr: true,
execOptions: {
cwd: "<%= svn_settings.path %>"
}
}
},
svn_commit: {
command: "svn commit -m 'updated the plugin version to <%= pkg.version %>'",
options: {
stdout: true,
stderr: true,
execOptions: {
cwd: "<%= svn_settings.path %>"
}
}
}
}
});

// load tasks
grunt.loadNpmTasks('grunt-contrib-imagemin');
grunt.loadNpmTasks("grunt-rsync");
grunt.loadNpmTasks("grunt-shell");

// default task
grunt.registerTask("default", [
"rsync:tag",
"rsync:trunk",
"shell:svn_add",
"shell:svn_commit"
]);
};
12 changes: 12 additions & 0 deletions package.json
@@ -0,0 +1,12 @@
{
"name": "woocommerce-boleto",
"description": "WooCommerce Boleto is a brazilian payment gateway for WooCommerce",
"version": "1.0.0",
"main": "Gruntfile.js",
"dependencies": {
"grunt": "~0.4.1",
"grunt-contrib-imagemin": "~0.2.1",
"grunt-rsync": "~0.2.0",
"grunt-shell": "~0.3.1"
}
}

0 comments on commit d9cc19e

Please sign in to comment.