You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

106 lines
2.7 KiB

  1. 'use strict';
  2. module.exports = function(grunt) {
  3. // Project configuration.
  4. grunt.initConfig({
  5. // Metadata.
  6. pkg: grunt.file.readJSON('package.json'),
  7. banner: '/*! <%= pkg.name %> - v<%= pkg.version %> - ' +
  8. '<%= grunt.template.today("yyyy-mm-dd") %>\n' +
  9. '* Copyright (c) <%= grunt.template.today("yyyy") %> Brightcove;' +
  10. ' Licensed <%= _.pluck(pkg.licenses, "type").join(", ") %> */\n',
  11. // Task configuration.
  12. clean: {
  13. files: ['build', 'dist']
  14. },
  15. concat: {
  16. options: {
  17. banner: '<%= banner %>',
  18. stripBanners: true
  19. },
  20. dist: {
  21. src: ['src/video-js-hls.js',
  22. 'src/flv-tag.js',
  23. 'src/exp-golomb.js',
  24. 'src/h264-stream.js',
  25. 'src/aac-stream.js',
  26. 'src/segment-parser.js',
  27. 'src/segment-controller.js',
  28. 'src/m3u8/m3u8.js',
  29. 'src/m3u8/m3u8-tag-types.js',
  30. 'src/m3u8/m3u8-parser.js',
  31. 'src/manifest-controller.js',
  32. 'src/segment-controller.js',
  33. 'src/hls-playback-controller.js'],
  34. dest: 'dist/videojs.hls.js'
  35. },
  36. },
  37. uglify: {
  38. options: {
  39. banner: '<%= banner %>'
  40. },
  41. dist: {
  42. src: '<%= concat.dist.dest %>',
  43. dest: 'dist/videojs.hls.min.js'
  44. },
  45. },
  46. qunit: {
  47. files: ['test/**/*.html', '!test/perf.html']
  48. },
  49. jshint: {
  50. gruntfile: {
  51. options: {
  52. jshintrc: '.jshintrc'
  53. },
  54. src: 'Gruntfile.js'
  55. },
  56. src: {
  57. options: {
  58. jshintrc: 'src/.jshintrc'
  59. },
  60. src: ['src/**/*.js']
  61. },
  62. test: {
  63. options: {
  64. jshintrc: 'test/.jshintrc'
  65. },
  66. src: ['test/**/*.js',
  67. '!test/tsSegment.js',
  68. '!test/fixtures/*.js',
  69. '!test/manifest/**']
  70. },
  71. },
  72. watch: {
  73. gruntfile: {
  74. files: '<%= jshint.gruntfile.src %>',
  75. tasks: ['jshint:gruntfile']
  76. },
  77. src: {
  78. files: '<%= jshint.src.src %>',
  79. tasks: ['jshint:src', 'qunit']
  80. },
  81. test: {
  82. files: '<%= jshint.test.src %>',
  83. tasks: ['jshint:test', 'qunit']
  84. },
  85. },
  86. });
  87. // These plugins provide necessary tasks.
  88. grunt.loadNpmTasks('grunt-contrib-clean');
  89. grunt.loadNpmTasks('grunt-contrib-concat');
  90. grunt.loadNpmTasks('grunt-contrib-uglify');
  91. grunt.loadNpmTasks('grunt-contrib-qunit');
  92. grunt.loadNpmTasks('grunt-contrib-jshint');
  93. grunt.loadNpmTasks('grunt-contrib-watch');
  94. // Default task.
  95. grunt.registerTask('default',
  96. ['jshint',
  97. 'qunit',
  98. 'clean',
  99. 'concat',
  100. 'uglify']);
  101. };