Skip to content

Commit

Permalink
Merge pull request #65 from brianjmiller/master
Browse files Browse the repository at this point in the history
Grunt for build
  • Loading branch information
bscSCORM committed Apr 23, 2014
2 parents 40b0734 + 3123e16 commit d37c239
Show file tree
Hide file tree
Showing 33 changed files with 615 additions and 724 deletions.
3 changes: 1 addition & 2 deletions .npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@ src
test
doc
vendor
build.js
build/.empty
build/tincan-min.map
.travis.yml
yuidoc.json
bower.json
3 changes: 3 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
language: node_js
node_js:
- "0.10"
before_install: npm install -g grunt-cli
install: npm install
before_script: grunt build
113 changes: 113 additions & 0 deletions Gruntfile.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,113 @@
/*global module:false*/
module.exports = function(grunt) {
"use strict";
var coreFileList = [
"vendor/cryptojs-v3.0.2/rollups/sha1.js",
"vendor/cryptojs-v3.0.2/components/enc-base64.js",
"src/TinCan.js",
"src/Utils.js",
"src/LRS.js",
"src/AgentAccount.js",
"src/Agent.js",
"src/Group.js",
"src/Verb.js",
"src/Result.js",
"src/Score.js",
"src/InteractionComponent.js",
"src/ActivityDefinition.js",
"src/Activity.js",
"src/ContextActivities.js",
"src/Context.js",
"src/StatementRef.js",
"src/SubStatement.js",
"src/Statement.js",
"src/StatementsResult.js",
"src/State.js",
"src/ActivityProfile.js",
"src/AgentProfile.js"
],
browserFileList = coreFileList.slice(),
nodeFileList = coreFileList.slice();

browserFileList.push(
"src/Environment/Browser.js"
);
nodeFileList.push(
"src/Environment/Node.js"
);

// Project configuration.
grunt.initConfig({
pkg: grunt.file.readJSON("package.json"),

watch: {
files: ["src/**/*.js"],
tasks: ["build"],
options: {
interrupt: true
}
},

jshint: {
all: ["Gruntfile.js", "src/**/*.js"],
options: {
bitwise: true,
es3: true, // must use ES3 syntax (support for IE6/7/8/9)
curly: true, // Always use curlys {}
eqeqeq: true, // No more == for you, === only
forin: true,
freeze: true,
immed: true, // prohibits the use of immediate function invocations without wrapping them in parentheses
indent: 4, // force tab width of 4 spaces
latedef: true, // no setting variables before they are defined
newcap: true, // Always call constructors with a Cap
noarg: true, // prohibits arguments.caller and arguments.callee
noempty: true, // prevent empty blocks
nonbsp: true,
nonew: true, // don't allow non-captured constructor use
plusplus: true, // prevent use of ++ and --
quotmark: "double", // require strings to be double quoted
undef: true, // prohibits the use of explicitly undeclared variables
unused: true, // Warns on unused variables
trailing: true, // Prohibits trailing whitespace
maxdepth: 6, // Max nesting of methods 6 layers deep
onevar: true,
strict: true,
globals: {
TinCan: true
}
}
},

concat: {
dist: {
files: {
"build/tincan.js": browserFileList,
"build/tincan-node.js": nodeFileList
},
nonull: true
}
},

uglify: {
dist: {
files: {
"build/tincan-min.js": ["build/tincan.js"]
},
options: {
sourceMap: true
}
}
}
});

// Load Tasks
grunt.loadNpmTasks("grunt-contrib-watch");
grunt.loadNpmTasks("grunt-contrib-concat");
grunt.loadNpmTasks("grunt-contrib-jshint");
grunt.loadNpmTasks("grunt-contrib-uglify");

// Define tasks
grunt.registerTask("build", ["jshint", "concat", "uglify"]);
grunt.registerTask("default", "build");
};
8 changes: 7 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,13 @@
A JavaScript library for talking Tin Can to the world.
A JavaScript library for implementing Tin Can API.

[![Build Status](https://travis-ci.org/RusticiSoftware/TinCanJS.png)](https://travis-ci.org/RusticiSoftware/TinCanJS)

For hosted API documentation, basic usage instructions, supported version listing, etc. visit the main project website at:

http://rusticisoftware.github.io/TinCanJS/

For more information about the Tin Can API visit:

http://tincanapi.com/

Browser Usage
Expand Down
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "tincan",
"version": "0.22.2",
"version": "0.30.0",
"homepage": "http://rusticisoftware.github.com/TinCanJS/",
"authors": [
"Brian J. Miller <[email protected]>"
Expand Down
182 changes: 0 additions & 182 deletions build.js

This file was deleted.

Empty file removed build/.empty
Empty file.
20 changes: 3 additions & 17 deletions build/tincan-min.js

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions build/tincan-min.map

Large diffs are not rendered by default.

Loading

0 comments on commit d37c239

Please sign in to comment.