forked from ableplayer/ableplayer
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add a Grunt (and npm) build process, with instructions in README.md (…
…and removed compile.sh)
- Loading branch information
1 parent
fc9ba4d
commit e8c5339
Showing
5 changed files
with
149 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
.DS_Store | ||
thirdparty/jwplayer.* | ||
node_modules/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,101 @@ | ||
module.exports = function(grunt) { | ||
|
||
grunt.loadNpmTasks('grunt-contrib-uglify'); | ||
grunt.loadNpmTasks('grunt-contrib-concat'); | ||
grunt.loadNpmTasks('grunt-contrib-copy'); | ||
grunt.loadNpmTasks('grunt-contrib-cssmin'); | ||
grunt.loadNpmTasks('grunt-contrib-clean'); | ||
grunt.loadNpmTasks("grunt-remove-logging"); | ||
grunt.loadNpmTasks('grunt-contrib-jshint'); | ||
|
||
grunt.initConfig({ | ||
pkg: grunt.file.readJSON('package.json'), | ||
concat: { | ||
build: { | ||
src: [ | ||
// Ultimately this should be just 'scripts/*.js', | ||
// but for now we're maintaining the order which was | ||
// specified in the previous 'compile.sh' script | ||
'scripts/ableplayer-base.js', | ||
'scripts/initialize.js', | ||
'scripts/preference.js', | ||
'scripts/webvtt.js', | ||
'scripts/buildplayer.js', | ||
'scripts/track.js', | ||
'scripts/seekbar.js', | ||
'scripts/dialog.js', | ||
'scripts/misc.js', | ||
'scripts/description.js', | ||
'scripts/browser.js', | ||
'scripts/control.js', | ||
'scripts/caption.js', | ||
'scripts/metadata.js', | ||
'scripts/translation.js', | ||
'scripts/transcript.js', | ||
'scripts/search.js', | ||
'scripts/event.js' | ||
], | ||
dest: 'build/<%= pkg.name %>.js' | ||
}, | ||
}, | ||
removelogging: { | ||
dist: { | ||
src: [ | ||
'build/<%= pkg.name %>.js' | ||
], | ||
dest: 'build/<%= pkg.name %>.dist.js' | ||
}, | ||
options: { | ||
// Remove all console output (see https://www.npmjs.com/package/grunt-remove-logging) | ||
} | ||
}, | ||
uglify: { | ||
min: { | ||
src : ['build/<%= pkg.name %>.dist.js'], | ||
dest : 'build/<%= pkg.name %>.min.js', | ||
}, | ||
options: { | ||
// Add a banner with the package name and version | ||
// (no date, otherwise a new build is different even if the code didn't change!) | ||
banner: '/*! <%= pkg.name %> V<%= pkg.version %> */\n', | ||
// Preserve comments that start with a bang (like the file header) | ||
preserveComments: "some" | ||
} | ||
}, | ||
cssmin: { | ||
min: { | ||
src : [ | ||
'styles/ableplayer.css', | ||
'styles/ableplayer-playlist.css', | ||
'styles/ableplayer-search.css', | ||
'styles/ableplayer-transcript.css' | ||
], | ||
dest : 'build/<%= pkg.name %>.min.css', | ||
}, | ||
options: { | ||
// Add a banner with the package name and version | ||
// (no date, otherwise a new build is different even if the code didn't change!) | ||
// (oddly, here we don't need a '\n' at the end!) | ||
banner: '/*! <%= pkg.name %> V<%= pkg.version %> */', | ||
} | ||
}, | ||
jshint: { | ||
files: ['Gruntfile.js', 'scripts/**/*.js'], | ||
options: { | ||
// options here to override JSHint defaults | ||
globals: { | ||
browser: true, | ||
jquery: true, | ||
devel: true, | ||
} | ||
} | ||
}, | ||
clean: { | ||
build: ['build'], | ||
}, | ||
|
||
}); | ||
|
||
grunt.registerTask('default', ['concat', 'removelogging', 'uglify', 'cssmin']); | ||
grunt.registerTask('test', ['jshint']); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
{ | ||
"name": "ableplayer", | ||
"version": "2.03.0", | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/ableplayer/ableplayer.git" | ||
}, | ||
"devDependencies": { | ||
"grunt": "~0.4.1", | ||
"grunt-contrib-clean": "~0.6.0", | ||
"grunt-contrib-concat": "~0.3.0", | ||
"grunt-contrib-copy": "~0.4.1", | ||
"grunt-contrib-cssmin": "~0.6.1", | ||
"grunt-contrib-jshint": "^0.10.0", | ||
"grunt-contrib-uglify": "~0.2.2", | ||
"grunt-remove-logging": "~0.2.0" | ||
} | ||
} |