Annotation of forecastfox/build.xml, revision 1.18

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.17      richwkle   42:   <property name="app.version"     value="0.8"/>
1.11      jstritar   43:   <property name="app.guid"        value="{0538E3E3-7E9B-4d49-8831-A227C80A7AD3}"/>
                     44:   <property name="build.dir"       location="build"/>
                     45:   <property name="staging.dir"     location="staging"/>
                     46:   <property name="downloads.dir"   location="downloads"/>
                     47:   <property name="src.dir"         location="src"/>
                     48:   <property name="xpidl.dir"       location="xpidl"/>
                     49:   <property name="moz.dir"         location="c:\program files\mozilla\firefox\"/>
                     50:   
                     51:   <!-- create build directories -->
                     52:   <target name="init" description="Create build environment">
                     53:     <mkdir dir="${downloads.dir}"/>
                     54:     <mkdir dir="${staging.dir}"/>    
                     55:     <mkdir dir="${build.dir}"/>
                     56:     <mkdir dir="${build.dir}/chrome"/>    
                     57:   </target>
                     58:   
                     59:   <!-- clean up build directories -->
                     60:   <target name="clean">
                     61:     <delete dir="${build.dir}"/>    
                     62:     <delete dir="${moz.dir}/base"/>
                     63:     <delete dir="${staging.dir}"/>
                     64:   </target>
                     65:   
                     66:   <!-- staging files -->
                     67:   <target name="staging" description="Copy files to staging and preprocess">
                     68:     
                     69:     <!-- replace version and locale strings -->
                     70:     <copy todir="${staging.dir}" overwrite="true">
                     71:       <fileset dir="${src.dir}">
                     72:         <exclude name="**/images/**"/>
1.18    ! jstritar   73:        <exclude name="**/locale/*/*/*.dtd"/>
        !            74:       </fileset>
        !            75:       <filterset begintoken="#" endtoken="#">
        !            76:         <filter token="VERSION" value="${app.version}"/>
        !            77:         <filter token="GUID" value="${app.guid}"/>
        !            78:       </filterset>      
        !            79:     </copy>
        !            80:        
        !            81:     <!-- replace version and locale strings in UTF-8 files -->
        !            82:     <copy todir="${staging.dir}" overwrite="true" encoding="utf-8">
        !            83:       <fileset dir="${src.dir}">
        !            84:        <include name="**/locale/*/*/*.dtd"/>
1.11      jstritar   85:       </fileset>
                     86:       <filterset begintoken="#" endtoken="#">
                     87:         <filter token="VERSION" value="${app.version}"/>
                     88:         <filter token="GUID" value="${app.guid}"/>
                     89:       </filterset>      
                     90:     </copy>
                     91:     
                     92:     <!-- copy binary files to staging -->
                     93:     <copy todir="${staging.dir}" overwrite="true">
                     94:       <fileset dir="${src.dir}">
                     95:         <include name="**/images/**"/>
                     96:       </fileset>  
                     97:     </copy>    
                     98:   </target>
1.6       richwkle   99: 
1.11      jstritar  100:   <!-- build interfaces -->
                    101:   <target name="xpt" description="Create interface definition files">
                    102:     
                    103:     <!-- copy interfaces to mozilla dir -->
                    104:     <unzip src="${xpidl.dir}/base.zip" dest="${moz.dir}"/>
                    105:     <copy todir="${moz.dir}/base">
                    106:       <fileset dir="${staging.dir}/components">
                    107:         <include name="*.idl"/>    
1.3       richwkle  108:       </fileset>
1.11      jstritar  109:     </copy>
                    110:     
                    111:     <!-- create interfaces -->
                    112:     <echo message="Building nsForecastfox.xpt"/>
                    113:     <exec dir="${moz.dir}/base" executable="${moz.dir}/base/xpidl.exe" failonerror="true">
                    114:       <arg line="-m typelib -w -v -I -o nsForecastfox.idl"/>
                    115:     </exec>
                    116:     <echo message="Building ffPing.xpt"/>    
                    117:     <exec dir="${moz.dir}/base" executable="${moz.dir}/base/xpidl.exe" failonerror="true">
                    118:       <arg line="-m typelib -w -v -I -o ffPing.idl"/>
                    119:     </exec>
                    120:     <echo message="Building ffProfiles.xpt"/>    
                    121:     <exec dir="${moz.dir}/base" executable="${moz.dir}/base/xpidl.exe" failonerror="true">
                    122:       <arg line="-m typelib -w -v -I -o ffProfiles.idl"/>
                    123:     </exec>
                    124:     <echo message="Building ffError.xpt"/>    
                    125:     <exec dir="${moz.dir}/base" executable="${moz.dir}/base/xpidl.exe" failonerror="true">
                    126:       <arg line="-m typelib -w -v -I -o ffError.idl"/>
                    127:     </exec> 
                    128:     <echo message="Building ffParser.xpt"/>    
                    129:     <exec dir="${moz.dir}/base" executable="${moz.dir}/base/xpidl.exe" failonerror="true">
                    130:       <arg line="-m typelib -w -v -I -o ffParser.idl"/>
1.15      richwkle  131:     </exec>  
                    132:     <echo message="Building ffDisk.xpt"/>    
                    133:     <exec dir="${moz.dir}/base" executable="${moz.dir}/base/xpidl.exe" failonerror="true">
                    134:       <arg line="-m typelib -w -v -I -o ffDisk.idl"/>
                    135:     </exec>        
1.11      jstritar  136:   </target>
                    137: 
                    138:   <!-- create distribute files -->
                    139:   <target name="build" description="Copy files from interface creation and staging">        
                    140:     <copy todir="${build.dir}/components">
                    141:       <fileset dir="${moz.dir}/base">
                    142:         <include name="nsForecastfox.xpt"/>  
                    143:         <include name="ffPing.xpt"/>
                    144:        <include name="ffProfiles.xpt"/>
                    145:         <include name="ffError.xpt"/>
1.15      richwkle  146:         <include name="ffParser.xpt"/>
                    147:         <include name="ffDisk.xpt"/>
1.11      jstritar  148:       </fileset>
                    149:     </copy>
                    150:     
                    151:     <copy todir="${build.dir}">
                    152:       <fileset dir="${staging.dir}">
                    153:         <exclude name="chrome/**"/>
                    154:         <exclude name="components/*.idl"/>
1.3       richwkle  155:       </fileset>
1.11      jstritar  156:     </copy>
1.8       richwkle  157:   </target>
1.4       richwkle  158:     
1.11      jstritar  159:   <target name="dist" depends="clean, init, staging, xpt, build" description="Create distribution files">
                    160:     <zip destfile="${build.dir}/chrome/${ant.project.name}.jar" basedir="${staging.dir}/chrome" compress="false"/>    
                    161:          <zip destfile="${downloads.dir}/${ant.project.name}-${app.version}.xpi" basedir="${build.dir}" compress="true"/>    
                    162: 
                    163:     <!-- cleanup when done -->
1.3       richwkle  164:     <ant target="clean"/>
1.8       richwkle  165:   </target>
1.11      jstritar  166:  
1.1       richwkle  167: </project>

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