Annotation of forecastfox/build.xml, revision 1.20

1.1       richwkle    1: <?xml version="1.0"?>
1.10      richwkle    2: <!-- ***** BEGIN LICENSE BLOCK *****
                      3:    - Version: MPL 1.1/GPL 2.0/LGPL 2.1
                      4:    -
                      5:    - The contents of this file are subject to the Mozilla Public License Version
                      6:    - 1.1 (the "License"); you may not use this file except in compliance with
                      7:    - the License. You may obtain a copy of the License at
                      8:    - http://www.mozilla.org/MPL/
                      9:    -
                     10:    - Software distributed under the License is distributed on an "AS IS" basis,
                     11:    - WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
                     12:    - for the specific language governing rights and limitations under the
                     13:    - License.
                     14:    -
1.11      jstritar   15:    - The Original Code is Forecastfox.
1.10      richwkle   16:    -
                     17:    - The Initial Developer of the Original Code is
                     18:    - Jon Stritar <jstritar@MIT.EDU>.
                     19:    - Portions created by the Initial Developer are Copyright (C) 2005
                     20:    - the Initial Developer. All Rights Reserved.
                     21:    -
                     22:    - Contributor(s):
                     23:    - Jon Stritar <jstritar@MIT.EDU>
                     24:    - Richard Klein <richwklein@mchsi.com>
                     25:    -
                     26:    - Alternatively, the contents of this file may be used under the terms of
                     27:    - either the GNU General Public License Version 2 or later (the "GPL"), or
                     28:    - the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
                     29:    - in which case the provisions of the GPL or the LGPL are applicable instead
                     30:    - of those above. If you wish to allow use of your version of this file only
                     31:    - under the terms of either the GPL or the LGPL, and not to allow others to
                     32:    - use your version of this file under the terms of the MPL, indicate your
                     33:    - decision by deleting the provisions above and replace them with the notice
                     34:    - and other provisions required by the LGPL or the GPL. If you do not delete
                     35:    - the provisions above, a recipient may use your version of this file under
                     36:    - the terms of any one of the MPL, the GPL or the LGPL.
                     37:    -
                     38:    - ***** END LICENSE BLOCK ***** -->
1.6       richwkle   39: 
                     40: <!-- project used to build xpi -->
1.3       richwkle   41: <project name="forecastfox" default="dist">
1.19      jstritar   42:   <property file="build.properties"/>
1.11      jstritar   43:   
                     44:   <!-- create build directories -->
                     45:   <target name="init" description="Create build environment">
                     46:     <mkdir dir="${downloads.dir}"/>
                     47:     <mkdir dir="${staging.dir}"/>    
                     48:     <mkdir dir="${build.dir}"/>
                     49:     <mkdir dir="${build.dir}/chrome"/>    
                     50:   </target>
                     51:   
                     52:   <!-- clean up build directories -->
                     53:   <target name="clean">
                     54:     <delete dir="${build.dir}"/>    
                     55:     <delete dir="${moz.dir}/base"/>
                     56:     <delete dir="${staging.dir}"/>
                     57:   </target>
                     58:   
                     59:   <!-- staging files -->
                     60:   <target name="staging" description="Copy files to staging and preprocess">
                     61:     
                     62:     <!-- replace version and locale strings -->
                     63:     <copy todir="${staging.dir}" overwrite="true">
                     64:       <fileset dir="${src.dir}">
                     65:         <exclude name="**/images/**"/>
1.18      jstritar   66:        <exclude name="**/locale/*/*/*.dtd"/>
                     67:       </fileset>
                     68:       <filterset begintoken="#" endtoken="#">
                     69:         <filter token="VERSION" value="${app.version}"/>
1.20    ! jstritar   70:        <filter token="BUILD" value="${app.build}"/>
1.18      jstritar   71:         <filter token="GUID" value="${app.guid}"/>
                     72:       </filterset>      
                     73:     </copy>
                     74:        
                     75:     <!-- replace version and locale strings in UTF-8 files -->
                     76:     <copy todir="${staging.dir}" overwrite="true" encoding="utf-8">
                     77:       <fileset dir="${src.dir}">
                     78:        <include name="**/locale/*/*/*.dtd"/>
1.11      jstritar   79:       </fileset>
                     80:       <filterset begintoken="#" endtoken="#">
                     81:         <filter token="VERSION" value="${app.version}"/>
                     82:         <filter token="GUID" value="${app.guid}"/>
                     83:       </filterset>      
                     84:     </copy>
                     85:     
                     86:     <!-- copy binary files to staging -->
                     87:     <copy todir="${staging.dir}" overwrite="true">
                     88:       <fileset dir="${src.dir}">
                     89:         <include name="**/images/**"/>
                     90:       </fileset>  
                     91:     </copy>    
                     92:   </target>
