File:  [mozdev] / needlesearch / build.xml
Revision 1.23: download - view: text, annotated - select for diffs - revision graph
Sat Nov 20 16:03:44 2004 UTC (15 years, 7 months ago) by eelco
Branches: MAIN
CVS tags: HEAD
*** empty log 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: 	<target name="deploy" description="Deploy to live environment Mozilla ${deploy.location}" depends="jar">
   38: 	        
   39: 	    <echo message="Copy files from src tree to Mozilla ${deploy.location}"/>
   40: 	    <copy todir="${deploy.location}">
   41: 	        <fileset dir="${src.dir}/chrome/.">
   42: 	          <include name="needlesearch.jar"/>
   43: 	          <include name="NeedleSearchBookmarks.rdf"/>
   44: 	        </fileset>      
   45: 	    </copy>
   46: 	    
   47: 	  </target>
   48: 
   49:     <target name="deploy-to-live" description="Deploy to live environment Mozilla ${deploy.location}" depends="version,jar,deploy,deversion">
   50:         
   51:       </target>
   52:     
   53:     <!--target name="create-install-all.js" description="Creating install.js">
   54:         
   55:         <delete file="${src.dir}/install.js"/>
   56:         <copy file="${src.dir}/install-all.js" tofile="${src.dir}/install.js"/>
   57:         <replace file="${src.dir}/install.js" token="@@version-number@@" value="&quot;${app.version}&quot;"/>
   58:         <replace file="${src.dir}/install.js" token="@@entries@@">
   59:         <replacevalue>          
   60:             registerChrome(CONTENT | DELAYED_CHROME, getFolder(findDir, "content"));
   61:             registerChrome(LOCALE | DELAYED_CHROME, getFolder(findDir, "locale/en-US/needlesearch"));
   62:             registerChrome(LOCALE | DELAYED_CHROME, getFolder(findDir, "locale/de-AT/needlesearch"));
   63:             registerChrome(LOCALE | DELAYED_CHROME, getFolder(findDir, "locale/es-AR/needlesearch"));
   64:             registerChrome(LOCALE | DELAYED_CHROME, getFolder(findDir, "locale/fr/needlesearch"));
   65:             registerChrome(LOCALE | DELAYED_CHROME, getFolder(findDir, "locale/fi/needlesearch"));
   66:             registerChrome(LOCALE | DELAYED_CHROME, getFolder(findDir, "locale/nl/needlesearch"));
   67:             registerChrome(LOCALE | DELAYED_CHROME, getFolder(findDir, "locale/da/needlesearch"));
   68:             registerChrome(LOCALE | DELAYED_CHROME, getFolder(findDir, "locale/cy-GB/needlesearch"));
   69:             registerChrome(LOCALE | DELAYED_CHROME, getFolder(findDir, "locale/it/needlesearch"));
   70:             registerChrome(LOCALE | DELAYED_CHROME, getFolder(findDir, "locale/ru/needlesearch"));
   71:             registerChrome(LOCALE | DELAYED_CHROME, getFolder(findDir, "locale/zh-CN/needlesearch"));
   72:             registerChrome(LOCALE | DELAYED_CHROME, getFolder(findDir, "locale/se/needlesearch"));
   73:         </replacevalue>
   74:         </replace>
   75:         
   76:         <replace file="${src.dir}/install.js" token="//@@profileentries@@">
   77:         <replacevalue>          
   78:             //Now install the profile folder
   79:             setPackageFolder(findDir);
   80:             var err = addDirectory("needlesearch");
   81:                 if ( err == SUCCESS ) { 
   82:                     registerChrome(CONTENT | PROFILE_CHROME, getFolder(findDir, &quot;profile&quot;));
   83:                     err = performInstall();
   84:                     if ( err != SUCCESS ) {
   85:                         alert("performInstall() bailed");
   86:                     }
   87:                 } else { 
   88:                     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");
   89:                 }
   90:         </replacevalue>
   91:         </replace>
   92:         
   93:         <replace file="${src.dir}/install.js" token="@@message@@" value="NeedleSearch Toolbar"/>
   94:     </target-->
   95:     
   96:     <target name="version" description="Replacing all version numbers">
   97:     	<replace file="${src.dir}/install.js" token="@@version-number@@" value="${app.version}"/>
   98:         <replace file="${src.dir}/install.rdf" token="@@version-number@@" value="${app.version}"/>
   99:         <replace file="${src.dir}/needlesearch/content/needlesearch/settings.xul" token="@@version-number@@" value="${app.version}"/>
  100:         <replace file="${src.dir}/needlesearch/content/needlesearch/settingsDialog.xul" token="@@version-number@@" value="${app.version}"/>
  101:         <replace file="${src.dir}/needlesearch/content/needlesearch/settingsOverlay.xul" token="@@version-number@@" value="${app.version}"/>
  102:         
  103:     </target>
  104:     
  105:     <target name="deversion" description="Replacing all version numbers for replacevalue">
  106:     	<replace file="${src.dir}/install.js" value="@@version-number@@" token="${app.version}"/>
  107:     	<replace file="${src.dir}/install.rdf" value="@@version-number@@" token="${app.version}"/>
  108:         <replace file="${src.dir}/needlesearch/content/needlesearch/settings.xul" token="${app.version}" value="@@version-number@@"/>
  109:         <replace file="${src.dir}/needlesearch/content/needlesearch/settingsDialog.xul" token="${app.version}" value="@@version-number@@"/>
  110:         <replace file="${src.dir}/needlesearch/content/needlesearch/settingsOverlay.xul" token="${app.version}" value="@@version-number@@"/>
  111:         
  112:     </target>
  113:     
  114:    	<target name="create-dirs" description="Creating chrome dir">
  115: 		<mkdir dir="./src/chrome"/>
  116:    		<mkdir dir="./bin"/>
  117: 	</target>
  118:     
  119:     <target name="jar" description="Make jar file" depends="create-dirs">
  120: 		<jar destfile="src/chrome/needlesearch.jar">
  121: 			<fileset dir="./src/needlesearch">
  122: 					  <include name="**/*.js"/>
  123: 					  <include name="**/*.xul"/>
  124: 					  <include name="**/*.dtd"/>
  125: 					  <include name="**/*.rdf"/>
  126: 					  <include name="**/*.properties"/>
  127: 					  <include name="**/*.gif"/>
  128: 					  <include name="**/*.png"/>
  129: 					  <include name="**/*.css"/>					  
  130:         	</fileset>		
  131:         </jar>
  132: 	</target>
  133:     
  134:     <target name="make-target" description="Make XPI for version ${app.version}">
  135:         <property file="build-info.${user.name}.properties"/>
  136:         
  137:         <!--echo message="copy install.js"/>
  138:         <copy file="src/install-all.js" tofile="src/install.js"/-->
  139: 
  140:         <echo message="Packaging webapp ${app.name}-${app.version}-(${build-nr}).xpi"/>
  141:         <zip destfile="bin/${app.name}-${app.version}-(${build-nr}).xpi">
  142: 			<fileset dir="./src">
  143: 					<include name="install.*"/>
  144: 					<include name="chrome/needlesearch.jar"/>
  145: 					<include name="chrome/NeedleSearchBookmarks.rdf"/>
  146:         	</fileset>		
  147:         </zip>
  148: 
  149:         <echo message="Cleaning up..."/>
  150:         <!--delete file="${src.dir}/install.js"/-->
  151: 
  152:     </target>
  153:     
  154:     
  155:     <target name="make-xpi" 
  156:             description="Make XPI for version ${app.version}" 
  157:             depends="label-build,version,jar,make-target,deversion"/>
  158: 
  159:     <!--target name="make-deinstaller" description="Make deinstaller for the toolbar">
  160:         <property file="build-info.${user.name}.properties"/>
  161:         
  162:         <echo message="Packaging webapp deinstall-${app.name}.xpi"/>
  163:         <jar destfile="bin/deinstall-${app.name}.xpi">
  164:             <fileset dir="./deinstall-src">
  165:                       <exclude name="needlesearch/**/NeedleSearchData.rdf"/>
  166:                       <include name="install.js"/>
  167:                       <include name="needlesearch/**/*.js"/>
  168:                       <include name="needlesearch/**/*.xul"/>
  169:                       <include name="needlesearch/**/*.dtd"/>
  170:                       <include name="needlesearch/**/*.rdf"/>
  171:                       <include name="needlesearch/**/*.properties"/>
  172:                       <include name="needlesearch/**/*.gif"/>
  173:                      
  174:             </fileset>      
  175:         </jar>
  176:       </target-->
  177: 	
  178: 	<!--target name="jar-icons-default">
  179: 		
  180: 		<jar destfile="./src/chrome/needlesearch-skin.jar">
  181:     		<fileset dir="./icon/default/">
  182:     			<include name="install.rdf"/>
  183:                 <include name="content/**/*.gif"/>
  184:                 <include name="content/**/*.png"/>
  185:     			<include name="content/**/*.css"/>
  186:             </fileset>      
  187:         </jar>  
  188: 		
  189: 		<replace file="./icon/default/install.rdf" token="@@version-number@@" value="${app.version}"/>
  190: 		
  191: 		<copy file="./icon/default/install.rdf" tofile="./src/chrome/install.rdf"/>
  192: 		
  193: 		<jar destfile="./bin/NeedleSearch-default-skin.xpi">
  194:     		<fileset dir="./src/chrome/">
  195:     			<include name="install.rdf"/>
  196:                 <include name="needlesearch-skin.jar"/>
  197:             </fileset>      
  198:         </jar>
  199: 	</target-->
  200: 	
  201:     <!--target name="make-iconpacks" description="Make iconpacks">
  202:         
  203:         <echo message="Packaging default iconpack"/>
  204:         <delete file="./icon/install.js"/>
  205:         <copy file="./icon/install-icons.js" tofile="./icon/install.js"/>
  206:         <replace file="./icon/install.js" token="@@dirname@@" value="default"/>
  207:         <zip destfile="bin/ns-icons-default.xpi">
  208:             <fileset dir="./icon">
  209:                       <include name="default/*.gif"/>
  210:                       <include name="install.js"/>
  211:             </fileset>      
  212:         </zip>
  213: 
  214:         <echo message="Packaging modern iconpack"/>
  215:         <delete file="./icon/install.js"/>
  216:         <copy file="./icon/install-icons.js" tofile="./icon/install.js"/>
  217:         <replace file="./icon/install.js" token="@@dirname@@" value="modern"/>
  218:         <zip destfile="bin/ns-icons-modern.xpi">
  219:             <fileset dir="./icon">
  220:                       <include name="modern/*.gif"/>
  221:                       <include name="install.js"/>
  222:             </fileset>      
  223:         </zip>
  224:         
  225:         <echo message="Packaging monochrome iconpack"/>
  226:         <delete file="./icon/install.js"/>
  227:         <copy file="./icon/install-icons.js" tofile="./icon/install.js"/>
  228:         <replace file="./icon/install.js" token="@@dirname@@" value="monochrome"/>
  229:         <zip destfile="bin/ns-icons-monochrome.xpi">
  230:             <fileset dir="./icon">
  231:                       <include name="monochrome/*.gif"/>
  232:                       <include name="install.js"/>
  233:             </fileset>      
  234:         </zip>
  235:         
  236:       </target-->
  237: 		
  238: </project>

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