From 19b48e5588e51ee9eaf8bd1c503e967d18f9770d Mon Sep 17 00:00:00 2001 From: Joey Parrish Date: Thu, 29 Oct 2015 23:00:08 -0700 Subject: [PATCH] Add default build configs This offers three configurations by default: 1) everything enabled (including WebM and offline) 2) DASH MP4 VOD only 3) DASH MP4 live only The VOD and live configs are specifically targetting the most common scenarios. For VOD this means SegmentBase, and for live this means SegmentList and SegmentTemplate. Issue #116 Change-Id: I250b55c73c4a5f111dccd09bec11bc959ef2d13c --- .gitignore | 6 ++++++ README.md | 8 ++++++++ build/all.sh | 18 +++++++++++++++++- build/build.sh | 10 +--------- 4 files changed, 32 insertions(+), 10 deletions(-) diff --git a/.gitignore b/.gitignore index 77362d8078..b8284d5a9e 100644 --- a/.gitignore +++ b/.gitignore @@ -3,5 +3,11 @@ third_party/closure/goog/deps.js shaka-player.compiled.js shaka-player.compiled.debug.js shaka-player.compiled.debug.map +shaka-player.live.js +shaka-player.live.debug.js +shaka-player.live.debug.map +shaka-player.vod.js +shaka-player.vod.debug.js +shaka-player.vod.debug.map docs/api docs/reference diff --git a/README.md b/README.md index 7e6b645e01..3119c476bc 100644 --- a/README.md +++ b/README.md @@ -79,6 +79,14 @@ but in short, you can build the library by running: ./build/all.sh ``` +By default, we create three builds: +* shaka-player.compiled.js (full build) +* shaka-player.vod.js (DASH MP4 VOD content w/ SegmentBase only) +* shaka-player.live.js (DASH MP4 live content w/ Segment{Template,List} only) + +You can create custom builds by passing arguments to build/build.sh. See +build/all.sh and build/build.sh for details. + Compiling Shaka Player requires Java JRE 7 or greater, but you can use the library in uncompiled mode without Java. Just generate the closure dependencies by running: diff --git a/build/all.sh b/build/all.sh index 4faaa5344f..4c00caa3ae 100755 --- a/build/all.sh +++ b/build/all.sh @@ -15,9 +15,25 @@ # limitations under the License. dir=$(dirname $0)/.. +. "$dir"/build/lib.sh set -e "$dir"/build/gendeps.sh -"$dir"/build/build.sh "$dir"/build/lint.sh + +# Compile once with demo app files so they get checked. Don't keep the output. +(library_sources_0; closure_sources_0) | compile_0 \ + $arguments \ + --summary_detail_level 3 \ + "$dir"/{app,controls,sender,receiver,receiverApp,appUtils}.js \ + > /dev/null +# NOTE: --js_output_file /dev/null results in a non-zero return value and +# stops execution of this script. + +# Default build, all features enabled +"$dir"/build/build.sh +# MP4 VOD content only, no offline, live, or WebM +"$dir"/build/build.sh vod --disable-http --disable-offline --disable-webm --disable-live +# MP4 live content only, no offline, WebM, or SIDX +"$dir"/build/build.sh live --disable-http --disable-offline --disable-webm --disable-containers diff --git a/build/build.sh b/build/build.sh index 363dce3708..5d1ead5d08 100755 --- a/build/build.sh +++ b/build/build.sh @@ -65,14 +65,7 @@ rm -f "$dir"/lib.js{,.map} rm -f "$dir"/shaka-player.${name}.debug.{js,map} rm -f "$dir"/shaka-player.${name}.js -# Compile once with app/controls.js so they get checked. Don't keep the output. -(library_sources_0; closure_sources_0) | compile_0 \ - $arguments \ - --summary_detail_level 3 "$dir"/{app,controls,sender,receiver,receiverApp,appUtils}.js > /dev/null -# NOTE: --js_output_file /dev/null results in a non-zero return value and -# stops execution of this script. - -# Compile without app/controls.js and output the minified library only. +# Compile without demo app files and output the minified library only. # Including shaka-player.uncompiled makes sure that nothing gets stripped which # should be exported. Otherwise, things unused internally may be seen as dead # code. @@ -90,4 +83,3 @@ cp "$dir"/shaka-player.${name}{.debug,}.js # locations. echo "//# sourceMappingURL=shaka-player.${name}.debug.map" >> \ "$dir"/shaka-player.${name}.debug.js -