File:  [mozdev] / needlesearch / build.xml
Revision 1.14: download - view: text, annotated - select for diffs - revision graph
Sun Sep 21 13:12:45 2003 UTC (16 years, 9 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/.">
   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/.">
   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/**/*.properties"/>
   65:         	  <include name="needlesearch/**/*.gif"/>
   66: 			  <!--include name="needlesearch/**/*.png"/-->
   67:         	</fileset>		
   68:         </copy>
   69:         
   70:       </target>
   71: 	
   72: 	<target name="create-install-all.js" description="Creating install.js">
   73: 		
   74: 		<delete file="src/install.js"/>
   75: 		<copy file="src/install-all.js" tofile="src/install.js"/>
   76: 		<replace file="src/install.js" token="@@version-number@@" value="&quot;${app.version}&quot;"/>
   77: 		<replace file="src/install.js" token="@@entries@@">
   78: 		<replacevalue>			
   79: 			registerChrome(CONTENT | DELAYED_CHROME, getFolder(findDir, "content"));
   80: 			registerChrome(LOCALE | DELAYED_CHROME, getFolder(findDir, "locale/en-US/needlesearch"));
   81:     		registerChrome(LOCALE | DELAYED_CHROME, getFolder(findDir, "locale/de-AT/needlesearch"));
   82:     		registerChrome(LOCALE | DELAYED_CHROME, getFolder(findDir, "locale/es-AR/needlesearch"));
   83:     		registerChrome(LOCALE | DELAYED_CHROME, getFolder(findDir, "locale/fr/needlesearch"));
   84:     		registerChrome(LOCALE | DELAYED_CHROME, getFolder(findDir, "locale/nl/needlesearch"));
   85: 	  		registerChrome(LOCALE | DELAYED_CHROME, getFolder(findDir, "locale/da/needlesearch"));
   86: 	  		registerChrome(LOCALE | DELAYED_CHROME, getFolder(findDir, "locale/cy-GB/needlesearch"));
   87: 	  		registerChrome(LOCALE | DELAYED_CHROME, getFolder(findDir, "locale/it/needlesearch"));
   88: 	  		registerChrome(LOCALE | DELAYED_CHROME, getFolder(findDir, "locale/ru/needlesearch"));
   89: 	  		registerChrome(LOCALE | DELAYED_CHROME, getFolder(findDir, "locale/zh-CN/needlesearch"));
   90: 	  		registerChrome(LOCALE | DELAYED_CHROME, getFolder(findDir, "locale/se/needlesearch"));
   91: 		</replacevalue>
   92: 		</replace>
   93: 		
   94: 		<replace file="src/install.js" token="//@@profileentries@@">
   95: 		<replacevalue>			
   96: 			//Now install the profile folder
   97: 			setPackageFolder(findDir);
   98: 			var err = addDirectory("needlesearch");
   99: 				if ( err == SUCCESS ) { 
  100: 				    registerChrome(CONTENT | PROFILE_CHROME, getFolder(findDir, &quot;profile&quot;));
  101: 					err = performInstall();
  102: 					if ( err != SUCCESS ) {
  103: 				    	alert("performInstall() bailed");
  104: 					}
  105: 				} else { 
  106: 					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");
  107: 				}
  108: 		</replacevalue>
  109: 		</replace>
  110: 		
  111: 		<replace file="src/install.js" token="@@message@@" value="NeedleSearch Toolbar"/>
  112: 	</target>
  113: 	
  114:     <target name="make-xpi" description="Make XPI for version ${app.version}" depends="label-build,create-install-all.js">
  115:         <property file="build-info.${user.name}.properties"/>
  116:         
  117:         <echo message="copy install.js"/>
  118:         <copy file="src/install-all.js" tofile="src/install.js"/>
  119: 
  120:         <echo message="Packaging webapp ${app.name}-${app.version}-(${build-nr}).xpi"/>
  121:         <zip destfile="bin/${app.name}-${app.version}-(${build-nr}).xpi">
  122: 			<fileset dir="./src">
  123: 					  <include name="install.js"/>
  124: 					  <include name="needlesearch/**/*.js"/>
  125: 					  <include name="needlesearch/**/*.xul"/>
  126: 					  <include name="needlesearch/**/*.dtd"/>
  127: 					  <include name="needlesearch/**/*.rdf"/>
  128: 					  <include name="needlesearch/**/*.properties"/>
  129: 					  <include name="needlesearch/**/*.gif"/>
  130: 					  <include name="extra/**/*.rdf"/>
  131: 					  
  132: 					  <!--exclude name="needlesearch/locale/zh-CN/**/*.*"/-->
  133: 					  <!--exclude name="needlesearch/locale/cy-GB/**/*.*"/-->
  134: 					  <!--exclude name="needlesearch/locale/it/**/*.*"/-->
  135:         	</fileset>		
  136:         </zip>
  137: 
  138:         <echo message="Cleaning up..."/>
  139:         <!--delete file="src/install.js"/-->
  140: 
  141:       </target>
  142: 
  143:     <target name="make-deinstaller" description="Make deinstaller for the toolbar">
  144:         <property file="build-info.${user.name}.properties"/>
  145:         
  146:         <echo message="Packaging webapp deinstall-${app.name}.xpi"/>
  147:         <jar destfile="bin/deinstall-${app.name}.xpi">
  148: 			<fileset dir="./deinstall-src">
  149: 					  <exclude name="needlesearch/**/NeedleSearchData.rdf"/>
  150: 					  <include name="install.js"/>
  151: 					  <include name="needlesearch/**/*.js"/>
  152: 					  <include name="needlesearch/**/*.xul"/>
  153: 					  <include name="needlesearch/**/*.dtd"/>
  154: 					  <include name="needlesearch/**/*.rdf"/>
  155: 					  <include name="needlesearch/**/*.properties"/>
  156: 					  <include name="needlesearch/**/*.gif"/>
  157: 					  <!--include name="needlesearch/**/*.png"/-->
  158:         	</fileset>		
  159:         </jar>
  160:       </target>
  161: 
  162:     <target name="make-example-nsbookmarks" description="Make XPI for version ${app.version}">
  163:         <property file="build-info.${user.name}.properties"/>
  164:         
  165:         <echo message="Packaging example rdf: example-rdf-${app.version}.xpi"/>
  166:         <zip destfile="bin/example-rdf-${app.version}.xpi">
  167: 			<fileset dir="./rest">
  168: 					  <include name="needlesearch/**/NeedleSearchData.rdf"/>
  169: 					  <include name="install.js"/>
  170:         	</fileset>		
  171:         </zip>
  172:       </target>
  173: 
  174: </project>

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