File:  [mozdev] / needlesearch / build.xml
Revision 1.11: download - view: text, annotated - select for diffs - revision graph
Wed Jul 16 11:01:01 2003 UTC (16 years, 10 months ago) by eelco
Branches: MAIN
CVS tags: HEAD
no message

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

      <property file="build.${user.name}.properties"/>
      
      <property name="app.name" value="NeedleSearch"/>

  <!-- Actions -->

    <!-- 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="copy-from-live" description="Copies files from the test environment to src tree">
        <echo message="Copy files from ..\..\browsers\mozilla${test.browser.version}\chrome\ "/>
        <copy todir="src/.">
        	<fileset dir="F:\\Program Files\\mozilla.org\\Mozilla\\chrome">
        	  <exclude name="needlesearch/**/NeedleSearchData.rdf"/>
        	  <include name="needlesearch/**/*.js"/>
        	  <include name="needlesearch/**/*.xul"/>
        	  <include name="needlesearch/**/*.dtd"/>
        	  <include name="needlesearch/**/*.rdf"/>
        	  <include name="needlesearch/**/*.properties"/>
        	  <include name="needlesearch/**/*.gif"/>
			  <!--include name="needlesearch/**/*.png"/-->
        	</fileset>		
        </copy>
    </target>
    
    <target name="deploy-to-live" description="Deploy to live environment Mozilla ${test.browser.version}">
        
        <echo message="Copy files from src tree to Mozilla ${test.browser.version}"/>
        <copy todir="..\browsers\mozilla${test.browser.version}\chrome\">
        	<fileset dir="src/.">
        	  <exclude name="needlesearch/**/NeedleSearchData.rdf"/>
        	  <include name="needlesearch/**/*.js"/>
        	  <include name="needlesearch/**/*.xul"/>
        	  <include name="needlesearch/**/*.dtd"/>
        	  <include name="needlesearch/**/*.rdf"/>
        	  <include name="needlesearch/**/*.properties"/>
        	  <include name="needlesearch/**/*.gif"/>
			  <!--include name="needlesearch/**/*.png"/-->
        	</fileset>		
        </copy>
        
      </target>
	
	<target name="create-install-all.js" description="Creating install.js">
		
		<delete file="src/install.js"/>
		<copy file="src/install-all.js" tofile="src/install.js"/>
		<replace file="src/install.js" token="@@version-number@@" value="&quot;${app.version}&quot;"/>
		<replace file="src/install.js" token="@@entries@@">
		<replacevalue>			
		    registerChrome(CONTENT | DELAYED_CHROME, getFolder(findDir, &quot;profile&quot;));
			registerChrome(CONTENT | DELAYED_CHROME, getFolder(findDir, &quot;content&quot;));
    		registerChrome(LOCALE | DELAYED_CHROME, getFolder(findDir, &quot;locale&quot;));
		</replacevalue>
		</replace>
		
		<replace file="src/install.js" token="//@@profileentries@@">
		<replacevalue>			
			//Now install the profile folder
			setPackageFolder(findDir);
			var err = addDirectory("needlesearch");
				if ( err == SUCCESS ) { 
				    registerChrome(CONTENT | PROFILE_CHROME, getFolder(findDir, &quot;profile&quot;));
					err = performInstall();
					if ( err != SUCCESS ) {
				    	alert("performInstall() bailed");
					}
				} else { 
					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");
				}
		</replacevalue>
		</replace>
		
		<replace file="src/install.js" token="@@message@@" value="NeedleSearch Toolbar"/>
	</target>
	
    <target name="make-xpi" description="Make XPI for version ${app.version}" depends="label-build,create-install-all.js">
        <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}-nordf-(${build-nr}).xpi"/>
        <zip destfile="bin/${app.name}-${app.version}-nordf-(${build-nr}).xpi">
			<fileset dir="./src">
					  <exclude name="needlesearch/**/NeedleSearchData.rdf"/>
					  <include name="install.js"/>
					  <include name="needlesearch/**/*.js"/>
					  <include name="needlesearch/**/*.xul"/>
					  <include name="needlesearch/**/*.dtd"/>
					  <include name="needlesearch/**/*.rdf"/>
					  <include name="needlesearch/**/*.properties"/>
					  <include name="needlesearch/**/*.gif"/>
					  <!--include name="needlesearch/**/*.png"/-->
        	</fileset>		
        </zip>

        <echo message="Cleaning up..."/>
        <delete file="src/install.js"/>

      </target>

	<target name="create-install-da.js" description="Creating install.js">
		
		<delete file="src/install.js"/>
		<copy file="src/install-all.js" tofile="src/install.js"/>
		<replace file="src/install.js" token="@@version-number@@" value="&quot;${app.version}&quot;"/>
		<replace file="src/install.js" token="@@entries@@">
		<replacevalue>			registerChrome(LOCALE | DELAYED_CHROME, getFolder(findDir, "locale/da/needlesearch"));
		</replacevalue>
		</replace>
		
		<replace file="src/install.js" token="@@message@@" value="Danish language pack"/>
		
	</target>


    <target name="make-da-xpi" description="Make XPI for Danish Language pack version ${app.version}" depends="label-build,create-install-da.js">

        <echo message="Packaging webapp NS-da.xpi"/>
        <zip destfile="bin/NS-da.xpi">
			<fileset dir="./src">
					  <exclude name="needlesearch/**/NeedleSearchData.rdf"/>
					  <include name="install.js"/>
					  <include name="needlesearch/locale/da/**/*.dtd"/>
					  <include name="needlesearch/locale/da/**/*.rdf"/>
					  <include name="needlesearch/locale/da/**/*.properties"/>
        	</fileset>		
        </zip>

        <echo message="Cleaning up..."/>
        <delete file="src/install.js"/>

      </target>


	<target name="create-install-zh-CN.js" description="Creating install.js">
		
		<delete file="src/install.js"/>
		<copy file="src/install-all.js" tofile="src/install.js"/>
		<replace file="src/install.js" token="@@version-number@@" value="&quot;${app.version}&quot;"/>
		<replace file="src/install.js" token="@@entries@@">
		<replacevalue>			registerChrome(LOCALE | DELAYED_CHROME, getFolder(findDir, "locale/zh-CN/needlesearch"));
		</replacevalue>
		</replace>
		
		<replace file="src/install.js" token="@@message@@" value="simplified Chinese language pack"/>
		
	</target>
	
    <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">

        <echo message="Packaging webapp NS-zh-CN.xpi"/>
        <zip destfile="bin/NS-zh-CN.xpi">
			<fileset dir="./src">
					  <exclude name="needlesearch/**/NeedleSearchData.rdf"/>
					  <include name="install.js"/>
					  <include name="needlesearch/locale/zh-CN/**/*.dtd"/>
					  <include name="needlesearch/locale/zh-CN/**/*.rdf"/>
					  <include name="needlesearch/locale/zh-CN/**/*.properties"/>
        	</fileset>		
        </zip>

        <echo message="Cleaning up..."/>
        <delete file="src/install.js"/>

      </target>

	<target name="create-install-cy-GB.js" description="Creating install.js">
		
		<delete file="src/install.js"/>
		<copy file="src/install-all.js" tofile="src/install.js"/>
		<replace file="src/install.js" token="@@version-number@@" value="&quot;${app.version}&quot;"/>
		<replace file="src/install.js" token="@@entries@@">
		<replacevalue>			registerChrome(LOCALE | DELAYED_CHROME, getFolder(findDir, "locale/cy-GB/needlesearch"));
		</replacevalue>
		</replace>
		
		<replace file="src/install.js" token="@@message@@" value="Cymraeg/Welsh language pack"/>
		
	</target>


    <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">
        
        <echo message="Packaging webapp NS-cy-GB.xpi"/>
        <zip destfile="bin/NS-cy-GB.xpi">
			<fileset dir="./src">
					  <exclude name="needlesearch/**/NeedleSearchData.rdf"/>
					  <include name="install.js"/>
					  <include name="needlesearch/locale/cy-GB/**/*.dtd"/>
					  <include name="needlesearch/locale/cy-GB/**/*.rdf"/>
					  <include name="needlesearch/locale/cy-GB/**/*.properties"/>
        	</fileset>		
        </zip>
        
        <echo message="Cleaning up..."/>
        <delete file="src/install.js"/>
      </target>


	<target name="create-install-it.js" description="Creating install.js">
		
		<delete file="src/install.js"/>
		<copy file="src/install-all.js" tofile="src/install.js"/>
		<replace file="src/install.js" token="@@version-number@@" value="&quot;${app.version}&quot;"/>
		<replace file="src/install.js" token="@@entries@@">
		<replacevalue>			registerChrome(LOCALE | DELAYED_CHROME, getFolder(findDir, "locale/it/needlesearch"));
		</replacevalue>
		</replace>
		
		<replace file="src/install.js" token="@@message@@" value="Italian language pack"/>
		
	</target>

    <target name="make-it-xpi" description="Make XPI for Italian Language pack version ${app.version}" depends="label-build,create-install-it.js">

        <echo message="Packaging webapp NS-it.xpi"/>
        <zip destfile="bin/NS-it.xpi">
			<fileset dir="./src">
					  <exclude name="needlesearch/**/NeedleSearchData.rdf"/>
					  <include name="install.js"/>
					  <include name="needlesearch/locale/it/**/*.dtd"/>
					  <include name="needlesearch/locale/it/**/*.rdf"/>
					  <include name="needlesearch/locale/it/**/*.properties"/>
        	</fileset>		
        </zip>

        <echo message="Cleaning up..."/>
        <delete file="src/install.js"/>

      </target>

    <target name="make-xpi+rdf" description="Make XPI for version ${app.version}" depends="label-build,create-install-all.js">
        <property file="build-info.${user.name}.properties"/>
        
        <echo message="Packaging webapp ${app.name}-${app.version}-withrdf-(${build-nr}).xpi"/>
        <zip destfile="bin/${app.name}-${app.version}-withrdf-(${build-nr}).xpi">
			<fileset dir="./src">
					  <include name="install.js"/>
					  <include name="needlesearch/**/*.js"/>
					  <include name="needlesearch/**/*.xul"/>
					  <include name="needlesearch/**/*.dtd"/>
					  <include name="needlesearch/**/*.rdf"/>
					  <include name="needlesearch/**/*.properties"/>
					  <include name="needlesearch/**/*.gif"/>
					  <!--include name="needlesearch/**/*.png"/-->
        	</fileset>		
        </zip>
      </target>

    <target name="make-deinstaller" description="Make deinstaller for the toolbar">
        <property file="build-info.${user.name}.properties"/>
        
        <echo message="Packaging webapp deinstall-${app.name}.xpi"/>
        <jar destfile="bin/Deinstall-${app.name}.xpi">
			<fileset dir="./deinstall-src">
					  <exclude name="needlesearch/**/NeedleSearchData.rdf"/>
					  <include name="install.js"/>
					  <include name="needlesearch/**/*.js"/>
					  <include name="needlesearch/**/*.xul"/>
					  <include name="needlesearch/**/*.dtd"/>
					  <include name="needlesearch/**/*.rdf"/>
					  <include name="needlesearch/**/*.properties"/>
					  <include name="needlesearch/**/*.gif"/>
					  <!--include name="needlesearch/**/*.png"/-->
        	</fileset>		
        </jar>
      </target>

    <target name="make-example-nsbookmarks" description="Make XPI for version ${app.version}">
        <property file="build-info.${user.name}.properties"/>
        
        <echo message="Packaging example rdf: example-rdf-${app.version}.xpi"/>
        <zip destfile="bin/example-rdf-${app.version}.xpi">
			<fileset dir="./rest">
					  <include name="needlesearch/**/NeedleSearchData.rdf"/>
					  <include name="install.js"/>
        	</fileset>		
        </zip>
      </target>

</project>

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