Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

added Gruntfile

  • Loading branch information...
commit a5b49187759c8d5c592575280e13d439ffff9f7a 1 parent 07fe9b1
@Gordin Gordin authored
Showing with 175 additions and 15 deletions.
  1. +121 −0 Gruntfile.js
  2. +54 −15 package.json
View
121 Gruntfile.js
@@ -0,0 +1,121 @@
+// Check for the name of the naturaldocs binary
+var fs = require('fs');
+if (fs.existsSync("/usr/bin/naturaldocs")) {
+ naturaldocs = "/usr/bin/naturaldocs";
+} else if (fs.existsSync("/usr/lib/bin/natural_docs")) {
+ naturaldocs = "/usr/lib/bin/natural_docs";
+} else {
+ naturaldocs = "NaturalDocs";
+}
+
+module.exports = function(grunt){
+
+ grunt.initConfig({
+ pkg: grunt.file.readJSON('package.json'),
+
+ clean: {
+ "prepare-doc": ["<%= natural_docs.docs.inputs[0] %>", "<%= natural_docs.docs.project %>"],
+ "doc": ["<%= natural_docs.docs.output %>"],
+ "prepare-release": ["strophejs-<%= pkg.version %>"],
+ "release": ["strophejs-<%= pkg.version %>.zip", "strophejs-<%= pkg.version %>.tar.gz"],
+ "js": ["<%= concat.dist.dest %>", "strophe.min.js"]
+ },
+
+ concat: {
+ dist: {
+ src: ['src/base64.js', "src/sha1.js", "src/md5.js", "src/core.js", "src/bosh.js", "src/websocket.js" ],
+ dest: '<%= pkg.name %>'
+ },
+ options: {
+ process: function(src){
+ return src.replace('@VERSION@', '<%= pkg.version %>');
+ }
+ }
+ },
+
+ copy: {
+ "prepare-release": {
+ files:[
+ {
+ expand: true,
+ src:['<%= concat.dist.dest %>', 'strophe.min.js', 'LICENSE.txt', 'README.txt',
+ 'contrib/**', 'examples/**', 'plugins/**', 'tests/**', 'doc/**'],
+ dest:"strophejs-<%= pkg.version %>"
+ }
+ ]
+ },
+ "prepare-doc": {
+ files:[
+ {
+ src:['<%= concat.dist.dest %>'],
+ dest:"<%= natural_docs.docs.inputs[0] %>"
+ }
+ ]
+ }
+ },
+
+ jshint: {
+ files: ['Gruntfile.js', 'src/*.js'],
+ },
+
+ shell: {
+ tar: {
+ command: 'tar czf strophejs-<%= pkg.version %>.tar.gz strophejs-<%= pkg.version %>',
+ options: { failOnError: true }
+ },
+ zip: {
+ command: 'zip -qr strophejs-<%= pkg.version %>.zip strophejs-<%= pkg.version %>',
+ options: { failOnError: true }
+ }
+ },
+
+ uglify: {
+ options: {
+ banner: '/*! <%= pkg.name %> v<%= pkg.version %> - built on <%= grunt.template.today("dd-mm-yyyy") %> */\n'
+ },
+ dist: {
+ files: { 'strophe.min.js': ['<%= concat.dist.dest %>'] }
+ }
+ },
+
+ watch: {
+ files: ['<%= jshint.files %>'],
+ tasks: ['concat', 'uglify']
+ },
+
+ natural_docs: {
+ docs: {
+ bin: naturaldocs,
+ inputs: [ "doc-tmp/" ],
+ project: "ndproj",
+ output: "doc"
+ },
+ },
+
+ mkdir: {
+ "prepare-doc": {
+ options: {
+ create: ["<%= natural_docs.docs.project %>", "<%= natural_docs.docs.output %>"]
+ }
+ },
+ },
+ });
+
+ grunt.loadNpmTasks('grunt-contrib-copy');
+ grunt.loadNpmTasks("grunt-contrib-uglify");
+ grunt.loadNpmTasks('grunt-contrib-jshint');
+ grunt.loadNpmTasks('grunt-contrib-watch');
+ grunt.loadNpmTasks("grunt-contrib-concat");
+ grunt.loadNpmTasks("grunt-contrib-clean");
+ grunt.loadNpmTasks('grunt-shell');
+ grunt.loadNpmTasks('grunt-natural-docs');
+ grunt.loadNpmTasks('grunt-mkdir');
+
+ grunt.registerTask("default", ["jshint", "min"]);
+ grunt.registerTask("min", ["concat", "uglify"]);
+ grunt.registerTask("prepare-release", ["copy:prepare-release"]);
+ grunt.registerTask("doc", ["concat", "copy:prepare-doc", "mkdir:prepare-doc", "natural_docs"]);
+ grunt.registerTask("release", ["default", "doc", "copy:prepare-release", "shell:tar", "shell:zip"]);
+ grunt.registerTask("all", ["release", "clean"]);
+
+};
View
69 package.json
@@ -1,17 +1,56 @@
{
- "name" : "Strophe.js",
- "description" : "Strophe.js is an XMPP library for JavaScript",
- "version" : "1.1.0",
- "homepage" : "http://strophe.im/strophejs",
- "repository" : { "type": "git", "url": "git://github.com/strophe/strophejs.git" },
- "keywords" : ["xmpp", "message", "browser"],
- "author" : "",
- "contributors" : [],
- "licenses" : ["MIT"],
- "dependencies" : [],
- "main" : "./strophe.js",
- "scripts" : { "install": "make", "update": "make" },
- "directories" : { "lib": "./src", "test": "./tests" },
- "engines" : { "browser": "*" }
+ "name": "strophe.js",
+ "description": "Strophe.js is an XMPP library for JavaScript",
+ "version": "1.1.3",
+ "homepage": "http://strophe.im/strophejs",
+ "repository": {
+ "type": "git",
+ "url": "git://github.com/strophe/strophejs.git"
+ },
+ "keywords": [
+ "xmpp",
+ "message",
+ "bosh",
+ "websocket",
+ "browser"
+ ],
+ "author": "Jack Moffit (metajack)",
+ "contributors": [
+ "Nathan Zorn (thepug)",
+ "Andreas Guth (Gordin)",
+ "Anton Stroganov (Aeon)",
+ "Florian Zeitz (Florob)",
+ "Christopher Zorn (twonds)",
+ "dodo",
+ "Lee Boynton (lboynton)",
+ "Theo Cushion (theozaurus)",
+ "Brendon Crawford (brendoncrawford)"
+ ],
+ "licenses": [
+ "MIT"
+ ],
+ "dependencies": [],
+ "main": "./strophe.js",
+ "scripts": {
+ "lint": "grunt",
+ "build": "grunt",
+ "clean": "grunt clean",
+ "doc": "grunt doc",
+ "release": "grunt release"
+ },
+ "engines": {
+ "browser": "*"
+ },
+ "devDependencies": {
+ "grunt": "~0.4",
+ "grunt-contrib-uglify": "~0.2.7",
+ "grunt-contrib-concat": "~0.3.0",
+ "grunt-contrib-clean": "~0.5.0",
+ "grunt-contrib-copy": "~0.5.0",
+ "grunt-shell": "~0.6.1",
+ "grunt-contrib-jshint": "~0.8.0",
+ "grunt-contrib-watch": "~0.5.3",
+ "grunt-mkdir": "~0.1.1",
+ "grunt-natural-docs": "~0.1.1"
+ }
}
-
Please sign in to comment.
Something went wrong with that request. Please try again.