User:Gekacheka:makeCalJar

From MozillaWiki
Jump to: navigation, search
#!/bin/sh
# makeCalJar.sh
#
# Bash script to build test calendar.jar from local cvs tree without MSVC.
# Assumes preprecessing directives (#if,#expand,# comment) have been handled
# (perhaps via editting or a private patch).
#
# This runs in directory for cvs tree, above mozilla/calendar/resources
# Requires the 'zip' utility.
cd mozilla/calendar/resources/
TEMP="/temp/mozcaljar"
# rm -r ${TEMP}
mkdir -p ${TEMP}/content/calendar/
cp -ru content/* ${TEMP}/content/calendar/
# if for sunbird, overwrite some files with sunbird versions
#cp ../sunbird/base/content/* ${TEMP}/content/calendar/
mkdir -p ${TEMP}/locale/en-US/calendar/
cp -ru locale/en-US/* ${TEMP}/locale/en-US/calendar/
for SKINNAME in classic modern; do
  mkdir -p ${TEMP}/skin/${SKINNAME}/calendar/
  cp -ru skin/${SKINNAME}/* ${TEMP}/skin/${SKINNAME}/calendar/
done
DIR=`pwd`
cd ${TEMP}
zip -r0 calendar.jar * -x "*[~#]"
cd "${DIR}"
# optional: create locale jars (english is included in calenda.jar)
#for LOCALENAME in cs-cZ cy-GB de-AT es-ES fr-FR hu-HU ja-JP lt-LT nl-NL pl-PL pt-BR sk-SK sl-SI sv-SE wen-DE; do 
#  mkdir -p ${TEMP}/locale/${LOCALENAME}/calendar/
#  cp -ru locale/${LOCALENAME}/* ${TEMP}/locale/${LOCALENAME}/calendar/
#  DIR=`pwd`
#  cd ${TEMP}
#  zip -r0 calendar-${LOCALENAME}.jar locale/${LOCALENAME}/calendar/
#  cd "${DIR}"
#done
cd ../../..
# copy to parent dir of mozilla/calendar/resources
cp ${TEMP}/calendar*.jar ./
# for Mozilla:
#  cp calendar*.jar ../mozilla/chrome/
#  cp mozilla/calendar/resources/content/calendarService.js \
#    ../mozilla/components/
# rm -r ${TEMP}