myplayer/src/build.sh

75 lines
2.1 KiB
Bash
Raw Normal View History

#!/bin/bash
# MyPlayer - Copyright 2014 - 2024 tilt@linuxfoo.de GPLv3
2024-09-21 16:05:22 +02:00
# Build Script; recompiles the MyPlayer JavaScript from source.
dir=$(readlink -f "$(dirname "$0")")
jsdir=$(readlink -f "$dir/../dist/js")
if ! cd "$dir" ; then
echo "ERROR: Could not change working directory; aborted." >&2 ;
exit 1 ;
elif ! mkdir -p "$jsdir" ; then
echo "ERROR: Could not create directory $jsdir; aborted." >&2 ;
exit 1 ;
elif ! type yui-compressor > /dev/null ; then
echo "ERROR: Executable \"yui-compressor\" not found in PATH; aborted." >&2 ;
exit 1 ;
fi
2024-09-21 16:05:22 +02:00
echo '/*
jQuery
Copyright 2014 jQuery Foundation and other contributors
http://jquery.com/
MediaElement.js
Copyright 2010-2013, John Dyer (http://j.hn)
MediaElement Playlist Feature (plugin) -
Andrew Berezovsky <andrew.berezovsky@gmail.com>
and Junaid Qadir Baloch <shekhanzai.baloch@gmail.com>
JavaScript-ID3-Reader
Copyright (c) 2008 Jacob Seidelin, http://blog.nihilogic.dk/ BSD License
Copyright (c) 2009 Opera Software ASA BSD License
Copyright (c) 2010 Antonio Afonso BSD License
2024-09-21 16:05:22 +02:00
Copyright (c) 2010 Joshua Kifer BSD License
MyPlayer
Copyright (c) 2014 - 2024 tilt@linuxfoo.de MIT License
*/' > "$jsdir"/myplayer.min.js
rm -f "$jsdir"/myplayer.min.js
for js in \
../mediaelement/build/mediaelement-and-player.min.js \
../mediaelement-plugins/dist/playlist/playlist.min.js
do
echo "INFO: Appending $js ..." >&2
cat $js >> "$jsdir"/myplayer.min.js
done
for js in \
id3-minimized.js \
player.js
do
echo "INFO: Compressing $js ..." >&2
yui-compressor "$js" >> "$jsdir"/myplayer.min.js
done
chmod 644 "$jsdir"/myplayer.min.js
echo "INFO: Javascript source was minimized to $jsdir/myplayer.min.js" >&2
rm -f ../js/myplayer.js
for js in \
../mediaelement/build/mediaelement-and-player.js \
../mediaelement-plugins/dist/playlist/playlist.js \
id3-minimized.js \
player.js
do
echo "INFO: Appending $js ..." >&2
cat $js >> "$jsdir"/myplayer.js
done
chmod 644 "$jsdir"/myplayer.js
echo "INFO: Uncompressed javascript source was collected in $jsdir/myplayer.js" >&2