javauis/eswt_qt/org.eclipse.swt.qt.win32.x86.internal/build.xml
branchGCC_SURGE
changeset 40 c6043ea9b06a
parent 38 854be117f6a5
parent 35 85266cc22c7f
child 41 6918cb13caa7
equal deleted inserted replaced
38:854be117f6a5 40:c6043ea9b06a
     1 <?xml version="1.0" encoding="UTF-8"?>
       
     2 <project name="org.eclipse.swt.qt.win32.x86.internal" default="build" basedir=".">
       
     3 
       
     4     <target name="help">
       
     5         <echo level="info">
       
     6 Usage: ant [one of the following:]
       
     7 build              : Build debug + release
       
     8 build.jar          : Build all jars
       
     9 build.debug        : Build all debug binaries
       
    10 build.release      : Build all release binaries
       
    11 build.lib          : Build all native libraries
       
    12 build.lib.debug    : Build debug native libraries
       
    13 build.lib.release  : Build release native libraries
       
    14 build.tests        : Build JUnit and MT tests
       
    15 clean              : Clean everything
       
    16 clean.jar          : Clean all jars
       
    17 clean.lib          : Clean native libraries and object files
       
    18 clean.lib.debug    : Clean debug native libraries and object files
       
    19 clean.lib.release  : Clean release native libraries and object files
       
    20 export             : Export everything
       
    21 export.jar         : Export Java classes packed as jar
       
    22 export.debug       : Export all debug binaries
       
    23 export.release     : Export all release binaries
       
    24 export.lib         : Export native libraries
       
    25 export.lib.debug   : Export debug native libraries
       
    26 export.lib.release : Export release native libraries
       
    27 run.tests                  : Run JUnit and MT tests
       
    28         </echo>
       
    29     </target>
       
    30 
       
    31     <target name="init" depends="init.env, init.export.path">
       
    32         <property file="./build.properties"></property>
       
    33         <property name="full.name" value="${fragment}_${version.suffix}"/>
       
    34         <property name="temp.dir" value="${basedir}/temp"/>
       
    35         <property name="plugin.destination" value="${basedir}"/>
       
    36         <property name="build.result.dir" value="${basedir}"/>
       
    37         <property name="download.destination" value="${basedir}"/>
       
    38         <property name="lib.path" value = "${plugin.dir}/Eclipse_SWT_PI/qt/library"/>
       
    39         <property name="lib.gfx.path" value = "${plugin.dir}/Eclipse_SWT_PI/qt/library/graphics"/>
       
    40         <mkdir dir="${lib.path}/${generated.native.dir}"/>
       
    41         <!-- Platform Specific properties -->
       
    42    </target>
       
    43 
       
    44     <target name="init.env">
       
    45         <property environment = "env"/>
       
    46     </target>
       
    47 
       
    48     <target name="init.export.path" if="env.JAVA_BIN_ROOT">
       
    49         <property name="export.jar.debug.path" value = "${env.JAVA_BIN_ROOT}/jsr/classes"/>
       
    50         <property name="export.jar.release.path" value = "${env.JAVA_BIN_ROOT}/jsr/classes"/>
       
    51         <property name="export.lib.debug.path" value = "${env.JAVA_BIN_ROOT}/lib"/>
       
    52         <property name="export.lib.release.path" value = "${env.JAVA_BIN_ROOT}/lib"/>
       
    53     </target>
       
    54         
       
    55     <target name="download" depends="init">
       
    56         <delete dir="${temp.dir}"/>
       
    57         <mkdir dir="${temp.dir}/swtdownload/"/>
       
    58         <antcall target="build.jar"/>
       
    59         <jar jarfile="${build.result.dir}/${jar.filename}" basedir="${basedir}/release/" 
       
    60                 update="true" includes="eswt*.dll,libeswt*.so"/>
       
    61         <copy file="${build.result.dir}/${jar.filename}" todir="${temp.dir}/swtdownload"/>
       
    62         <antcall target="src.zip"/>
       
    63         <copy file="${build.result.dir}/src.zip" todir="${temp.dir}/swtdownload"/>
       
    64         <copy file="${plugin.dir}/build/.project" todir="${temp.dir}/swtdownload"/>
       
    65         <copy file="${plugin.dir}/build/.classpath" todir="${temp.dir}/swtdownload"/>
       
    66         <copy todir="${temp.dir}/swtdownload">
       
    67             <fileset dir="${basedir}" includes="about.html,about_files/"/>
       
    68         </copy>
       
    69         <zip zipfile="${download.destination}/eswt-${ws}-${os}-${arch}-${jsdk}.zip">
       
    70             <zipfileset dir="${temp.dir}/swtdownload/"/>
       
    71         </zip>
       
    72         <delete dir="${temp.dir}"/>
       
    73     </target>
       
    74 
       
    75     <target name="src.zip" depends="init">
       
    76         <mkdir dir="${build.result.dir}/"/>
       
    77         <zip zipfile="${build.result.dir}/src.zip">
       
    78             <fileset dir="${plugin.dir}/Eclipse SWT/common/" includes="**/*.java" excludes=""/>
       
    79             <fileset dir="${plugin.dir}/Eclipse SWT/common_j2${java.edition}/" includes="**/*.java" excludes=""/>
       
    80             <fileset dir="${plugin.dir}/Eclipse SWT/qt/" includes="**/*.java" excludes=""/>
       
    81             <fileset dir="${plugin.dir}/Eclipse SWT Browser/common/" includes="**/*.java" excludes=""/>
       
    82             <fileset dir="${plugin.dir}/Eclipse SWT Browser/qt/" includes="**/*.java" excludes=""/>
       
    83             <fileset dir="${plugin.dir}/Eclipse SWT Drag and Drop/qt/" includes="**/*.java" excludes=""/>
       
    84             <fileset dir="${plugin.dir}/Eclipse_SWT_PI/common_j2${java.edition}/" includes="**/*.java" excludes=""/>
       
    85             <fileset dir="${plugin.dir}/Eclipse_SWT_PI/qt/library/"/>
       
    86             <fileset dir="${plugin.dir}/Eclipse_SWT_PI/qt/graphics_library/"/>
       
    87             <fileset dir="${plugin.dir}/Eclipse_SWT_PI/qt/" includes="**/*.java" excludes=""/>
       
    88             <fileset dir="${plugin.dir}/Nokia SWT/extensions/" includes="**/*.java" excludes=""/>
       
    89             <fileset dir="${plugin.dir}/Eclipse SWT/common_j2${java.edition}/" includes="**/*.properties" excludes=""/>
       
    90             <fileset dir="${plugin.dir}/Eclipse SWT/common/" includes="**/version.txt" excludes=""/>
       
    91             <fileset dir="${basedir}" includes="about.html,about_files/" excludes=""/>
       
    92         </zip>
       
    93     </target>
       
    94         
       
    95     <target name="gather.sources" depends="init" if="destination.temp.folder">
       
    96         <mkdir dir="${destination.temp.folder}/${full.name}"/>
       
    97         <copy file="${build.result.dir}/src.zip" todir="${destination.temp.folder}/${full.name}/"/>
       
    98         <copy todir="${destination.temp.folder}/${full.name}">
       
    99             <fileset dir="${basedir}" includes="about.html,about_files/"/>
       
   100         </copy>
       
   101     </target>
       
   102 
       
   103     <target name="gather.individual.sources" depends="init">
       
   104         <copy todir="${destination.temp.folder}/" failonerror="true" overwrite="true">
       
   105             <fileset dir="${plugin.dir}/Eclipse SWT/common/" includes="**/*.java" excludes=""/>
       
   106             <fileset dir="${plugin.dir}/Eclipse SWT/common_j2${java.edition}/" includes="**/*.java" excludes=""/>
       
   107             <fileset dir="${plugin.dir}/Eclipse SWT/qt/" includes="**/*.java" excludes=""/>
       
   108             <fileset dir="${plugin.dir}/Eclipse SWT Browser/common/" includes="**/*.java" excludes=""/>
       
   109             <fileset dir="${plugin.dir}/Eclipse SWT Browser/qt/" includes="**/*.java" excludes=""/>
       
   110             <fileset dir="${plugin.dir}/Eclipse SWT Drag and Drop/qt/" includes="**/*.java" excludes=""/>
       
   111             <fileset dir="${plugin.dir}/Eclipse_SWT_PI/common_j2${java.edition}/" includes="**/*.java" excludes=""/>
       
   112             <fileset dir="${plugin.dir}/Eclipse_SWT_PI/qt/" includes="**/*.java" excludes=""/>
       
   113             <fileset dir="${plugin.dir}/Eclipse_SWT_PI/qt/library/"/>
       
   114             <fileset dir="${plugin.dir}/Eclipse_SWT_PI/qt/graphics_library/"/>
       
   115             <fileset dir="${plugin.dir}/Nokia SWT/extensions/" includes="**/*.java" excludes=""/>
       
   116             <fileset dir="${plugin.dir}/Eclipse SWT/common_j2${java.edition}/" includes="**/*.properties" excludes=""/>
       
   117             <fileset dir="${plugin.dir}/Eclipse SWT/common/" includes="**/version.txt" excludes=""/>
       
   118         </copy>
       
   119     </target>
       
   120 
       
   121     <target name="gather.bin.parts" depends="init" if="destination.temp.folder">
       
   122         <mkdir dir="${destination.temp.folder}/${full.name}"/>
       
   123         <copy todir="${destination.temp.folder}/${full.name}" failonerror="true">
       
   124             <fileset dir="${plugin.dir}/bin" includes="*"/>
       
   125         </copy>
       
   126         <copy todir="${destination.temp.folder}/${full.name}">
       
   127             <fileset dir="${basedir}" includes="eswt*.dll,libeswt*.so,META-INF/"/>
       
   128         </copy>
       
   129         <chmod perm="755" dir="${destination.temp.folder}/${full.name}" includes="eswt*.dll,libeswt*.so" />
       
   130         <eclipse.versionReplacer path="${destination.temp.folder}/${full.name}" version="${version.suffix}"/>
       
   131     </target>
       
   132         
       
   133     <target name="jar.plugin" depends="init">
       
   134         <delete dir="${temp.dir}"/>
       
   135         <mkdir dir="${temp.dir}"/>
       
   136         <antcall target="build.jar"/>
       
   137         <antcall target="gather.bin.parts">
       
   138             <param name="destination.temp.folder" value="${temp.dir}/"/>
       
   139         </antcall>
       
   140         <jar jarfile="${plugin.destination}/${full.name}.jar" 
       
   141                 basedir="${temp.dir}/${full.name}" filesonly="true"/>
       
   142         <delete dir="${temp.dir}"/>
       
   143     </target>
       
   144         
       
   145     <target name="zip.plugin" depends="init">
       
   146         <delete dir="${temp.dir}"/>
       
   147         <mkdir dir="${temp.dir}"/>
       
   148         <antcall target="build.jar"/>
       
   149         <antcall target="src.zip"/>
       
   150         <antcall target="gather.bin.parts">
       
   151             <param name="destination.temp.folder" value="${temp.dir}/"/>
       
   152         </antcall>
       
   153         <antcall target="gather.sources">
       
   154             <param name="destination.temp.folder" value="${temp.dir}/"/>
       
   155         </antcall>
       
   156         <zip zipfile="${plugin.destination}/${full.name}.zip" 
       
   157                 basedir="${temp.dir}" filesonly="true"/>
       
   158         <delete dir="${temp.dir}"/>
       
   159     </target>
       
   160 
       
   161     <target name="build">
       
   162         <antcall target="export.jar"/>
       
   163         <antcall target="export.lib"/>
       
   164     </target>
       
   165         
       
   166     <target name="build.jar" depends="init" description="Produces eswt-qt.jar">
       
   167         <mkdir dir="${plugin.dir}/bin"/>
       
   168         <javac destdir="${plugin.dir}/bin" source="${javac.source}" target="${javac.target}"
       
   169             debug="${javac.debug}" debuglevel="lines,vars,source" verbose="true" failonerror="true">
       
   170             <src path="${plugin.dir}/Eclipse SWT/common/"/>
       
   171             <src path="${plugin.dir}/Eclipse SWT/common_j2${java.edition}/"/>
       
   172             <src path="${plugin.dir}/Eclipse SWT/qt/"/>
       
   173             <src path="${plugin.dir}/Eclipse SWT Browser/common/"/>
       
   174             <src path="${plugin.dir}/Eclipse SWT Browser/qt/"/>
       
   175             <src path="${plugin.dir}/Eclipse SWT Drag and Drop/qt/"/>
       
   176             <src path="${plugin.dir}/Eclipse_SWT_PI/common_j2${java.edition}/"/>
       
   177             <src path="${plugin.dir}/Eclipse_SWT_PI/qt/"/>
       
   178             <src path="${plugin.dir}/Nokia SWT/extensions/"/>
       
   179         </javac>
       
   180         <jar jarfile="${build.result.dir}/${jar.filename}" basedir="${plugin.dir}/bin"/>
       
   181     </target>
       
   182 
       
   183     <target name="build.debug">
       
   184         <antcall target="export.jar.debug"/>
       
   185         <antcall target="export.lib.debug"/>
       
   186     </target>
       
   187 
       
   188     <target name="build.release">
       
   189         <antcall target="export.jar.release"/>
       
   190         <antcall target="export.lib.release"/>
       
   191     </target>
       
   192 
       
   193     <target name="build.lib">
       
   194         <antcall target="build.lib.debug"/>
       
   195         <antcall target="build.lib.release"/>
       
   196     </target>
       
   197 
       
   198     <target name="build.lib.debug" depends="init">
       
   199         <antcall target="build.lib.common">
       
   200             <param name="build.lib.common.config" value="debug"/>
       
   201         </antcall>
       
   202     </target>
       
   203 
       
   204     <target name="build.lib.release" depends="init">
       
   205         <antcall target="build.lib.common">
       
   206             <param name="build.lib.common.config" value="release"/>
       
   207         </antcall>
       
   208     </target>
       
   209 
       
   210     <target name="build.lib.common" depends="init" description="params: config">
       
   211         <javah outputfile="${lib.path}/${generated.native.dir}/os.h" classpath="${plugin.dir}/bin" verbose="yes">
       
   212             <class name="org.eclipse.swt.internal.qt.OS"/>
       
   213             <class name="org.eclipse.swt.internal.qt.graphics.OS"/>
       
   214             <class name="org.eclipse.swt.internal.extension.OS"/>
       
   215         </javah>
       
   216         <antcall target="qmake">
       
   217             <param name="qmake.dir" value="${lib.path}"/>
       
   218             <param name="qmake.target" value="${build.lib.common.config}"/>
       
   219             <param name="qmake.spec" value="${lib.spec}"/>
       
   220             <param name="qmake.file" value="${lib.makefile}.${build.lib.common.config}"/>
       
   221         </antcall>
       
   222         <antcall target="make">
       
   223             <param name="make.dir" value="${lib.path}"/>
       
   224             <param name="make.file" value="${lib.makefile}.${build.lib.common.config}"/>
       
   225             <param name="make.target" value=""/>
       
   226         </antcall>
       
   227         <!--<exec executable="pexports" dir="${lib.path}" failonerror="false">
       
   228             <arg line="${build.lib.common.config}/${lib.filename} > swt.def"/>
       
   229         </exec>-->
       
   230         <mkdir dir="${build.result.dir}/${build.lib.common.config}/"/>
       
   231         <copy file="${lib.path}/${build.lib.common.config}/${lib.filename}" 
       
   232             tofile="${build.result.dir}/${build.lib.common.config}/${lib.filename}" overwrite="true" verbose="true"/>
       
   233     </target>
       
   234 
       
   235     <target name="clean">
       
   236         <antcall target="clean.jar"/>
       
   237         <antcall target="clean.lib"/>
       
   238     </target>
       
   239         
       
   240     <target name="clean.jar" depends="init" description="">
       
   241         <delete dir="${plugin.dir}/bin"/>
       
   242         <delete file="${build.result.dir}/${jar.filename}" verbose="true"/>
       
   243         <delete file="${export.jar.debug.path}/${jar.filename}" verbose="true"/>
       
   244         <delete file="${export.jar.release.path}/${jar.filename}" verbose="true"/>
       
   245     </target>
       
   246 
       
   247     <target name="clean.lib">
       
   248         <antcall target="clean.lib.debug"/>
       
   249         <antcall target="clean.lib.release"/>
       
   250     </target>
       
   251 
       
   252     <target name="clean.lib.debug" depends="init">
       
   253         <antcall target="clean.lib.common">
       
   254             <param name="clean.lib.common.config" value="debug"/>
       
   255         </antcall>
       
   256     </target>
       
   257 
       
   258     <target name="clean.lib.release" depends="init">
       
   259         <antcall target="clean.lib.common">
       
   260             <param name="clean.lib.common.config" value="release"/>
       
   261         </antcall>
       
   262     </target>
       
   263 
       
   264     <target name="clean.lib.common" depends="init" description="params: config">
       
   265         <antcall target="make">
       
   266             <param name="make.dir" value="${lib.path}"/>
       
   267             <param name="make.target" value="clean"/>
       
   268             <param name="make.file" value="${lib.makefile}.${clean.lib.common.config}"/>
       
   269             <param name="fail" value="false"/>
       
   270         </antcall>
       
   271         <delete file="${lib.path}/${lib.makefile}.${clean.lib.common.config}" verbose="true"/>
       
   272         <delete dir="${lib.path}/${generated.native.dir}" verbose="true"/>
       
   273     	<delete dir="${lib.path}/${clean.lib.common.config}" verbose="true"/>
       
   274         <delete file="${build.result.dir}/${clean.lib.common.config}/${lib.filename}" verbose="true"/>
       
   275         <condition property="clean.lib.common.export.path" value="${export.lib.debug.path}" else="${export.lib.release.path}">
       
   276             <equals arg1="${clean.lib.common.config}" arg2="debug"/>
       
   277         </condition>
       
   278         <delete file="${clean.lib.common.export.path}/${lib.filename}" verbose="true"/>
       
   279     </target>
       
   280 
       
   281     <target name="export">
       
   282         <antcall target="export.jar"/>
       
   283         <antcall target="export.lib"/>
       
   284     </target>
       
   285 
       
   286     <target name="export.debug">
       
   287         <antcall target="export.jar.debug"/>
       
   288         <antcall target="export.lib.debug"/>
       
   289     </target>
       
   290 
       
   291     <target name="export.release">
       
   292         <antcall target="export.jar.release"/>
       
   293         <antcall target="export.lib.release"/>
       
   294     </target>
       
   295 
       
   296         <target name="export.jar">
       
   297                 <antcall target="export.jar.debug"/>
       
   298                 <antcall target="export.jar.release"/>
       
   299         </target>
       
   300 
       
   301         <target name="export.jar.debug" depends="build.jar" if="export.jar.debug.path">
       
   302                 <mkdir dir="${export.jar.debug.path}"/>
       
   303                 <copy file="${build.result.dir}/${jar.filename}" 
       
   304             tofile="${export.jar.debug.path}/${jar.filename}" overwrite="true" verbose="true"/>
       
   305         </target>
       
   306 
       
   307         <target name="export.jar.release" depends="build.jar" if="export.jar.release.path">
       
   308                 <mkdir dir="${export.jar.release.path}"/>
       
   309                 <copy file="${build.result.dir}/${jar.filename}"
       
   310             tofile="${export.jar.release.path}/${jar.filename}" overwrite="true" verbose="true"/>
       
   311         </target>
       
   312 
       
   313     <target name="export.lib">
       
   314         <antcall target="export.lib.debug"/>
       
   315         <antcall target="export.lib.release"/>
       
   316     </target>
       
   317 
       
   318     <target name="export.lib.debug" depends="build.lib.debug" if="export.lib.debug.path">
       
   319         <mkdir dir="${export.lib.debug.path}"/>
       
   320         <copy file="${lib.path}/debug/${lib.filename}" 
       
   321             tofile="${export.lib.debug.path}/${lib.filename}" overwrite="true" verbose="true"/>
       
   322     </target>
       
   323 
       
   324     <target name="export.lib.release" depends="build.lib.release" if="export.lib.release.path">
       
   325         <mkdir dir="${export.lib.release.path}"/>
       
   326         <copy file="${lib.path}/release/${lib.filename}"
       
   327             tofile="${export.lib.release.path}/${lib.filename}" overwrite="true" verbose="true"/>
       
   328     </target>
       
   329 
       
   330     <target name="make" description="params: dir, file, target">
       
   331         <exec executable="mingw32-make" dir="${make.dir}" failonerror="false">
       
   332             <arg line="-f ${make.file} ${make.target}"/>
       
   333         </exec>
       
   334     </target>
       
   335 
       
   336     <target name="qmake" description="params: dir, spec, target">
       
   337         <exec executable="qmake" dir="${qmake.dir}" failonerror="true">
       
   338             <arg line="-spec ${qmake.spec} -o ${qmake.file}"/>
       
   339             <arg value="CONFIG+=${qmake.target}"/>
       
   340             <arg value="DESTDIR=${qmake.target}"/>
       
   341             <arg value="OBJECTS_DIR=${qmake.target}/${qmake.spec}/build"/>
       
   342         </exec>
       
   343     </target>
       
   344 
       
   345 
       
   346 </project>
       
   347