File:  [mozdev] / needlesearch / build.xml
Revision 1.25: download - view: text, annotated - select for diffs - revision graph
Fri Sep 16 19:32:51 2005 UTC (14 years, 2 months ago) by eelco
Branches: MAIN
CVS tags: HEAD
*** empty log message ***

<project name="NeedleSearch Toolbar" default="make-xpi" basedir=".">

      <property file="build.properties"/>
      
      <property name="app.name" value="NeedleSearch"/>

  <!-- Main Targets -->

    <!-- Label the build -->
      <target name="label-build" description="Label the build">

        <propertyfile
            file="build-info.${user.name}.properties"
            comment="Build information" >
          <entry  key="developer" value="${user.name}" />
          <entry  key="date" type="date" value="now"/>
          <entry  key="build-nr" type="int" default="0" operation="+"/>
        </propertyfile>

        <propertyfile
            file="developer.properties"
            comment="Build information" >
          <entry  key="developer" value="${user.name}" />
        </propertyfile>

        <loadfile property="build-info-string" srcFile="build-info.${user.name}.properties">
          <filterchain>
            <striplinebreaks/>
          </filterchain>
        </loadfile>

        <!-- add to the build history -->
        <concat append="yes" destfile="build-history.${user.name}.txt" >${build-info-string}</concat>

      </target>

        <target name="make-xpi" 
                description="Make XPI for version ${app.version}" 
                depends="label-build,version,jar,make-target,deversion"/>

	<target name="make-xpi-atacama" 
	            description="Make XPI for version ${app.version}" 
	            depends="label-build,version,copy-atacama-images,jar,make-target-atacama,deversion"/>

	<target name="make-xpi-modern" 
    	            description="Make XPI for version ${app.version}" 
    	            depends="label-build,version,copy-modern-images,jar,make-target-modern,deversion"/>

		<target name="make-xpi-monochromatic" 
	    	            description="Make XPI for version ${app.version}" 
	    	            depends="label-build,version,copy-monochromatic-images,jar,make-target-monochromatic,deversion"/>
    
		<target name="make-xpi-aqua" 
    	            description="Make XPI for version ${app.version}" 
    	            depends="label-build,version,copy-aqua-images,jar,make-target-aqua,deversion"/>

		<target name="deploy" description="Deploy to live environment Mozilla ${deploy.location}" depends="jar">
	        
	    <echo message="Copy files from src tree to Mozilla ${deploy.location}"/>
	    <copy todir="${deploy.location}">
	        <fileset dir="${src.dir}/chrome/.">
	          <include name="needlesearch.jar"/>
	          <include name="NeedleSearchBookmarks.rdf"/>
	        </fileset>      
	    </copy>
	    
	  </target>

    <target name="deploy-to-live" description="Deploy to live environment Mozilla ${deploy.location}" depends="version,jar,deploy,deversion">
        
      </target>
    
	
	<!-- Sub Actions. These are used in the main targets above -->
	
    <target name="version" description="Replacing all version numbers">
    	<replace file="${src.dir}/install.js" token="@@version-number@@" value="${app.version}"/>
        <replace file="${src.dir}/install.rdf" token="@@version-number@@" value="${app.version}"/>
        <replace file="${src.dir}/needlesearch/content/needlesearch/settings.xul" token="@@version-number@@" value="${app.version}"/>
        <replace file="${src.dir}/needlesearch/content/needlesearch/settingsDialog.xul" token="@@version-number@@" value="${app.version}"/>
        <replace file="${src.dir}/needlesearch/content/needlesearch/settingsOverlay.xul" token="@@version-number@@" value="${app.version}"/>
        
    </target>
    
    <target name="deversion" description="Replacing all version numbers for replacevalue">
    	<replace file="${src.dir}/install.js" value="@@version-number@@" token="${app.version}"/>
    	<replace file="${src.dir}/install.rdf" value="@@version-number@@" token="${app.version}"/>
        <replace file="${src.dir}/needlesearch/content/needlesearch/settings.xul" token="${app.version}" value="@@version-number@@"/>
        <replace file="${src.dir}/needlesearch/content/needlesearch/settingsDialog.xul" token="${app.version}" value="@@version-number@@"/>
        <replace file="${src.dir}/needlesearch/content/needlesearch/settingsOverlay.xul" token="${app.version}" value="@@version-number@@"/>
        
    </target>
    
   	<target name="create-dirs" description="Creating chrome dir">
		<mkdir dir="./src/chrome"/>
   		<mkdir dir="./bin"/>
	</target>
    
    <target name="jar" description="Make jar file" depends="create-dirs">
		<jar destfile="src/chrome/needlesearch.jar">
			<fileset dir="./src/needlesearch">
					  <include name="**/*.js"/>
					  <include name="**/*.xul"/>
					  <include name="**/*.dtd"/>
					  <include name="**/*.rdf"/>
					  <include name="**/*.properties"/>
					  <include name="**/*.gif"/>
					  <include name="**/*.png"/>
					  <include name="**/*.css"/>					  
        	</fileset>		
        </jar>
	</target>
    
    <target name="make-target" description="Make XPI for version ${app.version}">
        <property file="build-info.${user.name}.properties"/>
        
        <!--echo message="copy install.js"/>
        <copy file="src/install-all.js" tofile="src/install.js"/-->

        <echo message="Packaging webapp ${app.name}-${app.version}-(${build-nr}).xpi"/>
        <zip destfile="bin/${app.name}-${app.version}-(${build-nr}).xpi">
			<fileset dir="./src">
					<include name="install.*"/>
					<include name="chrome/needlesearch.jar"/>
					<exclude name="chrome/NeedleSearchBookmarks.rdf"/>
        	</fileset>		
        </zip>

        <echo message="Cleaning up..."/>
        <!--delete file="${src.dir}/install.js"/-->

    </target>
    
    <target name="make-target-aqua" description="Make XPI for version ${app.version}">
        <property file="build-info.${user.name}.properties"/>

        <echo message="Packaging webapp ${app.name}-current.xpi"/>
        <zip destfile="downloads/${app.name}-current-aqua.xpi">
			<fileset dir="./src">
					<include name="install.*"/>
					<include name="chrome/needlesearch.jar"/>
					<exclude name="chrome/NeedleSearchBookmarks.rdf"/>
        	</fileset>		
        </zip>

    </target>
	
    <target name="make-target-modern" description="Make XPI for version ${app.version}">
        <property file="build-info.${user.name}.properties"/>
        
        <!--echo message="copy install.js"/>
        <copy file="src/install-all.js" tofile="src/install.js"/-->

        <echo message="Packaging webapp ${app.name}-current-modern.xpi"/>
        <zip destfile="downloads/${app.name}-current-modern.xpi">
			<fileset dir="./src">
					<include name="install.*"/>
					<include name="chrome/needlesearch.jar"/>
					<exclude name="chrome/NeedleSearchBookmarks.rdf"/>
        	</fileset>		
        </zip>

        <echo message="Cleaning up..."/>
        <!--delete file="${src.dir}/install.js"/-->

    </target>
	
    <target name="make-target-monochromatic" description="Make Milestone XPI for version ${app.version} with monochromatic icons">
        <property file="build-info.${user.name}.properties"/>
        
        <!--echo message="copy install.js"/>
        <copy file="src/install-all.js" tofile="src/install.js"/-->

        <echo message="Packaging webapp ${app.name}-current-monochromatic.xpi"/>
        <zip destfile="downloads/${app.name}-current-monochromatic.xpi">
			<fileset dir="./src">
					<include name="install.*"/>
					<include name="chrome/needlesearch.jar"/>
					<exclude name="chrome/NeedleSearchBookmarks.rdf"/>
        	</fileset>		
        </zip>

        <echo message="Cleaning up..."/>
        <!--delete file="${src.dir}/install.js"/-->

    </target>
	
    <target name="make-target-atacama" description="Make Milestone XPI for version ${app.version} with atacama icons">
        <property file="build-info.${user.name}.properties"/>
        
        <echo message="Packaging webapp ${app.name}-current.xpi"/>
        <zip destfile="downloads/${app.name}-current.xpi">
			<fileset dir="./src">
					<include name="install.*"/>
					<include name="chrome/needlesearch.jar"/>
					<exclude name="chrome/NeedleSearchBookmarks.rdf"/>
        	</fileset>		
        </zip>

        <echo message="Cleaning up..."/>

    </target>
	
	
	
    <target name="copy-modern-images" 
            description="Copy modern images" depends="scrape-image-dir">

    	<echo message="Packaging modern iconpack"/>
        
    	<copy todir="./src/needlesearch/content/needlesearch/img" overwrite="yes">
    	    <fileset dir="./icon/modern">
    	      <exclude name="**/*.zip"/>
    	      <exclude name="**/*.txt"/>
    	    </fileset>
		</copy>

                
      </target>

    <target name="copy-monochromatic-images" 
           description="Copy monochromatic images" depends="scrape-image-dir">

    	<echo message="Packaging monochromatic iconpack"/>
        
    	<copy todir="./src/needlesearch/content/needlesearch/img" overwrite="yes">
    	    <fileset dir="./icon/monochromatic">
    	      <exclude name="**/*.zip"/>
    	      <exclude name="**/*.txt"/>
    	    </fileset>
		</copy>

                
      </target>	

	<target name="copy-aqua-images" 
           description="Copy aqua images" depends="scrape-image-dir">

    	<echo message="Packaging aqua iconpack"/>
        
    	<copy todir="./src/needlesearch/content/needlesearch/img" overwrite="yes">
    	    <fileset dir="./icon/aqua">
    	      <exclude name="**/*.zip"/>
    	      <exclude name="**/*.txt"/>
    	    </fileset>
		</copy>

                
      </target>	
	
	<target name="scrape-image-dir" description="remove all images from image directory">
		<delete>
		    <fileset dir="./src/needlesearch/content/needlesearch/img" includes="*.*"/>
		  </delete>
	</target>
	
	<target name="copy-atacama-images" 
           description="Copy atacama images" depends="scrape-image-dir">

    	<echo message="Packaging Atacama iconpack"/>
        
    	<copy todir="./src/needlesearch/content/needlesearch/img" overwrite="yes">
    	    <fileset dir="./icon/atacama">
    	      <exclude name="**/*.zip"/>
    	      <exclude name="**/*.txt"/>
    	    </fileset>
		</copy>

                
      </target>	

	
	
</project>

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