File:  [mozdev] / needlesearch / build.xml
Revision 1.11: download - view: text, annotated - select for diffs - revision graph
Wed Jul 16 11:01:01 2003 UTC (16 years, 10 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.${user.name}.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="..\browsers\mozilla${test.browser.version}\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, &quot;profile&quot;));
   80: 			registerChrome(CONTENT | DELAYED_CHROME, getFolder(findDir, &quot;content&quot;));
   81:     		registerChrome(LOCALE | DELAYED_CHROME, getFolder(findDir, &quot;locale&quot;));
   82: 		</replacevalue>
   83: 		</replace>
   84: 		
   85: 		<replace file="src/install.js" token="//@@profileentries@@">
   86: 		<replacevalue>			
   87: 			//Now install the profile folder
   88: 			setPackageFolder(findDir);
   89: 			var err = addDirectory("needlesearch");
   90: 				if ( err == SUCCESS ) { 
   91: 				    registerChrome(CONTENT | PROFILE_CHROME, getFolder(findDir, &quot;profile&quot;));
   92: 					err = performInstall();
   93: 					if ( err != SUCCESS ) {
   94: 				    	alert("performInstall() bailed");
   95: 					}
   96: 				} else { 
   97: 					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");
   98: 				}
   99: 		</replacevalue>
  100: 		</replace>
  101: 		
  102: 		<replace file="src/install.js" token="@@message@@" value="NeedleSearch Toolbar"/>
  103: 	</target>
  104: 	
  105:     <target name="make-xpi" description="Make XPI for version ${app.version}" depends="label-build,create-install-all.js">
  106:         <property file="build-info.${user.name}.properties"/>
  107:         
  108:         <echo message="copy install.js"/>
  109:         <copy file="src/install-all.js" tofile="src/install.js"/>
  110: 
  111:         <echo message="Packaging webapp ${app.name}-${app.version}-nordf-(${build-nr}).xpi"/>
  112:         <zip destfile="bin/${app.name}-${app.version}-nordf-(${build-nr}).xpi">
  113: 			<fileset dir="./src">
  114: 					  <exclude name="needlesearch/**/NeedleSearchData.rdf"/>
  115: 					  <include name="install.js"/>
  116: 					  <include name="needlesearch/**/*.js"/>
  117: 					  <include name="needlesearch/**/*.xul"/>
  118: 					  <include name="needlesearch/**/*.dtd"/>
  119: 					  <include name="needlesearch/**/*.rdf"/>
  120: 					  <include name="needlesearch/**/*.properties"/>
  121: 					  <include name="needlesearch/**/*.gif"/>
  122: 					  <!--include name="needlesearch/**/*.png"/-->
  123:         	</fileset>		
  124:         </zip>
  125: 
  126:         <echo message="Cleaning up..."/>
  127:         <delete file="src/install.js"/>
  128: 
  129:       </target>
  130: 
  131: 	<target name="create-install-da.js" description="Creating install.js">
  132: 		
  133: 		<delete file="src/install.js"/>
  134: 		<copy file="src/install-all.js" tofile="src/install.js"/>
  135: 		<replace file="src/install.js" token="@@version-number@@" value="&quot;${app.version}&quot;"/>
  136: 		<replace file="src/install.js" token="@@entries@@">
  137: 		<replacevalue>			registerChrome(LOCALE | DELAYED_CHROME, getFolder(findDir, "locale/da/needlesearch"));
  138: 		</replacevalue>
  139: 		</replace>
  140: 		
  141: 		<replace file="src/install.js" token="@@message@@" value="Danish language pack"/>
  142: 		
  143: 	</target>
  144: 
  145: 
  146:     <target name="make-da-xpi" description="Make XPI for Danish Language pack version ${app.version}" depends="label-build,create-install-da.js">
  147: 
  148:         <echo message="Packaging webapp NS-da.xpi"/>
  149:         <zip destfile="bin/NS-da.xpi">
  150: 			<fileset dir="./src">
  151: 					  <exclude name="needlesearch/**/NeedleSearchData.rdf"/>
  152: 					  <include name="install.js"/>
  153: 					  <include name="needlesearch/locale/da/**/*.dtd"/>
  154: 					  <include name="needlesearch/locale/da/**/*.rdf"/>
  155: 					  <include name="needlesearch/locale/da/**/*.properties"/>
  156:         	</fileset>		
  157:         </zip>
  158: 
  159:         <echo message="Cleaning up..."/>
  160:         <delete file="src/install.js"/>
  161: 
  162:       </target>
  163: 
  164: 
  165: 	<target name="create-install-zh-CN.js" description="Creating install.js">
  166: 		
  167: 		<delete file="src/install.js"/>
  168: 		<copy file="src/install-all.js" tofile="src/install.js"/>
  169: 		<replace file="src/install.js" token="@@version-number@@" value="&quot;${app.version}&quot;"/>
  170: 		<replace file="src/install.js" token="@@entries@@">
  171: 		<replacevalue>			registerChrome(LOCALE | DELAYED_CHROME, getFolder(findDir, "locale/zh-CN/needlesearch"));
  172: 		</replacevalue>
  173: 		</replace>
  174: 		
  175: 		<replace file="src/install.js" token="@@message@@" value="simplified Chinese language pack"/>
  176: 		
  177: 	</target>
  178: 	
  179:     <target name="make-zh-CN-xpi" description="Make XPI for simplified Chinese language pack version ${app.version}" depends="label-build,create-install-zh-CN.js">
  180: 
  181:         <echo message="Packaging webapp NS-zh-CN.xpi"/>
  182:         <zip destfile="bin/NS-zh-CN.xpi">
  183: 			<fileset dir="./src">
  184: 					  <exclude name="needlesearch/**/NeedleSearchData.rdf"/>
  185: 					  <include name="install.js"/>
  186: 					  <include name="needlesearch/locale/zh-CN/**/*.dtd"/>
  187: 					  <include name="needlesearch/locale/zh-CN/**/*.rdf"/>
  188: 					  <include name="needlesearch/locale/zh-CN/**/*.properties"/>
  189:         	</fileset>		
  190:         </zip>
  191: 
  192:         <echo message="Cleaning up..."/>
  193:         <delete file="src/install.js"/>
  194: 
  195:       </target>
  196: 
  197: 	<target name="create-install-cy-GB.js" description="Creating install.js">
  198: 		
  199: 		<delete file="src/install.js"/>
  200: 		<copy file="src/install-all.js" tofile="src/install.js"/>
  201: 		<replace file="src/install.js" token="@@version-number@@" value="&quot;${app.version}&quot;"/>
  202: 		<replace file="src/install.js" token="@@entries@@">
  203: 		<replacevalue>			registerChrome(LOCALE | DELAYED_CHROME, getFolder(findDir, "locale/cy-GB/needlesearch"));
  204: 		</replacevalue>
  205: 		</replace>
  206: 		
  207: 		<replace file="src/install.js" token="@@message@@" value="Cymraeg/Welsh language pack"/>
  208: 		
  209: 	</target>
  210: 
  211: 
  212:     <target name="make-cy-GB-xpi" description="Make XPI for Cymraeg/Welsh Language pack version ${app.version}" depends="label-build,create-install-cy-GB.js">
  213:         
  214:         <echo message="Packaging webapp NS-cy-GB.xpi"/>
  215:         <zip destfile="bin/NS-cy-GB.xpi">
  216: 			<fileset dir="./src">
  217: 					  <exclude name="needlesearch/**/NeedleSearchData.rdf"/>
  218: 					  <include name="install.js"/>
  219: 					  <include name="needlesearch/locale/cy-GB/**/*.dtd"/>
  220: 					  <include name="needlesearch/locale/cy-GB/**/*.rdf"/>
  221: 					  <include name="needlesearch/locale/cy-GB/**/*.properties"/>
  222:         	</fileset>		
  223:         </zip>
  224:         
  225:         <echo message="Cleaning up..."/>
  226:         <delete file="src/install.js"/>
  227:       </target>
  228: 
  229: 
  230: 	<target name="create-install-it.js" description="Creating install.js">
  231: 		
  232: 		<delete file="src/install.js"/>
  233: 		<copy file="src/install-all.js" tofile="src/install.js"/>
  234: 		<replace file="src/install.js" token="@@version-number@@" value="&quot;${app.version}&quot;"/>
  235: 		<replace file="src/install.js" token="@@entries@@">
  236: 		<replacevalue>			registerChrome(LOCALE | DELAYED_CHROME, getFolder(findDir, "locale/it/needlesearch"));
  237: 		</replacevalue>
  238: 		</replace>
  239: 		
  240: 		<replace file="src/install.js" token="@@message@@" value="Italian language pack"/>
  241: 		
  242: 	</target>
  243: 
  244:     <target name="make-it-xpi" description="Make XPI for Italian Language pack version ${app.version}" depends="label-build,create-install-it.js">
  245: 
  246:         <echo message="Packaging webapp NS-it.xpi"/>
  247:         <zip destfile="bin/NS-it.xpi">
  248: 			<fileset dir="./src">
  249: 					  <exclude name="needlesearch/**/NeedleSearchData.rdf"/>
  250: 					  <include name="install.js"/>
  251: 					  <include name="needlesearch/locale/it/**/*.dtd"/>
  252: 					  <include name="needlesearch/locale/it/**/*.rdf"/>
  253: 					  <include name="needlesearch/locale/it/**/*.properties"/>
  254:         	</fileset>		
  255:         </zip>
  256: 
  257:         <echo message="Cleaning up..."/>
  258:         <delete file="src/install.js"/>
  259: 
  260:       </target>
  261: 
  262:     <target name="make-xpi+rdf" description="Make XPI for version ${app.version}" depends="label-build,create-install-all.js">
  263:         <property file="build-info.${user.name}.properties"/>
  264:         
  265:         <echo message="Packaging webapp ${app.name}-${app.version}-withrdf-(${build-nr}).xpi"/>
  266:         <zip destfile="bin/${app.name}-${app.version}-withrdf-(${build-nr}).xpi">
  267: 			<fileset dir="./src">
  268: 					  <include name="install.js"/>
  269: 					  <include name="needlesearch/**/*.js"/>
  270: 					  <include name="needlesearch/**/*.xul"/>
  271: 					  <include name="needlesearch/**/*.dtd"/>
  272: 					  <include name="needlesearch/**/*.rdf"/>
  273: 					  <include name="needlesearch/**/*.properties"/>
  274: 					  <include name="needlesearch/**/*.gif"/>
  275: 					  <!--include name="needlesearch/**/*.png"/-->
  276:         	</fileset>		
  277:         </zip>
  278:       </target>
  279: 
  280:     <target name="make-deinstaller" description="Make deinstaller for the toolbar">
  281:         <property file="build-info.${user.name}.properties"/>
  282:         
  283:         <echo message="Packaging webapp deinstall-${app.name}.xpi"/>
  284:         <jar destfile="bin/Deinstall-${app.name}.xpi">
  285: 			<fileset dir="./deinstall-src">
  286: 					  <exclude name="needlesearch/**/NeedleSearchData.rdf"/>
  287: 					  <include name="install.js"/>
  288: 					  <include name="needlesearch/**/*.js"/>
  289: 					  <include name="needlesearch/**/*.xul"/>
  290: 					  <include name="needlesearch/**/*.dtd"/>
  291: 					  <include name="needlesearch/**/*.rdf"/>
  292: 					  <include name="needlesearch/**/*.properties"/>
  293: 					  <include name="needlesearch/**/*.gif"/>
  294: 					  <!--include name="needlesearch/**/*.png"/-->
  295:         	</fileset>		
  296:         </jar>
  297:       </target>
  298: 
  299:     <target name="make-example-nsbookmarks" description="Make XPI for version ${app.version}">
  300:         <property file="build-info.${user.name}.properties"/>
  301:         
  302:         <echo message="Packaging example rdf: example-rdf-${app.version}.xpi"/>
  303:         <zip destfile="bin/example-rdf-${app.version}.xpi">
  304: 			<fileset dir="./rest">
  305: 					  <include name="needlesearch/**/NeedleSearchData.rdf"/>
  306: 					  <include name="install.js"/>
  307:         	</fileset>		
  308:         </zip>
  309:       </target>
  310: 
  311: </project>

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