File:  [mozdev] / needlesearch / build.xml
Revision 1.10: download - view: text, annotated - select for diffs - revision graph
Mon Jul 7 15:05:54 2003 UTC (16 years, 11 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: 	<target name="create-install-cy-GB.js" description="Creating install.js">
  165: 		
  166: 		<delete file="src/install.js"/>
  167: 		<copy file="src/install-all.js" tofile="src/install.js"/>
  168: 		<replace file="src/install.js" token="@@version-number@@" value="&quot;${app.version}&quot;"/>
  169: 		<replace file="src/install.js" token="@@entries@@">
  170: 		<replacevalue>			registerChrome(LOCALE | DELAYED_CHROME, getFolder(findDir, "locale/cy-GB/needlesearch"));
  171: 		</replacevalue>
  172: 		</replace>
  173: 		
  174: 		<replace file="src/install.js" token="@@message@@" value="Cymraeg/Welsh language pack"/>
  175: 		
  176: 	</target>
  177: 
  178: 
  179:     <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">
  180:         
  181:         <echo message="Packaging webapp NS-cy-GB.xpi"/>
  182:         <zip destfile="bin/NS-cy-GB.xpi">
  183: 			<fileset dir="./src">
  184: 					  <exclude name="needlesearch/**/NeedleSearchData.rdf"/>
  185: 					  <include name="install.js"/>
  186: 					  <include name="needlesearch/locale/cy-GB/**/*.dtd"/>
  187: 					  <include name="needlesearch/locale/cy-GB/**/*.rdf"/>
  188: 					  <include name="needlesearch/locale/cy-GB/**/*.properties"/>
  189:         	</fileset>		
  190:         </zip>
  191:         
  192:         <echo message="Cleaning up..."/>
  193:         <delete file="src/install.js"/>
  194:       </target>
  195: 
  196: 
  197: 	<target name="create-install-it.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/it/needlesearch"));
  204: 		</replacevalue>
  205: 		</replace>
  206: 		
  207: 		<replace file="src/install.js" token="@@message@@" value="Italian language pack"/>
  208: 		
  209: 	</target>
  210: 
  211:     <target name="make-it-xpi" description="Make XPI for Italian Language pack version ${app.version}" depends="label-build,create-install-it.js">
  212: 
  213:         <echo message="Packaging webapp NS-it.xpi"/>
  214:         <zip destfile="bin/NS-it.xpi">
  215: 			<fileset dir="./src">
  216: 					  <exclude name="needlesearch/**/NeedleSearchData.rdf"/>
  217: 					  <include name="install.js"/>
  218: 					  <include name="needlesearch/locale/it/**/*.dtd"/>
  219: 					  <include name="needlesearch/locale/it/**/*.rdf"/>
  220: 					  <include name="needlesearch/locale/it/**/*.properties"/>
  221:         	</fileset>		
  222:         </zip>
  223: 
  224:         <echo message="Cleaning up..."/>
  225:         <delete file="src/install.js"/>
  226: 
  227:       </target>
  228: 
  229:     <target name="make-xpi+rdf" description="Make XPI for version ${app.version}" depends="label-build,create-install-all.js">
  230:         <property file="build-info.${user.name}.properties"/>
  231:         
  232:         <echo message="Packaging webapp ${app.name}-${app.version}-withrdf-(${build-nr}).xpi"/>
  233:         <zip destfile="bin/${app.name}-${app.version}-withrdf-(${build-nr}).xpi">
  234: 			<fileset dir="./src">
  235: 					  <include name="install.js"/>
  236: 					  <include name="needlesearch/**/*.js"/>
  237: 					  <include name="needlesearch/**/*.xul"/>
  238: 					  <include name="needlesearch/**/*.dtd"/>
  239: 					  <include name="needlesearch/**/*.rdf"/>
  240: 					  <include name="needlesearch/**/*.properties"/>
  241: 					  <include name="needlesearch/**/*.gif"/>
  242: 					  <!--include name="needlesearch/**/*.png"/-->
  243:         	</fileset>		
  244:         </zip>
  245:       </target>
  246: 
  247:     <target name="make-deinstaller" description="Make deinstaller for the toolbar">
  248:         <property file="build-info.${user.name}.properties"/>
  249:         
  250:         <echo message="Packaging webapp deinstall-${app.name}.xpi"/>
  251:         <jar destfile="bin/Deinstall-${app.name}.xpi">
  252: 			<fileset dir="./deinstall-src">
  253: 					  <exclude name="needlesearch/**/NeedleSearchData.rdf"/>
  254: 					  <include name="install.js"/>
  255: 					  <include name="needlesearch/**/*.js"/>
  256: 					  <include name="needlesearch/**/*.xul"/>
  257: 					  <include name="needlesearch/**/*.dtd"/>
  258: 					  <include name="needlesearch/**/*.rdf"/>
  259: 					  <include name="needlesearch/**/*.properties"/>
  260: 					  <include name="needlesearch/**/*.gif"/>
  261: 					  <!--include name="needlesearch/**/*.png"/-->
  262:         	</fileset>		
  263:         </jar>
  264:       </target>
  265: 
  266:     <target name="make-example-nsbookmarks" description="Make XPI for version ${app.version}">
  267:         <property file="build-info.${user.name}.properties"/>
  268:         
  269:         <echo message="Packaging example rdf: example-rdf-${app.version}.xpi"/>
  270:         <zip destfile="bin/example-rdf-${app.version}.xpi">
  271: 			<fileset dir="./rest">
  272: 					  <include name="needlesearch/**/NeedleSearchData.rdf"/>
  273: 					  <include name="install.js"/>
  274:         	</fileset>		
  275:         </zip>
  276:       </target>
  277: 
  278: </project>

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