From: jkkn Date: Wed, 17 Oct 2007 09:19:28 +0000 (+0000) Subject: added auto version insertion X-Git-Url: https://git.jkkn.net/?a=commitdiff_plain;h=b4b785dfcdb20ed9a33fbe0ece8a5b104f80590d;p=tv2developer added auto version insertion --- diff --git a/build.sh b/build.sh index e8f17fc..79671e5 100755 --- a/build.sh +++ b/build.sh @@ -57,37 +57,45 @@ TMP_DIR=build #set -x # remove any left-over files from previous build -rm $APP_NAME.jar -rm $APP_NAME.xpi -rm files -rm -rf $TMP_DIR +rm $APP_NAME.jar 2>/dev/null +rm $APP_NAME.xpi 2>/dev/null +rm files 2>/dev/null +rm -rf $TMP_DIR 2>/dev/null -vi install.rdf content/about.xul +#vi install.rdf content/about.xul $BEFORE_BUILD +VERSION=`head -1 version` + +echo "Build for version $VERSION..." + + mkdir -pv $TMP_DIR/chrome +mkdir -pv $TMP_DIR/chrome-tmp # generate the JAR file, excluding CVS and temporary files JAR_FILE=$TMP_DIR/chrome/$APP_NAME.jar -echo "Generating $JAR_FILE..." for CHROME_SUBDIR in $CHROME_PROVIDERS; do - find $CHROME_SUBDIR -path '*CVS*' -prune -o -type f -print | grep -v \~ >> files + cp -r $CHROME_SUBDIR $TMP_DIR/chrome-tmp/ done -zip -0 -r $JAR_FILE `cat files` # The following statement should be used instead if you don't wish to use the JAR file #cp --verbose --parents `cat files` $TMP_DIR/chrome # prepare components and defaults echo "Copying various files to $TMP_DIR folder..." for DIR in $ROOT_DIRS; do - mkdir $TMP_DIR/$DIR FILES="`find $DIR -path '*CVS*' -prune -o -type f -print | grep -v \~`" echo $FILES >> files - cp -v -r $DIR $TMP_DIR + cp -r $DIR $TMP_DIR done +# Remove CVS dirs +echo `pwd` +echo $TMP_DIR +find $TMP_DIR -path '*CVS*' -type d -print0 | xargs -0 rm -rf + # Copy other files to the root of future XPI. for ROOT_FILE in $ROOT_FILES install.rdf chrome.manifest; do cp -v $ROOT_FILE $TMP_DIR @@ -100,6 +108,12 @@ cd $TMP_DIR if [ -f "chrome.manifest" ]; then echo "Preprocessing chrome.manifest..." + + perl -pi -e "s/^(content\s+\S*\s+)(\S*\/)$/\1jar:chrome\/$APP_NAME\.jar!\/\\2/g" chrome.manifest + perl -pi -e "s/^(skin|locale)(\s+\S*\s+\S*\s+)(.*\/)$/\1\2jar:chrome\/$APP_NAME\.jar!\/\3/g" chrome.manifest + + cat chrome.manifest + # You think this is scary? #s/^(content\s+\S*\s+)(\S*\/)$/\1jar:chrome\/$APP_NAME\.jar!\/\2/ #s/^(skin|locale)(\s+\S*\s+\S*\s+)(.*\/)$/\1\2jar:chrome\/$APP_NAME\.jar!\/\3/ @@ -111,6 +125,17 @@ if [ -f "chrome.manifest" ]; then # (it simply adds jar:chrome/whatever.jar!/ at appropriate positions of chrome.manifest) fi +# updating version information - added jkkn +find . -type f \( -name "*.js" -or -name "*.xul" -or -name "*.rdf" \) | while read y; do +perl -pi -e "s/\\\$\{VERSION}/$VERSION/g" $y; +done + +echo "Generating $JAR_FILE..." +cd chrome-tmp +zip -0 -r ../../$JAR_FILE * +cd .. +rm -rf chrome-tmp + # generate the XPI file echo "Generating $APP_NAME.xpi..." zip -r ../$APP_NAME.xpi * @@ -128,8 +153,13 @@ fi # remove the working files rm -rf $TMP_DIR -cp -v tv2developer.xpi /sites/jkkndk/www.jkkn.net/webroot/tv2developer/ -vi /sites/jkkndk/www.jkkn.net/webroot/tv2developer/update.rdf +WEBPATH=/sites/jkkndk/www.jkkn.net/webroot/tv2developer/ +cp -v tv2developer.xpi $WEBPATH +cp -R webroot/ $WEBPATH +find $WEBPATH -path '*CVS*' -type d -print0 | xargs -0 rm -rf +find $WEBPATH -type f \( -name "*.html" -or -name "*.php" -or -name "*.rdf" \) | while read y; do + perl -pi -e "s/\\\${VERSION}/$VERSION/g" $y; +done echo "Done!" $AFTER_BUILD diff --git a/chrome.manifest b/chrome.manifest index dcd0227..d6e5173 100755 --- a/chrome.manifest +++ b/chrome.manifest @@ -1,6 +1,6 @@ -content tv2developer jar:chrome/tv2developer.jar!/content/ -skin tv2developer classic/1.0 jar:chrome/tv2developer.jar!/skin/ -locale tv2developer en-US jar:chrome/tv2developer.jar!/locale/en-US/ +content tv2developer content/ +skin tv2developer classic/1.0 skin/ +locale tv2developer en-US locale/en-US/ overlay chrome://browser/content/browser.xul chrome://tv2developer/content/browser_overlay.xul style chrome://global/content/customizeToolbar.xul chrome://tv2developer/skin/tv2developer.css diff --git a/content/about.xul b/content/about.xul index e091aa3..b47b8f2 100755 --- a/content/about.xul +++ b/content/about.xul @@ -11,7 +11,7 @@ - + {17AB1CC5-F137-4697-9E48-D8C49AFC3B77} TV 2 Developer Plugin - 0.4.14 + ${VERSION} Adds a menu with tv2.dk development URLs depending on the tv2-page you are visting. Kristian Kræmmer Nielsen http://jkkn.dk/tv2developer/ diff --git a/tv2developer.xpi b/tv2developer.xpi deleted file mode 100644 index ccb684e..0000000 Binary files a/tv2developer.xpi and /dev/null differ diff --git a/version b/version new file mode 100644 index 0000000..4ea988f --- /dev/null +++ b/version @@ -0,0 +1 @@ +0.4.15 diff --git a/webroot/.htaccess b/webroot/.htaccess new file mode 100644 index 0000000..6134935 --- /dev/null +++ b/webroot/.htaccess @@ -0,0 +1 @@ +AddType application/x-xpinstall .xpi