Skip to content

Commit

Permalink
Merge remote-tracking branch 'jobara/VP-317'
Browse files Browse the repository at this point in the history
* jobara/VP-317:
  VP-317: Fixed mediaelement dependencies.
  VP-317: linting
  VP-317: Updated the README file
  VP-317: correcting version number
  VP-317: can take in packageName as an argument
  VP-317: Restructured reference to the source files
  VP-317: Switched to use the modulefiles task
  VP-317: Using individual dependency files
  VP-317: Basic module build system
  • Loading branch information
yzen committed Oct 1, 2013
2 parents c907f65 + fe0fc79 commit a0fe2d0
Show file tree
Hide file tree
Showing 8 changed files with 114 additions and 39 deletions.
62 changes: 29 additions & 33 deletions GruntFile.js
Original file line number Diff line number Diff line change
@@ -1,74 +1,70 @@
module.exports = function (grunt) {
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
packageName: grunt.option("packageName") || "videoPlayer-all",
srcConcatenatedPath: "build/<%= packageName %>.js",
minConcatenatedPath: "build/<%= packageName %>-min.js",
vpFiles: {
src: ["ReleaseNotes.txt", "README.txt", "css/**", "demos/**", "html/**", "images/**", "js/**", "lib/**", "tests/**"], dest: "./"},
clean: {
build: "build",
products: "products"
},
compress: {
src: {
options: {
archive: "products/videoPlayer-all-<%= pkg.version %>.zip"
archive: "products/<%= packageName %>-<%= pkg.version %>.zip"
},
files: [
// expand makes the src relative to cwd path, and flatten collapses the file down to the cwd directory
{src: ["build/videoPlayer-all.js"], dest: "./", expand: true, cwd: "./", flatten: true},
{src: ["./ReleaseNotes.txt"], dest: "./"},
{src: ["css/**", "demos/**", "html/**", "images/**", "js/**", "lib/**", "tests/**"], dest: "./"}
{src: ["<%= srcConcatenatedPath %>"], dest: "./", expand: true, cwd: "./", flatten: true},
"<%= vpFiles %>"
]
},
min: {
options: {
archive: "products/videoPlayer-all-min-<%= pkg.version %>.zip"
archive: "products/<%= packageName %>-min-<%= pkg.version %>.zip"
},
files: [
// expand makes the src relative to cwd path, and flatten collapses the file down to the cwd directory
{src: ["build/videoPlayer-all-min.js"], dest: "./", expand: true, cwd: "./", flatten: true},
{src: ["./ReleaseNotes.txt"], dest: "./"},
{src: ["css/**", "demos/**", "html/**", "images/**", "js/**", "lib/**", "tests/**"], dest: "./"}
{src: ["<%= minConcatenatedPath %>"], dest: "./", expand: true, cwd: "./", flatten: true},
"<%= vpFiles %>"
]
}
},
concat: {
all: {
src: [
"lib/infusion/MyInfusion.js",
"lib/jqeury-ui/js/jquery.ui.button.js",
"lib/captionator/js/captionator.js",
"lib/mediaelement/js/mediaelement.js",
"js/VideoPlayer_framework.js",
"js/VideoPlayer_showHide.js",
"js/VideoPlayer.js",
"js/VideoPlayer_html5Captionator.js",
"js/VideoPlayer_controllers.js",
"js/ToggleButton.js",
"js/MenuButton.js",
"js/VideoPlayer_media.js",
"js/VideoPlayer_transcript.js",
"js/VideoPlayer_intervalEventsConductor.js",
"js/VideoPlayer_uiOptions.js"
],
dest: "build/videoPlayer-all.js"
main: {
src: "<%= modulefiles.main.output %>",
dest: "<%= srcConcatenatedPath %>"
}
},
uglify: {
options: {
mangle: false
},
my_target: {
files: {
"build/videoPlayer-all-min.js": ["build/videoPlayer-all.js"]
}
src: ["<%= srcConcatenatedPath %>"],
dest: "<%= minConcatenatedPath %>"
}
},
modulefiles: {
main: {
options: {
exclude: grunt.option("exclude") || [],
include: grunt.option("include")
},
src: ["**/*Dependencies.json"]
}
}
});

console.log("src path: " + grunt.config.get("srcConcatenatedPath"));

grunt.loadNpmTasks("grunt-contrib-clean");
grunt.loadNpmTasks("grunt-contrib-concat");
grunt.loadNpmTasks("grunt-contrib-compress");
grunt.loadNpmTasks("grunt-contrib-uglify");
grunt.loadNpmTasks('grunt-modulefiles');

