Annotation of forecastfox/build.xml, revision 1.21

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

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