1.6       richwkle   93: 
1.11      jstritar   94:   <!-- build interfaces -->
                     95:   <target name="xpt" description="Create interface definition files">
                     96:     
                     97:     <!-- copy interfaces to mozilla dir -->
                     98:     <unzip src="${xpidl.dir}/base.zip" dest="${moz.dir}"/>
                     99:     <copy todir="${moz.dir}/base">
                    100:       <fileset dir="${staging.dir}/components">
                    101:         <include name="*.idl"/>    
1.3       richwkle  102:       </fileset>
1.11      jstritar  103:     </copy>
                    104:     
                    105:     <!-- create interfaces -->
                    106:     <echo message="Building nsForecastfox.xpt"/>
                    107:     <exec dir="${moz.dir}/base" executable="${moz.dir}/base/xpidl.exe" failonerror="true">
                    108:       <arg line="-m typelib -w -v -I -o nsForecastfox.idl"/>
                    109:     </exec>
                    110:     <echo message="Building ffPing.xpt"/>    
                    111:     <exec dir="${moz.dir}/base" executable="${moz.dir}/base/xpidl.exe" failonerror="true">
                    112:       <arg line="-m typelib -w -v -I -o ffPing.idl"/>
                    113:     </exec>
                    114:     <echo message="Building ffProfiles.xpt"/>    
                    115:     <exec dir="${moz.dir}/base" executable="${moz.dir}/base/xpidl.exe" failonerror="true">
                    116:       <arg line="-m typelib -w -v -I -o ffProfiles.idl"/>
                    117:     </exec>
                    118:     <echo message="Building ffError.xpt"/>    
                    119:     <exec dir="${moz.dir}/base" executable="${moz.dir}/base/xpidl.exe" failonerror="true">
                    120:       <arg line="-m typelib -w -v -I -o ffError.idl"/>
                    121:     </exec> 
                    122:     <echo message="Building ffParser.xpt"/>    
                    123:     <exec dir="${moz.dir}/base" executable="${moz.dir}/base/xpidl.exe" failonerror="true">
                    124:       <arg line="-m typelib -w -v -I -o ffParser.idl"/>
1.15      richwkle  125:     </exec>  
                    126:     <echo message="Building ffDisk.xpt"/>    
                    127:     <exec dir="${moz.dir}/base" executable="${moz.dir}/base/xpidl.exe" failonerror="true">
                    128:       <arg line="-m typelib -w -v -I -o ffDisk.idl"/>
                    129:     </exec>        
1.11      jstritar  130:   </target>
                    131: 
                    132:   <!-- create distribute files -->
                    133:   <target name="build" description="Copy files from interface creation and staging">        
                    134:     <copy todir="${build.dir}/components">
                    135:       <fileset dir="${moz.dir}/base">
                    136:         <include name="nsForecastfox.xpt"/>  
                    137:         <include name="ffPing.xpt"/>
                    138:        <include name="ffProfiles.xpt"/>
                    139:         <include name="ffError.xpt"/>
1.15      richwkle  140:         <include name="ffParser.xpt"/>
                    141:         <include name="ffDisk.xpt"/>
1.11      jstritar  142:       </fileset>
                    143:     </copy>
                    144:     
                    145:     <copy todir="${build.dir}">
                    146:       <fileset dir="${staging.dir}">
                    147:         <exclude name="chrome/**"/>
                    148:         <exclude name="components/*.idl"/>
1.3       richwkle  149:       </fileset>
1.11      jstritar  150:     </copy>
1.8       richwkle  151:   </target>
1.4       richwkle  152:     
1.11      jstritar  153:   <target name="dist" depends="clean, init, staging, xpt, build" description="Create distribution files">
                    154:     <zip destfile="${build.dir}/chrome/${ant.project.name}.jar" basedir="${staging.dir}/chrome" compress="false"/>    
1.19      jstritar  155:          <zip destfile="${downloads.dir}/${xpi.name}" basedir="${build.dir}" compress="true"/>    
1.11      jstritar  156: 
                    157:     <!-- cleanup when done -->
1.3       richwkle  158:     <ant target="clean"/>
1.8       richwkle  159:   </target>
1.11      jstritar  160:  
1.1       richwkle  161: </project>

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