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

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