File:  [mozdev] / converter / src / build.php
Revision 1.1: download - view: text, annotated - select for diffs - revision graph
Fri Oct 1 20:14:54 2010 UTC (9 years, 6 months ago) by bogdan
Branches: MAIN
CVS tags: HEAD
switched to php

    1: #!/usr/bin/php
    2: <?php
    3: 
    4: $output="converter_current.xpi";
    5: if (!chdir(dirname(__FILE__)."/chrome")) {
    6: 	echo "Directory ".dirname(__FILE__)."/chrome not found; exiting.\n";
    7: 	exit(1);
    8: }
    9: 
   10: $jar_files=array(
   11: 	"content/converter_conversions.js",
   12: 	"content/converter_init.js",
   13: 	"content/converter_core.js",
   14: 	"content/converter_iface.js",
   15: 	"content/converter_util.js",
   16: 	"content/converter_regression.js",
   17: 	"content/converter_tz.js",
   18: 	"content/converter_prefs.js",
   19: 	"content/converter_prefs_gui.js",
   20: 	"content/converter_prefs_iface.js",
   21: 	"content/converter_currency.js",
   22: 	"content/converter_currency_iface.js",
   23: 	"content/converter_premium.js",
   24: 	"content/converterOverlay.xul",
   25: 	"content/converterPrefDialog.xul",
   26: 	"content/custom_conversion.xul",
   27: 	"skin/classic/cv_stat_on.png",
   28: 	"skin/classic/cv_stat_off.png",
   29: 	"skin/classic/cv_stat_progress.png",
   30: 	"skin/classic/cv_stat_denied.png",
   31: 	"skin/classic/pref_fullpage_icon.png",
   32: 	"skin/classic/pref_fullpage_menu.png",
   33: 	"skin/classic/pref_selection_menu.png",
   34: 	"skin/classic/1cm.png",
   35: 	"skin/classic/clock.png",
   36: 	"skin/classic/converter_24x24.png",
   37: 	"skin/classic/converter.png",
   38: 	"skin/classic/menu_feedback.png",
   39: 	"skin/classic/menu_homepage.png",
   40: 	"skin/classic/menu_options.png",
   41: 	"skin/classic/menu_custom_conversion.png",
   42: 	"skin/classic/menu_buy_premium.png",
   43: 	"skin/classic/pref_enable_currency.png",
   44: 	"skin/classic/pref_custom_convert_selection.png",
   45: 	"skin/classic/pref_detail.png",
   46: 	"skin/classic/pref_one_way.png",
   47: 	"skin/classic/pref_auto_convert.png",
   48: 	"skin/classic/pref_ws.png",
   49: 	"skin/classic/custom_conversion_header.png",
   50: 	"LICENSE.txt",
   51: );
   52: $xpi_files=array(
   53: 	"chrome.manifest",
   54: 	"install.rdf",
   55: 	"chrome/converter.jar"
   56: );
   57: 
   58: $ok=true;
   59: foreach($jar_files as $file) {
   60: 	if (!is_file($file) || !is_readable($file)) {
   61: 		echo "[JAR] File $file doesn't exist or can't be read.\n";
   62: 		$ok=false;
   63: 	}
   64: }
   65: if (!$ok) {
   66: 	echo "Exiting.\n";
   67: 	exit(2);
   68: }
   69: 
   70: $zip="zip converter.jar ".implode(" ",$jar_files);
   71: 
   72: exec($zip,$out,$rc);
   73: if ($rc) {
   74: 	echo "[JAR] Failed zipping; exiting.\n";
   75: 	exit(3);
   76: }
   77: 
   78: chdir(dirname(__FILE__));
   79: foreach($xpi_files as $file) {
   80: 	if (!is_file($file) || !is_readable($file)) {
   81: 		echo "[XPI] File $file doesn't exist or can't be read.\n";
   82: 		$ok=false;
   83: 	}
   84: }
   85: if (!$ok) {
   86: 	echo "Exiting.\n";
   87: 	exit(4);
   88: }
   89: 
   90: $zip="zip $output ".implode(" ",$xpi_files);
   91: exec($zip,$out,$rc);
   92: if ($rc) {
   93: 	echo "[XPI] Failed zipping; exiting.\n";
   94: 	exit(5);
   95: }
   96: echo "Build done -- XPI file: $output\n";
   97: if (copy($output,"/var/www/html/projects.moongate.ro/".$output)) {
   98: 	echo "Also copied under http://projects.moongate.ro/$output\n";
   99: }
  100: unlink("chrome/converter.jar");
  101: echo "Clean exit.\n";

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>