File:  [mozdev] / needlesearch / build.xml
Revision 1.20: download - view: text, annotated - select for diffs - revision graph
Thu Feb 5 11:50:19 2004 UTC (16 years, 5 months ago) by eelco
Branches: MAIN
CVS tags: HEAD
no message

    1: <project name="NeedleSearch Toolbar" default="make-xpi" basedir=".">
    2: 
    3:       <property file="build.properties"/>
    4:       
    5:       <property name="app.name" value="NeedleSearch"/>
    6: 
    7:   <!-- Actions -->
    8: 
    9:     <!-- Label the build -->
   10:       <target name="label-build" description="Label the build">
   11: 
   12:         <propertyfile
   13:             file="build-info.${user.name}.properties"
   14:             comment="Build information" >
   15:           <entry  key="developer" value="${user.name}" />
   16:           <entry  key="date" type="date" value="now"/>
   17:           <entry  key="build-nr" type="int" default="0" operation="+"/>
   18:         </propertyfile>
   19: 
   20:         <propertyfile
   21:             file="developer.properties"
   22:             comment="Build information" >
   23:           <entry  key="developer" value="${user.name}" />
   24:         </propertyfile>
   25: 
   26:         <loadfile property="build-info-string" srcFile="build-info.${user.name}.properties">
   27:           <filterchain>
   28:             <striplinebreaks/>
   29:           </filterchain>
   30:         </loadfile>
   31: 
   32:         <!-- add to the build history -->
   33:         <concat append="yes" destfile="build-history.${user.name}.txt" >${build-info-string}</concat>
   34: 
   35:       </target>
   36: 
   37: 
   38: 	<target name="copy-from-live" description="Copies files from the test environment to src tree">
   39:         <echo message="Copy files from ..\..\browsers\mozilla${test.browser.version}\chrome\ "/>
   40:         <copy todir="${src.dir}/.">
   41:         	<fileset dir="F:\\Program Files\\mozilla.org\\Mozilla\\chrome">
   42:         	  <exclude name="needlesearch/**/NeedleSearchData.rdf"/>
   43:         	  <include name="needlesearch/**/*.js"/>
   44:         	  <include name="needlesearch/**/*.xul"/>
   45:         	  <include name="needlesearch/**/*.dtd"/>
   46:         	  <include name="needlesearch/**/*.rdf"/>
   47:         	  <include name="needlesearch/**/*.properties"/>
   48:         	  <include name="needlesearch/**/*.gif"/>
   49: 			  <!--include name="needlesearch/**/*.png"/-->
   50:         	</fileset>		
   51:         </copy>
   52:     </target>
   53:     
   54:     <target name="deploy-to-live" description="Deploy to live environment Mozilla ${test.browser.version}">
   55:         
   56:         <echo message="Copy files from src tree to Mozilla ${test.browser.version}"/>
   57:         <copy todir="${test.browser.location}\\chrome">
   58:         	<fileset dir="${src.dir}/.">
   59:         	  <exclude name="needlesearch/**/NeedleSearchData.rdf"/>
   60:         	  <include name="needlesearch/**/*.js"/>
   61:         	  <include name="needlesearch/**/*.xul"/>
   62:         	  <include name="needlesearch/**/*.dtd"/>
   63:         	  <include name="needlesearch/**/*.rdf"/>
   64:         	  <include name="needlesearch/**/*.css"/>
   65:         	  <include name="needlesearch/**/*.xml"/>
   66:         	  <include name="needlesearch/**/*.properties"/>
   67:         	  <include name="needlesearch/**/*.gif"/>
   68: 			  <!--include name="needlesearch/**/*.png"/-->
   69:         	</fileset>		
   70:         </copy>
   71:         
   72:       </target>
   73: 	
   74: 	<target name="create-install-all.js" description="Creating install.js">
   75: 		
   76: 		<delete file="${src.dir}/install.js"/>
   77: 		<copy file="${src.dir}/install-all.js" tofile="${src.dir}/install.js"/>
   78: 		<replace file="${src.dir}/install.js" token="@@version-number@@" value="&quot;${app.version}&quot;"/>
   79: 		<replace file="${src.dir}/install.js" token="@@entries@@">
   80: 		<replacevalue>			
   81: 			registerChrome(CONTENT | DELAYED_CHROME, getFolder(findDir, "content"));
   82: 			registerChrome(LOCALE | DELAYED_CHROME, getFolder(findDir, "locale/en-US/needlesearch"));
   83:     		registerChrome(LOCALE | DELAYED_CHROME, getFolder(findDir, "locale/de-AT/needlesearch"));
   84:     		registerChrome(LOCALE | DELAYED_CHROME, getFolder(findDir, "locale/es-AR/needlesearch"));
   85:     		registerChrome(LOCALE | DELAYED_CHROME, getFolder(findDir, "locale/fr/needlesearch"));
   86:     		registerChrome(LOCALE | DELAYED_CHROME, getFolder(findDir, "locale/fi/needlesearch"));
   87:     		registerChrome(LOCALE | DELAYED_CHROME, getFolder(findDir, "locale/nl/needlesearch"));
   88: 	  		registerChrome(LOCALE | DELAYED_CHROME, getFolder(findDir, "locale/da/needlesearch"));
   89: 	  		registerChrome(LOCALE | DELAYED_CHROME, getFolder(findDir, "locale/cy-GB/needlesearch"));
   90: 	  		registerChrome(LOCALE | DELAYED_CHROME, getFolder(findDir, "locale/it/needlesearch"));
   91: 	  		registerChrome(LOCALE | DELAYED_CHROME, getFolder(findDir, "locale/ru/needlesearch"));
   92: 	  		registerChrome(LOCALE | DELAYED_CHROME, getFolder(findDir, "locale/zh-CN/needlesearch"));
   93: 	  		registerChrome(LOCALE | DELAYED_CHROME, getFolder(findDir, "locale/se/needlesearch"));
   94: 		</replacevalue>
   95: 		</replace>
   96: 		
   97: 		<replace file="${src.dir}/install.js" token="//@@profileentries@@">
   98: 		<replacevalue>			
   99: 			//Now install the profile folder
  100: 			setPackageFolder(findDir);
  101: 			var err = addDirectory("needlesearch");
  102: 				if ( err == SUCCESS ) { 
  103: 				    registerChrome(CONTENT | PROFILE_CHROME, getFolder(findDir, &quot;profile&quot;));
  104: 					err = performInstall();
  105: 					if ( err != SUCCESS ) {
  106: 				    	alert("performInstall() bailed");
  107: 					}
  108: 				} else { 
  109: 					alert("Creating the profile directory: needlesearch failed. Are you logged in as root?\nLinux/Unix user: make sure that all files in the directory chrome/needlesearch/ have write permissions");
  110: 				}
  111: 		</replacevalue>
  112: 		</replace>
  113: 		
  114: 		<replace file="${src.dir}/install.js" token="@@message@@" value="NeedleSearch Toolbar"/>
  115: 	</target>
  116: 	
  117: 	<target name="version" description="Replacing all version numbers">
  118: 		
  119: 		<replace file="${src.dir}/needlesearch/content/settings.xul" token="@@version-number@@" value="${app.version}"/>
  120: 		<replace file="${src.dir}/needlesearch/content/settingsDialog.xul" token="@@version-number@@" value="${app.version}"/>
  121: 		<replace file="${src.dir}/needlesearch/content/settingsOverlay.xul" token="@@version-number@@" value="${app.version}"/>
  122: 		
  123: 	</target>
  124: 	
  125: 	<target name="deversion" description="Replacing all version numbers for replacevalue">
  126: 		
  127: 		<replace file="${src.dir}/needlesearch/content/settings.xul" token="${app.version}" value="@@version-number@@"/>
  128: 		<replace file="${src.dir}/needlesearch/content/settingsDialog.xul" token="${app.version}" value="@@version-number@@"/>
  129: 		<replace file="${src.dir}/needlesearch/content/settingsOverlay.xul" token="${app.version}" value="@@version-number@@"/>
  130: 		
  131: 	</target>
  132: 	
  133: 	<target name="make-target" description="Make XPI for version ${app.version}">
  134:         <property file="build-info.${user.name}.properties"/>
  135:         
  136:         <echo message="copy install.js"/>
  137:         <copy file="${src.dir}/install-all.js" tofile="${src.dir}/install.js"/>
  138: 
  139:         <echo message="Packaging webapp ${app.name}-${app.version}-(${build-nr}).xpi"/>
  140:         <zip destfile="bin/${app.name}-${app.version}-(${build-nr}).xpi">
  141: 			<fileset dir="./${src.dir}">
  142: 					  <include name="install.js"/>
  143: 					  <include name="needlesearch/**/*.js"/>
  144: 					  <include name="needlesearch/**/*.xul"/>
  145: 					  <include name="needlesearch/**/*.dtd"/>
  146: 					  <include name="needlesearch/**/*.rdf"/>
  147: 					  <include name="needlesearch/**/*.properties"/>
  148: 					  <include name="needlesearch/**/*.gif"/>
  149: 					  <include name="extra/**/*.rdf"/>
  150: 					  <exclude name="needlesearch/content/NeedleSearchData.rdf"/>
  151: 					  <!--exclude name="needlesearch/locale/cy-GB/**/*.*"/-->
  152: 					  <!--exclude name="needlesearch/locale/it/**/*.*"/-->
  153:         	</fileset>		
  154:         </zip>
  155: 
  156:         <echo message="Cleaning up..."/>
  157:         <!--delete file="${src.dir}/install.js"/-->
  158: 
  159:     </target>
  160: 	
  161: 	
  162:     <target name="make-xpi" 
  163:     		description="Make XPI for version ${app.version}" 
  164:     		depends="label-build,version,create-install-all.js,make-target,deversion"/>
  165: 
  166:     <target name="make-deinstaller" description="Make deinstaller for the toolbar">
  167:         <property file="build-info.${user.name}.properties"/>
  168:         
  169:         <echo message="Packaging webapp deinstall-${app.name}.xpi"/>
  170:         <jar destfile="bin/deinstall-${app.name}.xpi">
  171: 			<fileset dir="./deinstall-src">
  172: 					  <exclude name="needlesearch/**/NeedleSearchData.rdf"/>
  173: 					  <include name="install.js"/>
  174: 					  <include name="needlesearch/**/*.js"/>
  175: 					  <include name="needlesearch/**/*.xul"/>
  176: 					  <include name="needlesearch/**/*.dtd"/>
  177: 					  <include name="needlesearch/**/*.rdf"/>
  178: 					  <include name="needlesearch/**/*.properties"/>
  179: 					  <include name="needlesearch/**/*.gif"/>
  180: 					  <!--include name="needlesearch/**/*.png"/-->
  181:         	</fileset>		
  182:         </jar>
  183:       </target>
  184: 
  185:     <target name="make-iconpacks" description="Make iconpacks">
  186:         
  187:         <echo message="Packaging default iconpack"/>
  188:         <delete file="./icon/install.js"/>
  189: 		<copy file="./icon/install-icons.js" tofile="./icon/install.js"/>
  190: 		<replace file="./icon/install.js" token="@@dirname@@" value="default"/>
  191:         <zip destfile="bin/ns-icons-default.xpi">
  192: 			<fileset dir="./icon">
  193: 					  <include name="default/*.gif"/>
  194: 					  <include name="install.js"/>
  195:         	</fileset>		
  196:         </zip>
  197: 
  198:         <echo message="Packaging modern iconpack"/>
  199:         <delete file="./icon/install.js"/>
  200: 		<copy file="./icon/install-icons.js" tofile="./icon/install.js"/>
  201: 		<replace file="./icon/install.js" token="@@dirname@@" value="modern"/>
  202:         <zip destfile="bin/ns-icons-modern.xpi">
  203: 			<fileset dir="./icon">
  204: 					  <include name="modern/*.gif"/>
  205: 					  <include name="install.js"/>
  206:         	</fileset>		
  207:         </zip>
  208:         
  209:         <echo message="Packaging monochromatic iconpack"/>
  210:         <delete file="./icon/install.js"/>
  211: 		<copy file="./icon/install-icons.js" tofile="./icon/install.js"/>
  212: 		<replace file="./icon/install.js" token="@@dirname@@" value="monochromatic"/>
  213:         <zip destfile="bin/ns-icons-monochromatic.xpi">
  214: 			<fileset dir="./icon">
  215: 					  <include name="monochromatic/*.gif"/>
  216: 					  <include name="install.js"/>
  217:         	</fileset>		
  218:         </zip>
  219:         
  220:       </target>
  221:       
  222: </project>

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