File:  [mozdev] / mailfrom / build.xml
Revision 1.2: download - view: text, annotated - select for diffs - revision graph
Mon Jan 14 03:19:02 2008 UTC (12 years, 1 month ago) by gareth
Branches: MAIN
CVS tags: mailfrom_0_2_5, mailfrom_0_2_1, mailfrom_0_2_0, mailfrom_0_1_0, HEAD
Removed references to edit custom services.  Will reinstate once the addon is more stable.

    1: <?xml version="1.0"?>
    2: <!-- ====================================================================== 
    3:      Dec 9, 2004 3:47:59 PM                                                        
    4: 
    5:      Build file for the modify headers extension for Mozilla Firefox
    6:                    
    7:      garethh                                                                
    8:      ====================================================================== -->
    9: <project name="modifyheaders" default="xpi">
   10: 	
   11: 	<!-- Create this to target the build at your environment -->
   12: 	<property file="build.properties.${target}"/>
   13: 	<!-- The default settings mop up any properties not set in the target -->
   14: 	<property file="build.properties.default"/>
   15: 	
   16: 	<!-- Filters used for token replacement -->
   17: 	<filter token="build.version" value="${build.version}"/>
   18: 	<filter token="build.mozilla.firefox.extension.uuid" value="${build.mozilla.firefox.extension.uuid}"/>
   19: 	
   20:     <description>
   21:         Modify Headers is an extension for the Mozilla Firefox web browser
   22:     	that allows a user to modify the HTTP request sent to a particular URL.
   23:     </description>
   24: 
   25: 	<target name="info">
   26: 		<echo>
   27: 			User home: ${user.home}
   28: 			OS: ${os.name}
   29: 			
   30: 			Basedir: ${build.debug}
   31: 			Basedir: ${build.basedir}
   32: 			Srcdir: ${build.srcdir}
   33: 			Target ${build.targetdir}
   34: 			
   35: 			Firefox details:
   36: 			Home: ${build.mozilla.firefox.home}
   37: 			
   38: 			Extension details:
   39: 			Name: ${build.mozilla.firefox.extension.name}
   40: 			Version: ${build.version}
   41: 			UUID: ${build.mozilla.firefox.extension.uuid}
   42: 			Home: ${build.mozilla.firefox.extension.home}/${build.mozilla.firefox.extension.uuid}
   43: 		</echo>
   44: 	</target>
   45: 
   46: 	<target name="clean" depends="info">
   47: 		<echo message="Cleaning..."/>
   48: 		<delete dir="${build.targetdir}" verbose="true"/>
   49: 	</target>
   50: 
   51: 	<target name="prepare" depends="clean" description="Ensures that the required target directories are created">
   52: 		<mkdir dir="${build.targetdir}"/>
   53: 		<mkdir dir="${build.targetdir}/interface"/>
   54: 		<mkdir dir="${build.targetdir}/jar/chrome"/>
   55: 		<!-- <mkdir dir="${build.targetdir}/jar/components"/> -->
   56: 		<mkdir dir="${build.targetdir}/xpi"/>
   57: 	</target>
   58: 	
   59: 	<target name="compile" depends="prepare" description="Compiles the idl interface file into an xpt">
   60: 		<!-- Compile the nsIModifyHaders interface -->
   61: 		<!-- <exec executable="${build.basedir}/compile-interface.bat" dir="${build.basedir}" failonerror="true"/> -->
   62: 		
   63: 		<!-- Copy the files in ${srcdir}/jar to ${targetdir}/chrome -->
   64: 		<copy todir="${build.targetdir}/chrome" filtering="true">
   65: 			<fileset dir="${build.srcdir}/jar">
   66: 				<!-- Excluse editservice until the function is added -->
   67: 				<exclude name="**/editservice.js" />
   68: 				<exclude name="**/editService.xul" />
   69: 				<!-- Exclude the images as the filtering corrupts them -->
   70: 				<exclude name="**/*.gif" />
   71: 				<exclude name="**/*.jpg" />
   72: 			</fileset>
   73: 		</copy>
   74: 		
   75: 		<!-- Copy the gifs without filtering as this corrupts them -->
   76: 		<copy todir="${build.targetdir}/chrome">
   77: 			<fileset dir="${build.srcdir}/jar">
   78: 				<include name="**/*.gif" />
   79: 				<include name="**/*.jpg" />
   80: 			</fileset>
   81: 		</copy>
   82: 		
   83: 		<antcall target="compile-app-specific"/>
   84: 	</target>
   85: 	
   86: 	<target name="compile-app-specific" if="build.mozilla.application.srcdir" description="If required, copies application specific src over the Firefox src">
   87: 		<echo message="Compiling application specific elements"/>
   88: 		
   89: 		<!-- Copy application specific versions of source files into the target -->
   90: 		<copy todir="${build.targetdir}/chrome" filtering="true" overwrite="true">
   91: 			<fileset dir="${build.mozilla.application.srcdir}/jar">
   92: 				<!-- Exclude the images as the filtering corrupts them -->
   93: 				<exclude name="**/*.gif" />
   94: 				<exclude name="**/*.jpg" />
   95: 			</fileset>
   96: 		</copy>
   97: 		
   98: 		<!-- Copy the gifs without filtering as this corrupts them -->
   99: 		<copy todir="${build.targetdir}/chrome" overwrite="true">
  100: 			<fileset dir="${build.mozilla.application.srcdir}/jar">
  101: 				<include name="**/*.gif" />
  102: 				<include name="**/*.jpg" />
  103: 			</fileset>
  104: 		</copy>
  105: 	</target>
  106: 
  107: 	<target name="jar" depends="compile" description="Creates the extension jar">
  108:         <jar destfile="${build.targetdir}/jar/chrome/${build.mozilla.firefox.extension.name}.jar"
  109:         	 basedir="${build.targetdir}/chrome"
  110:         	 includes="**"/>
  111: 		<!-- <copy todir="${build.targetdir}/jar/components">
  112: 			<fileset dir="${build.srcdir}/components"></fileset>
  113: 			<fileset dir="${build.targetdir}/interface"></fileset>
  114: 		</copy> -->
  115: 		<copy todir="${build.targetdir}/jar/" filtering="true">
  116: 			<fileset dir="${build.srcdir}" includes="*.*"/>
  117: 		</copy>
  118: 		<copy todir="${build.targetdir}/jar/defaults" filtering="true">
  119: 			<fileset dir="${build.srcdir}/defaults" includes="**/*.*"/>
  120: 		</copy>
  121: 		
  122: 		<antcall target="jar-app-specific"/>
  123:     </target>
  124: 
  125: 	<target name="jar-app-specific" if="build.mozilla.application.srcdir" description="If required, copies application specific src over the Firefox src">
  126: 		<echo message="Adding application specific elements to jar dir"/>
  127: 		
  128: 		<copy todir="${build.targetdir}/jar/" filtering="true" overwrite="true">
  129: 			<fileset dir="${build.mozilla.application.srcdir}" includes="*.*"/>
  130: 		</copy>
  131: 	</target>
  132: 
  133:     <!-- ================================= 
  134:           target: default              
  135:          ================================= -->
  136: 	<target name="xpi" depends="jar" description="Creates the xpi file that includes the extension jar and ind=stall scripts">
  137: 		<!-- Zip the jar file and the installation scripts into the xpi file -->
  138: 		<zip destfile="${build.targetdir}/xpi/${build.mozilla.firefox.extension.name}-${build.version}.xpi">
  139: 			<!-- <fileset dir="${build.targetdir}/jar" includes="*.*"/> -->
  140: 			<fileset dir="${build.targetdir}/jar" includes="**/*.*"/>
  141: 		</zip>
  142:     </target>
  143: 
  144: 	<!-- Deploy the contents of the src directory to the extension directory -->
  145: 	<target name="debug" depends="jar">
  146: 		<echo>Debug deployment</echo>
  147: 		
  148: 	    <copy todir="${build.mozilla.firefox.extension.home}/${build.mozilla.firefox.extension.uuid}" overwrite="true">
  149: 	      <fileset dir="${build.targetdir}/jar"/>
  150: 	    </copy>           
  151: 		
  152: 	</target>
  153: </project>

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