File:  [mozdev] / needlesearch / build.xml
Revision 1.24: download - view: text, annotated - select for diffs - revision graph
Fri Feb 25 22:00:52 2005 UTC (15 years, 4 months ago) by eelco
Branches: MAIN
CVS tags: HEAD
2.7

    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:   <!-- Main Targets -->
    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="make-xpi" 
   38:                 description="Make XPI for version ${app.version}" 
   39:                 depends="label-build,version,jar,make-target,deversion"/>
   40: 
   41:     	<target name="make-xpi-modern" 
   42:     	            description="Make XPI for version ${app.version}" 
   43:     	            depends="label-build,version,copy-modern-images,jar,make-target-modern,deversion"/>
   44: 
   45: 		<target name="make-xpi-monochromatic" 
   46: 	    	            description="Make XPI for version ${app.version}" 
   47: 	    	            depends="label-build,version,copy-monochromatic-images,jar,make-target-monochromatic,deversion"/>
   48:     
   49: 		<target name="make-xpi-default" 
   50:     	            description="Make XPI for version ${app.version}" 
   51:     	            depends="label-build,version,copy-default-images,jar,make-target-current,deversion"/>
   52: 
   53: 		<target name="make-xpi-milestone" 
   54:                 description="Make XPI's for version ${app.version}" 
   55:                 depends="make-xpi-default,make-xpi-modern,make-xpi-monochromatic"/>
   56: 
   57: 	
   58: 		<target name="deploy" description="Deploy to live environment Mozilla ${deploy.location}" depends="jar">
   59: 	        
   60: 	    <echo message="Copy files from src tree to Mozilla ${deploy.location}"/>
   61: 	    <copy todir="${deploy.location}">
   62: 	        <fileset dir="${src.dir}/chrome/.">
   63: 	          <include name="needlesearch.jar"/>
   64: 	          <include name="NeedleSearchBookmarks.rdf"/>
   65: 	        </fileset>      
   66: 	    </copy>
   67: 	    
   68: 	  </target>
   69: 
   70:     <target name="deploy-to-live" description="Deploy to live environment Mozilla ${deploy.location}" depends="version,jar,deploy,deversion">
   71:         
   72:       </target>
   73:     
   74: 	
   75: 	<!-- Sub Actions. These are used in the main targets above -->
   76: 	
   77:     <target name="version" description="Replacing all version numbers">
   78:     	<replace file="${src.dir}/install.js" token="@@version-number@@" value="${app.version}"/>
   79:         <replace file="${src.dir}/install.rdf" token="@@version-number@@" value="${app.version}"/>
   80:         <replace file="${src.dir}/needlesearch/content/needlesearch/settings.xul" token="@@version-number@@" value="${app.version}"/>
   81:         <replace file="${src.dir}/needlesearch/content/needlesearch/settingsDialog.xul" token="@@version-number@@" value="${app.version}"/>
   82:         <replace file="${src.dir}/needlesearch/content/needlesearch/settingsOverlay.xul" token="@@version-number@@" value="${app.version}"/>
   83:         
   84:     </target>
   85:     
   86:     <target name="deversion" description="Replacing all version numbers for replacevalue">
   87:     	<replace file="${src.dir}/install.js" value="@@version-number@@" token="${app.version}"/>
   88:     	<replace file="${src.dir}/install.rdf" value="@@version-number@@" token="${app.version}"/>
   89:         <replace file="${src.dir}/needlesearch/content/needlesearch/settings.xul" token="${app.version}" value="@@version-number@@"/>
   90:         <replace file="${src.dir}/needlesearch/content/needlesearch/settingsDialog.xul" token="${app.version}" value="@@version-number@@"/>
   91:         <replace file="${src.dir}/needlesearch/content/needlesearch/settingsOverlay.xul" token="${app.version}" value="@@version-number@@"/>
   92:         
   93:     </target>
   94:     
   95:    	<target name="create-dirs" description="Creating chrome dir">
   96: 		<mkdir dir="./src/chrome"/>
   97:    		<mkdir dir="./bin"/>
   98: 	</target>
   99:     
  100:     <target name="jar" description="Make jar file" depends="create-dirs">
  101: 		<jar destfile="src/chrome/needlesearch.jar">
  102: 			<fileset dir="./src/needlesearch">
  103: 					  <include name="**/*.js"/>
  104: 					  <include name="**/*.xul"/>
  105: 					  <include name="**/*.dtd"/>
  106: 					  <include name="**/*.rdf"/>
  107: 					  <include name="**/*.properties"/>
  108: 					  <include name="**/*.gif"/>
  109: 					  <include name="**/*.png"/>
  110: 					  <include name="**/*.css"/>					  
  111:         	</fileset>		
  112:         </jar>
  113: 	</target>
  114:     
  115:     <target name="make-target" description="Make XPI for version ${app.version}">
  116:         <property file="build-info.${user.name}.properties"/>
  117:         
  118:         <!--echo message="copy install.js"/>
  119:         <copy file="src/install-all.js" tofile="src/install.js"/-->
  120: 
  121:         <echo message="Packaging webapp ${app.name}-${app.version}-(${build-nr}).xpi"/>
  122:         <zip destfile="bin/${app.name}-${app.version}-(${build-nr}).xpi">
  123: 			<fileset dir="./src">
  124: 					<include name="install.*"/>
  125: 					<include name="chrome/needlesearch.jar"/>
  126: 					<exclude name="chrome/NeedleSearchBookmarks.rdf"/>
  127:         	</fileset>		
  128:         </zip>
  129: 
  130:         <echo message="Cleaning up..."/>
  131:         <!--delete file="${src.dir}/install.js"/-->
  132: 
  133:     </target>
  134:     
  135:     <target name="make-target-current" description="Make XPI for version ${app.version}">
  136:         <property file="build-info.${user.name}.properties"/>
  137:         
  138:         <!--echo message="copy install.js"/>
  139:         <copy file="src/install-all.js" tofile="src/install.js"/-->
  140: 
  141:         <echo message="Packaging webapp ${app.name}-current.xpi"/>
  142:         <zip destfile="downloads/${app.name}-current.xpi">
  143: 			<fileset dir="./src">
  144: 					<include name="install.*"/>
  145: 					<include name="chrome/needlesearch.jar"/>
  146: 					<exclude name="chrome/NeedleSearchBookmarks.rdf"/>
  147:         	</fileset>		
  148:         </zip>
  149: 
  150:         <echo message="Cleaning up..."/>
  151:         <!--delete file="${src.dir}/install.js"/-->
  152: 
  153:     </target>
  154: 	
  155:     <target name="make-target-modern" description="Make XPI for version ${app.version}">
  156:         <property file="build-info.${user.name}.properties"/>
  157:         
  158:         <!--echo message="copy install.js"/>
  159:         <copy file="src/install-all.js" tofile="src/install.js"/-->
  160: 
  161:         <echo message="Packaging webapp ${app.name}-current-modern.xpi"/>
  162:         <zip destfile="downloads/${app.name}-current-modern.xpi">
  163: 			<fileset dir="./src">
  164: 					<include name="install.*"/>
  165: 					<include name="chrome/needlesearch.jar"/>
  166: 					<exclude name="chrome/NeedleSearchBookmarks.rdf"/>
  167:         	</fileset>		
  168:         </zip>
  169: 
  170:         <echo message="Cleaning up..."/>
  171:         <!--delete file="${src.dir}/install.js"/-->
  172: 
  173:     </target>
  174: 	
  175:     <target name="make-target-monochromatic" description="Make Milestone XPI for version ${app.version} with monochromatic icons">
  176:         <property file="build-info.${user.name}.properties"/>
  177:         
  178:         <!--echo message="copy install.js"/>
  179:         <copy file="src/install-all.js" tofile="src/install.js"/-->
  180: 
  181:         <echo message="Packaging webapp ${app.name}-current-monochromatic.xpi"/>
  182:         <zip destfile="downloads/${app.name}-current-monochromatic.xpi">
  183: 			<fileset dir="./src">
  184: 					<include name="install.*"/>
  185: 					<include name="chrome/needlesearch.jar"/>
  186: 					<exclude name="chrome/NeedleSearchBookmarks.rdf"/>
  187:         	</fileset>		
  188:         </zip>
  189: 
  190:         <echo message="Cleaning up..."/>
  191:         <!--delete file="${src.dir}/install.js"/-->
  192: 
  193:     </target>
  194: 	
  195:     <target name="copy-modern-images" 
  196:             description="Copy modern images">
  197: 
  198:     	<echo message="Packaging modern iconpack"/>
  199:         
  200:     	<copy todir="./src/needlesearch/content/needlesearch/img" overwrite="yes">
  201:     	    <fileset dir="./icon/modern">
  202:     	      <exclude name="**/*.zip"/>
  203:     	      <exclude name="**/*.txt"/>
  204:     	    </fileset>
  205: 		</copy>
  206: 
  207:                 
  208:       </target>
  209: 
  210:     <target name="copy-monochromatic-images" 
  211:            description="Copy monochromatic images">
  212: 
  213:     	<echo message="Packaging monochromatic iconpack"/>
  214:         
  215:     	<copy todir="./src/needlesearch/content/needlesearch/img" overwrite="yes">
  216:     	    <fileset dir="./icon/monochromatic">
  217:     	      <exclude name="**/*.zip"/>
  218:     	      <exclude name="**/*.txt"/>
  219:     	    </fileset>
  220: 		</copy>
  221: 
  222:                 
  223:       </target>	
  224: 
  225: 	<target name="copy-default-images" 
  226:            description="Copy default images">
  227: 
  228:     	<echo message="Packaging default iconpack"/>
  229:         
  230:     	<copy todir="./src/needlesearch/content/needlesearch/img" overwrite="yes">
  231:     	    <fileset dir="./icon/default">
  232:     	      <exclude name="**/*.zip"/>
  233:     	      <exclude name="**/*.txt"/>
  234:     	    </fileset>
  235: 		</copy>
  236: 
  237:                 
  238:       </target>	
  239: </project>

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