Annotation of forecastfox/build.xml, revision 1.22

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="#">
1.22    ! richwkle   85:        <filter token="BUILD" value="${app.build}"/>        
1.11      jstritar   86:         <filter token="VERSION" value="${app.version}"/>
                     87:         <filter token="GUID" value="${app.guid}"/>
                     88:       </filterset>      
                     89:     </copy>
                     90:     
                     91:     <!-- copy binary files to staging -->
                     92:     <copy todir="${staging.dir}" overwrite="true">
                     93:       <fileset dir="${src.dir}">
                     94:         <include name="**/images/**"/>
                     95:       </fileset>  
                     96:     </copy>    
                     97:   </target>
1.6       richwkle   98: 
1.11      jstritar   99:   <!-- build interfaces -->
                    100:   <target name="xpt" description="Create interface definition files">
                    101:     
                    102:     <!-- copy interfaces to mozilla dir -->
                    103:     <unzip src="${xpidl.dir}/base.zip" dest="${moz.dir}"/>
                    104:     <copy todir="${moz.dir}/base">
                    105:       <fileset dir="${staging.dir}/components">
                    106:         <include name="*.idl"/>    
1.3       richwkle  107:       </fileset>
1.11      jstritar  108:     </copy>
                    109:     
                    110:     <!-- create interfaces -->
                    111:     <echo message="Building nsForecastfox.xpt"/>
                    112:     <exec dir="${moz.dir}/base" executable="${moz.dir}/base/xpidl.exe" failonerror="true">
                    113:       <arg line="-m typelib -w -v -I -o nsForecastfox.idl"/>
                    114:     </exec>
                    115:     <echo message="Building ffPing.xpt"/>    
                    116:     <exec dir="${moz.dir}/base" executable="${moz.dir}/base/xpidl.exe" failonerror="true">
                    117:       <arg line="-m typelib -w -v -I -o ffPing.idl"/>
                    118:     </exec>
                    119:     <echo message="Building ffProfiles.xpt"/>    
                    120:     <exec dir="${moz.dir}/base" executable="${moz.dir}/base/xpidl.exe" failonerror="true">
                    121:       <arg line="-m typelib -w -v -I -o ffProfiles.idl"/>
                    122:     </exec>
                    123:     <echo message="Building ffError.xpt"/>    
                    124:     <exec dir="${moz.dir}/base" executable="${moz.dir}/base/xpidl.exe" failonerror="true">
                    125:       <arg line="-m typelib -w -v -I -o ffError.idl"/>
                    126:     </exec> 
                    127:     <echo message="Building ffParser.xpt"/>    
                    128:     <exec dir="${moz.dir}/base" executable="${moz.dir}/base/xpidl.exe" failonerror="true">
                    129:       <arg line="-m typelib -w -v -I -o ffParser.idl"/>
1.15      richwkle  130:     </exec>  
                    131:     <echo message="Building ffDisk.xpt"/>    
                    132:     <exec dir="${moz.dir}/base" executable="${moz.dir}/base/xpidl.exe" failonerror="true">
                    133:       <arg line="-m typelib -w -v -I -o ffDisk.idl"/>
                    134:     </exec>        
1.11      jstritar  135:   </target>
                    136: 
                    137:   <!-- create distribute files -->
                    138:   <target name="build" description="Copy files from interface creation and staging">        
                    139:     <copy todir="${build.dir}/components">
                    140:       <fileset dir="${moz.dir}/base">
                    141:         <include name="nsForecastfox.xpt"/>  
                    142:         <include name="ffPing.xpt"/>
                    143:        <include name="ffProfiles.xpt"/>
                    144:         <include name="ffError.xpt"/>
1.15      richwkle  145:         <include name="ffParser.xpt"/>
                    146:         <include name="ffDisk.xpt"/>
1.11      jstritar  147:       </fileset>
                    148:     </copy>
                    149:     
                    150:     <copy todir="${build.dir}">
                    151:       <fileset dir="${staging.dir}">
                    152:         <exclude name="chrome/**"/>
                    153:         <exclude name="components/*.idl"/>
1.3       richwkle  154:       </fileset>
1.11      jstritar  155:     </copy>
1.8       richwkle  156:   </target>
1.4       richwkle  157:     
1.11      jstritar  158:   <target name="dist" depends="clean, init, staging, xpt, build" description="Create distribution files">
                    159:     <zip destfile="${build.dir}/chrome/${ant.project.name}.jar" basedir="${staging.dir}/chrome" compress="false"/>    
1.19      jstritar  160:          <zip destfile="${downloads.dir}/${xpi.name}" basedir="${build.dir}" compress="true"/>    
1.11      jstritar  161: 
                    162:     <!-- cleanup when done -->
1.3       richwkle  163:     <ant target="clean"/>
1.8       richwkle  164:   </target>
1.11      jstritar  165:  
1.1       richwkle  166: </project>

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