grunt.registerTask("build-src", ["clean", "concat"]);
grunt.registerTask("build-src", ["clean", "modulefiles", "concat"]);
grunt.registerTask("build-min", ["build-src", "uglify"]);
grunt.registerTask("build", ["build-min", "compress", "clean:build"]);
grunt.registerTask("default", ["build"]);
Expand Down
44 changes: 40 additions & 4 deletions README.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ Where Can I See a Demo?
How Do I Build VideoPlayer?
===========================

VideoPlayer can be used as is, by linking in all of the necessary dependencies into the <head>.
However, you may want to minimize on round trips to the server and on file size. With this in mind,
VideoPlayer can be used as is, by linking in all of the necessary dependencies into the <head>.
However, you may want to minimize on round trips to the server and on file size. With this in mind,
you will likely want to create source and minified versions of the concatenated JavaScript files by using
the grunt build described below. This will only minify and concatenate the js files, the other files will need
to be linked in independently. "lib/html5shiv/js/html5shiv.js" is the only JavaScript file which isn't included.
Expand All @@ -27,17 +27,35 @@ If you need to support older versions of IE you should include this file with a
Dependencies:

node.js (http://nodejs.org)
grunt-cli (http://gruntjs.com)

Build:

# only need to run if the grunt-cli has not already been installed
npm install -g grunt-cli

# only need to run this the first time, as it will install all necessary dependencies.
npm install
npm install

# runs the build and creates
# products/videoPlayer-all-VERSION.zip
# products/videoPlayer-all-min-VERSION.zip
grunt

Build Options:

# a comma separated list of modules to be included in the package
# Example: grunt --include="core"
include

# a comma separated list of modules to be excluded from the package.
# Example: grunt --exclude="infusion"
exclude

# the name of the package, used for both zip and js files. The minified version will have "-min" appeneded to the end.
# Example: grunt --packageName="customVP"
packageName

Other build tasks:

# will remove all build related directories and files
Expand All @@ -49,10 +67,28 @@ Other build tasks:
# will just build the concatentated files, source and min
gurnt build-min

Modules:

# The main video player js files
core

# The js files for the Captionator dependency
captionator

# The js files for the Infusion dependency
infusion

# The js files for jQueryUI Widgets not included in infusion
jQueryUI

# the js files for the MediaElement dependency
mediaelement


Who Makes VideoPlayer, and How Can I Help?
==========================================

The Fluid community is an international group of designers, developers, and testers who focus on a
The Fluid community is an international group of designers, developers, and testers who focus on a
common mission: improving the user experience and accessibility of the open web.

The best way to join the Fluid Community is to jump in to any of our community activities.
Expand Down
6 changes: 6 additions & 0 deletions lib/captionator/captiontaorDependencies.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"captionator": {
"files": ["lib/captionator/js/captionator.js"],
"dependencies": []
}
}
6 changes: 6 additions & 0 deletions lib/infusion/infusionDependencies.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"infusion": {
"files": ["lib/infusion/MyInfusion.js"],
"dependencies": []
}
}
6 changes: 6 additions & 0 deletions lib/jquery-ui/jQueryUIDependencies.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"jQueryUI": {
"files": ["lib/jquery-ui/js/jquery.ui.button.js"],
"dependencies": ["infusion"]
}
}
6 changes: 6 additions & 0 deletions lib/mediaelement/mediaelementDependencies.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"mediaelement": {
"files": ["lib/mediaelement/js/mediaelement.js"],
"dependencies": []
}
}
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "fluid-videoPlayer",
"version": "0.1.0-SNAPSHOT",
"version": "0.2.0-SNAPSHOT",
"description": "HTML5 video player built atop Fluid Infusion",
"repository": {
"type": "git",
Expand Down Expand Up @@ -32,6 +32,7 @@
"grunt-contrib-clean": "~0.4.1",
"grunt-contrib-concat": "~0.3.0",
"grunt-contrib-uglify": "~0.2.0",
"grunt-contrib-compress": "~0.5.0"
"grunt-contrib-compress": "~0.5.0",
"grunt-modulefiles": "git://github.com/fluid-project/grunt-modulefiles.git#0.1.0"
}
}
18 changes: 18 additions & 0 deletions videoPlayerDependencies.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"core": {
"files": [
"js/VideoPlayer_framework.js",
"js/VideoPlayer_showHide.js",
"js/VideoPlayer.js",
"js/VideoPlayer_html5Captionator.js",
"js/VideoPlayer_controllers.js",
"js/ToggleButton.js",
"js/MenuButton.js",
"js/VideoPlayer_media.js",
"js/VideoPlayer_transcript.js",
"js/VideoPlayer_intervalEventsConductor.js",
"js/VideoPlayer_uiOptions.js"
],
"dependencies": ["infusion", "jQueryUI", "captionator", "mediaelement"]
}
}

0 comments on commit a0fe2d0

Please sign in to comment.