javauis/eswt_qt/org.eclipse.swt.qt.linux.arm.se/build.xml
changeset 35 85266cc22c7f
parent 26 dc7c549001d5
child 40 c6043ea9b06a
child 44 0105bdca6f9c
child 47 f40128debb5d
child 49 35baca0e7a2e
equal deleted inserted replaced
26:dc7c549001d5 35:85266cc22c7f
     1 <?xml version="1.0" encoding="UTF-8"?>
       
     2 <project name="org.eclipse.swt.qt.linux.arm" 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         <fail message="USERNAME system variable not defined">
       
    47             <condition>
       
    48                 <not>
       
    49                     <isset property="env.USERNAME"/>
       
    50                 </not>
       
    51             </condition>
       
    52         </fail>
       
    53     </target>
       
    54 
       
    55     <target name="init.export.path" if="env.JAVA_BIN_ROOT">
       
    56         <property name="export.jar.debug.path" value = "${env.JAVA_BIN_ROOT}/jsr/classes"/>
       
    57         <property name="export.jar.release.path" value = "${env.JAVA_BIN_ROOT}/jsr/classes"/>
       
    58         <property name="export.lib.debug.path" value = "${env.JAVA_BIN_ROOT}/lib"/>
       
    59         <property name="export.lib.release.path" value = "${env.JAVA_BIN_ROOT}/lib"/>
       
    60     </target>
       
    61 	
       
    62     <target name="download" depends="init">
       
    63         <delete dir="${temp.dir}"/>
       
    64         <mkdir dir="${temp.dir}/swtdownload/"/>
       
    65         <antcall target="build.jar"/>
       
    66         <jar jarfile="${build.result.dir}/${jar.filename}" basedir="${basedir}/release/" 
       
    67         	update="true" includes="eswt*.dll,libeswt*.so"/>
       
    68         <copy file="${build.result.dir}/${jar.filename}" todir="${temp.dir}/swtdownload"/>
       
    69         <antcall target="src.zip"/>
       
    70         <copy file="${build.result.dir}/src.zip" todir="${temp.dir}/swtdownload"/>
       
    71         <copy file="${plugin.dir}/build/.project" todir="${temp.dir}/swtdownload"/>
       
    72         <copy file="${plugin.dir}/build/.classpath" todir="${temp.dir}/swtdownload"/>
       
    73         <copy todir="${temp.dir}/swtdownload">
       
    74             <fileset dir="${basedir}" includes="about.html,about_files/"/>
       
    75         </copy>
       
    76         <zip zipfile="${download.destination}/eswt-${ws}-${os}-${arch}-${jsdk}.zip">
       
    77             <zipfileset dir="${temp.dir}/swtdownload/"/>
       
    78         </zip>
       
    79         <delete dir="${temp.dir}"/>
       
    80     </target>
       
    81 
       
    82     <target name="src.zip" depends="init">
       
    83         <mkdir dir="${build.result.dir}/"/>
       
    84         <zip zipfile="${build.result.dir}/src.zip">
       
    85             <fileset dir="${plugin.dir}/Eclipse SWT/common/" includes="**/*.java" excludes=""/>
       
    86             <fileset dir="${plugin.dir}/Eclipse SWT/common_j2${java.edition}/" includes="**/*.java" excludes=""/>
       
    87             <fileset dir="${plugin.dir}/Eclipse SWT/qt/" includes="**/*.java" excludes=""/>
       
    88             <fileset dir="${plugin.dir}/Eclipse SWT Browser/common/" includes="**/*.java" excludes=""/>
       
    89             <fileset dir="${plugin.dir}/Eclipse SWT Browser/qt/" includes="**/*.java" excludes=""/>
       
    90             <fileset dir="${plugin.dir}/Eclipse SWT Drag and Drop/qt/" includes="**/*.java" excludes=""/>
       
    91             <fileset dir="${plugin.dir}/Eclipse_SWT_PI/common_j2${java.edition}/" includes="**/*.java" excludes=""/>
       
    92             <fileset dir="${plugin.dir}/Eclipse_SWT_PI/qt/library/"/>
       
    93             <fileset dir="${plugin.dir}/Eclipse_SWT_PI/qt/graphics_library/"/>
       
    94             <fileset dir="${plugin.dir}/Eclipse_SWT_PI/qt/" includes="**/*.java" excludes=""/>
       
    95             <fileset dir="${plugin.dir}/Nokia SWT/extensions/" includes="**/*.java" excludes=""/>
       
    96             <fileset dir="${plugin.dir}/Eclipse SWT/common_j2${java.edition}/" includes="**/*.properties" excludes=""/>
       
    97             <fileset dir="${plugin.dir}/Eclipse SWT/common/" includes="**/version.txt" excludes=""/>
       
    98             <fileset dir="${basedir}" includes="about.html,about_files/" excludes=""/>
       
    99         </zip>
       
   100     </target>
       
   101 	
       
   102     <target name="gather.sources" depends="init" if="destination.temp.folder">
       
   103         <mkdir dir="${destination.temp.folder}/${full.name}"/>
       
   104         <copy file="${build.result.dir}/src.zip" todir="${destination.temp.folder}/${full.name}/"/>
       
   105         <copy todir="${destination.temp.folder}/${full.name}">
       
   106             <fileset dir="${basedir}" includes="about.html,about_files/"/>
       
   107         </copy>
       
   108     </target>
       
   109 
       
   110     <target name="gather.individual.sources" depends="init">
       
   111         <copy todir="${destination.temp.folder}/" failonerror="true" overwrite="true">
       
   112             <fileset dir="${plugin.dir}/Eclipse SWT/common/" includes="**/*.java" excludes=""/>
       
   113             <fileset dir="${plugin.dir}/Eclipse SWT/common_j2${java.edition}/" includes="**/*.java" excludes=""/>
       
   114             <fileset dir="${plugin.dir}/Eclipse SWT/qt/" includes="**/*.java" excludes=""/>
       
   115             <fileset dir="${plugin.dir}/Eclipse SWT Browser/common/" includes="**/*.java" excludes=""/>
       
   116             <fileset dir="${plugin.dir}/Eclipse SWT Browser/qt/" includes="**/*.java" excludes=""/>
       
   117             <fileset dir="${plugin.dir}/Eclipse SWT Drag and Drop/qt/" includes="**/*.java" excludes=""/>
       
   118             <fileset dir="${plugin.dir}/Eclipse_SWT_PI/common_j2${java.edition}/" includes="**/*.java" excludes=""/>
       
   119             <fileset dir="${plugin.dir}/Eclipse_SWT_PI/qt/" includes="**/*.java" excludes=""/>
       
   120             <fileset dir="${plugin.dir}/Eclipse_SWT_PI/qt/library/"/>
       
   121             <fileset dir="${plugin.dir}/Eclipse_SWT_PI/qt/graphics_library/"/>
       
   122             <fileset dir="${plugin.dir}/Nokia SWT/extensions/" includes="**/*.java" excludes=""/>
       
   123             <fileset dir="${plugin.dir}/Eclipse SWT/common_j2${java.edition}/" includes="**/*.properties" excludes=""/>
       
   124             <fileset dir="${plugin.dir}/Eclipse SWT/common/" includes="**/version.txt" excludes=""/>
       
   125         </copy>
       
   126     </target>
       
   127 
       
   128     <target name="gather.bin.parts" depends="init" if="destination.temp.folder">
       
   129         <mkdir dir="${destination.temp.folder}/${full.name}"/>
       
   130         <copy todir="${destination.temp.folder}/${full.name}" failonerror="true">
       
   131             <fileset dir="${plugin.dir}/bin" includes="*"/>
       
   132         </copy>
       
   133         <copy todir="${destination.temp.folder}/${full.name}">
       
   134             <fileset dir="${basedir}" includes="eswt*.dll,libeswt*.so,META-INF/"/>
       
   135         </copy>
       
   136         <chmod perm="755" dir="${destination.temp.folder}/${full.name}" includes="eswt*.dll,libeswt*.so" />
       
   137         <eclipse.versionReplacer path="${destination.temp.folder}/${full.name}" version="${version.suffix}"/>
       
   138     </target>
       
   139 	
       
   140     <target name="jar.plugin" depends="init">
       
   141         <delete dir="${temp.dir}"/>
       
   142         <mkdir dir="${temp.dir}"/>
       
   143         <antcall target="build.jar"/>
       
   144         <antcall target="gather.bin.parts">
       
   145             <param name="destination.temp.folder" value="${temp.dir}/"/>
       
   146         </antcall>
       
   147         <jar jarfile="${plugin.destination}/${full.name}.jar" 
       
   148         	basedir="${temp.dir}/${full.name}" filesonly="true"/>
       
   149         <delete dir="${temp.dir}"/>
       
   150     </target>
       
   151     	
       
   152     <target name="zip.plugin" depends="init">
       
   153         <delete dir="${temp.dir}"/>
       
   154         <mkdir dir="${temp.dir}"/>
       
   155         <antcall target="build.jar"/>
       
   156         <antcall target="src.zip"/>
       
   157         <antcall target="gather.bin.parts">
       
   158             <param name="destination.temp.folder" value="${temp.dir}/"/>
       
   159         </antcall>
       
   160         <antcall target="gather.sources">
       
   161             <param name="destination.temp.folder" value="${temp.dir}/"/>
       
   162         </antcall>
       
   163         <zip zipfile="${plugin.destination}/${full.name}.zip" 
       
   164         	basedir="${temp.dir}" filesonly="true"/>
       
   165         <delete dir="${temp.dir}"/>
       
   166     </target>
       
   167 
       
   168     <target name="build">
       
   169         <antcall target="export.jar"/>
       
   170         <antcall target="export.lib"/>
       
   171     </target>
       
   172 	
       
   173     <target name="build.jar" depends="init" description="Produces eswt-qt.jar">
       
   174     	<mkdir dir="${plugin.dir}/bin"/>
       
   175         <javac destdir="${plugin.dir}/bin" source="${javac.source}" target="${javac.target}"
       
   176             debug="${javac.debug}" debuglevel="lines,vars,source" verbose="true" failonerror="true">
       
   177             <src path="${plugin.dir}/Eclipse SWT/common/"/>
       
   178             <src path="${plugin.dir}/Eclipse SWT/common_j2${java.edition}/"/>
       
   179             <src path="${plugin.dir}/Eclipse SWT/qt/"/>
       
   180             <src path="${plugin.dir}/Eclipse SWT Browser/common/"/>
       
   181             <src path="${plugin.dir}/Eclipse SWT Browser/qt/"/>
       
   182             <src path="${plugin.dir}/Eclipse SWT Drag and Drop/qt/"/>
       
   183             <src path="${plugin.dir}/Eclipse_SWT_PI/common_j2${java.edition}/"/>
       
   184             <src path="${plugin.dir}/Eclipse_SWT_PI/qt/"/>
       
   185             <src path="${plugin.dir}/Nokia SWT/extensions/"/>
       
   186         </javac>
       
   187         <jar jarfile="${build.result.dir}/${jar.filename}" basedir="${plugin.dir}/bin"/>
       
   188     </target>
       
   189 
       
   190     <target name="build.debug">
       
   191         <antcall target="export.jar.debug"/>
       
   192         <antcall target="export.lib.debug"/>
       
   193     </target>
       
   194 
       
   195     <target name="build.release">
       
   196         <antcall target="export.jar.release"/>
       
   197         <antcall target="export.lib.release"/>
       
   198     </target>
       
   199 
       
   200     <target name="build.lib">
       
   201         <antcall target="build.lib.debug"/>
       
   202         <antcall target="build.lib.release"/>
       
   203     </target>
       
   204 
       
   205     <target name="build.lib.debug" depends="init">
       
   206         <antcall target="build.lib.common">
       
   207             <param name="build.lib.common.config" value="debug"/>
       
   208         </antcall>
       
   209     </target>
       
   210 
       
   211     <target name="build.lib.release" depends="init">
       
   212         <antcall target="build.lib.common">
       
   213             <param name="build.lib.common.config" value="release"/>
       
   214         </antcall>
       
   215     </target>
       
   216 
       
   217     <target name="build.lib.common" depends="init" description="params: config">
       
   218         <javah outputfile="${lib.path}/${generated.native.dir}/os.h" classpath="${plugin.dir}/bin" verbose="yes">
       
   219             <class name="org.eclipse.swt.internal.qt.OS"/>
       
   220             <class name="org.eclipse.swt.internal.qt.graphics.OS"/>
       
   221             <class name="org.eclipse.swt.internal.extension.OS"/>
       
   222         </javah>
       
   223         <antcall target="make">
       
   224             <param name="make.target" value="${build.lib.common.config}"/>
       
   225         </antcall>
       
   226         <mkdir dir="${build.result.dir}/${build.lib.common.config}/"/>
       
   227         <copy file="${lib.path}/${build.lib.common.config}/${lib.filename}" 
       
   228             tofile="${build.result.dir}/${build.lib.common.config}/${lib.filename}" overwrite="true" verbose="true"/>
       
   229     </target>
       
   230 
       
   231     <target name="clean">
       
   232         <antcall target="clean.jar"/>
       
   233         <antcall target="clean.lib"/>
       
   234     </target>
       
   235 	
       
   236     <target name="clean.jar" depends="init" description="">
       
   237         <delete dir="${plugin.dir}/bin"/>
       
   238         <delete file="${build.result.dir}/${jar.filename}" verbose="true"/>
       
   239         <delete file="${export.jar.debug.path}/${jar.filename}" verbose="true"/>
       
   240     	<delete file="${export.jar.release.path}/${jar.filename}" verbose="true"/>
       
   241     </target>
       
   242 
       
   243     <target name="clean.lib">
       
   244         <antcall target="clean.lib.debug"/>
       
   245         <antcall target="clean.lib.release"/>
       
   246     </target>
       
   247 
       
   248     <target name="clean.lib.debug" depends="init">
       
   249         <antcall target="clean.lib.common">
       
   250             <param name="clean.lib.common.config" value="debug"/>
       
   251         </antcall>
       
   252     </target>
       
   253 
       
   254     <target name="clean.lib.release" depends="init">
       
   255         <antcall target="clean.lib.common">
       
   256             <param name="clean.lib.common.config" value="release"/>
       
   257         </antcall>
       
   258     </target>
       
   259 
       
   260     <target name="clean.lib.common" depends="init" description="params: config">
       
   261         <antcall target="make">
       
   262             <param name="make.target" value="clean"/>
       
   263             <param name="fail" value="false"/>
       
   264         </antcall>
       
   265         <delete file="${lib.path}/${lib.makefile}.${clean.lib.common.config}" verbose="true"/>
       
   266         <delete dir="${lib.path}/${generated.native.dir}" verbose="true"/>
       
   267     	<delete dir="${lib.path}/${clean.lib.common.config}" verbose="true"/>
       
   268         <delete file="${build.result.dir}/${clean.lib.common.config}/${lib.filename}" verbose="true"/>
       
   269         <condition property="clean.lib.common.export.path" value="${export.lib.debug.path}" else="${export.lib.release.path}">
       
   270             <equals arg1="${clean.lib.common.config}" arg2="debug"/>
       
   271         </condition>
       
   272         <delete file="${clean.lib.common.export.path}/${lib.filename}" verbose="true"/>
       
   273     </target>
       
   274 
       
   275     <target name="export">
       
   276         <antcall target="export.jar"/>
       
   277         <antcall target="export.lib"/>
       
   278     </target>
       
   279 
       
   280     <target name="export.debug">
       
   281         <antcall target="export.jar.debug"/>
       
   282         <antcall target="export.lib.debug"/>
       
   283     </target>
       
   284 
       
   285     <target name="export.release">
       
   286         <antcall target="export.jar.release"/>
       
   287         <antcall target="export.lib.release"/>
       
   288     </target>
       
   289 
       
   290 	<target name="export.jar">
       
   291 		<antcall target="export.jar.debug"/>
       
   292 		<antcall target="export.jar.release"/>
       
   293 	</target>
       
   294 
       
   295 	<target name="export.jar.debug" depends="build.jar" if="export.jar.debug.path">
       
   296 		<mkdir dir="${export.jar.debug.path}"/>
       
   297 		<copy file="${build.result.dir}/${jar.filename}" 
       
   298             tofile="${export.jar.debug.path}/${jar.filename}" overwrite="true" verbose="true"/>
       
   299 	</target>
       
   300 
       
   301 	<target name="export.jar.release" depends="build.jar" if="export.jar.release.path">
       
   302 		<mkdir dir="${export.jar.release.path}"/>
       
   303 		<copy file="${build.result.dir}/${jar.filename}"
       
   304             tofile="${export.jar.release.path}/${jar.filename}" overwrite="true" verbose="true"/>
       
   305 	</target>
       
   306 
       
   307     <target name="export.lib">
       
   308         <antcall target="export.lib.debug"/>
       
   309         <antcall target="export.lib.release"/>
       
   310     </target>
       
   311 
       
   312     <target name="export.lib.debug" depends="build.lib.debug" if="export.lib.debug.path">
       
   313         <mkdir dir="${export.lib.debug.path}"/>
       
   314         <copy file="${lib.path}/debug/${lib.filename}" 
       
   315             tofile="${export.lib.debug.path}/${lib.filename}" overwrite="true" verbose="true"/>
       
   316     </target>
       
   317 
       
   318     <target name="export.lib.release" depends="build.lib.release" if="export.lib.release.path">
       
   319         <mkdir dir="${export.lib.release.path}"/>
       
   320         <copy file="${lib.path}/release/${lib.filename}"
       
   321             tofile="${export.lib.release.path}/${lib.filename}" overwrite="true" verbose="true"/>
       
   322     </target>
       
   323 
       
   324     <target name="make" description="params: target">
       
   325         <exec executable="${scratchbox.dir}/login" failonerror="true">
       
   326             <arg line="-d ${fragment.scratchbox.dir}"/>
       
   327             <arg line="make --always-make ${make.target}"/>
       
   328         </exec>
       
   329     </target>
       
   330 
       
   331 
       
   332 </project>
       
   333