Path: blob/aarch64-shenandoah-jdk8u272-b10/jdk/src/macosx/native_NOTIOS/jobjc/build.xml
48472 views
<?xml version="1.0" encoding="UTF-8"?>1<!--2#3# Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.4# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.5#6# This code is free software; you can redistribute it and/or modify it7# under the terms of the GNU General Public License version 2 only, as8# published by the Free Software Foundation. Oracle designates this9# particular file as subject to the "Classpath" exception as provided10# by Oracle in the LICENSE file that accompanied this code.11#12# This code is distributed in the hope that it will be useful, but WITHOUT13# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or14# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License15# version 2 for more details (a copy is included in the LICENSE file that16# accompanied this code).17#18# You should have received a copy of the GNU General Public License version19# 2 along with this work; if not, write to the Free Software Foundation,20# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.21#22# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA23# or visit www.oracle.com if you need additional information or have any24# questions.25#26#27-->28<project name="JObjC" default="install" basedir=".">29<property environment="env"/>30<echoproperties/>3132<target name="installhdrs">33<echo>Nothing to do for install-headers build phase</echo>34</target>3536<target name="installsrc">37<echo>Nothing to do for install-source build phase</echo>38</target>3940<property name="redirection-target-defined" value="${env.PRODUCT_NAME}"/>4142<target name="install" description="Redirects to the target specified in $PRODUCT_NAME">43<fail unless="env.PRODUCT_NAME" status="-1">44This Ant build file depends on the native Xcode project to invoke45targets by defining $PRODUCT_NAME to specify the target.46</fail>4748<echo>--- Redirecting to target "${env.PRODUCT_NAME}"</echo>49<antcall target="${env.PRODUCT_NAME}"/>50</target>5152<property name="compile.debug" value="true"/>5354<!-- building from the command line / xcode b&i -->55<condition property="src" value="." else="${env.SRCROOT}">56<not><isset property="env.SRCROOT"/></not>57</condition>5859<condition property="cfg" value="Debug" else="${env.CONFIGURATION}">60<not><isset property="env.CONFIGURATION"/></not>61</condition>6263<condition property="obj" value="build/JObjC.build/${cfg}" else="${env.OBJROOT}">64<not><isset property="env.OBJROOT"/></not>65</condition>6667<condition property="dst" value="build/${cfg}" else="${env.DSTROOT}/${cfg}">68<not><isset property="env.DSTROOT"/></not>69</condition>7071<condition property="ARCHS" value="ppc i386 x86_64" else="${env.RC_ARCHS}">72<not><isset property="env.RC_ARCHS"/></not>73</condition>7475<!-- -/- -->7677<property name="bin" location="${obj}/bin"/>78<property name="gendoc" location="${obj}/doc"/>7980<condition property="nativelib.dir" value="${dst}">81<not><isset property="env.CONFIGURATION_BUILD_DIR"/></not>82</condition>83<condition property="nativelib.dir" value="${env.CONFIGURATION_BUILD_DIR}">84<isset property="env.CONFIGURATION_BUILD_DIR"/>85</condition>86<property name="nativelib.file" location="${nativelib.dir}/libJObjC.dylib" />8788<property name="jniheaders" location="${obj}/src/jni_headers"/>8990<property name="core.src" location="${src}/src/core/java"/>91<property name="core.bin" location="${bin}/core"/>92<property name="core.jniheaders" location="${jniheaders}/core"/>93<property name="core.nativelib.dir" location="${nativelib.dir}"/>9495<property name="generator.src" location="${src}/src/generator/java"/>96<property name="generator.bin" location="${bin}/generator"/>9798<property name="generated.src" location="${obj}/src/jobjc"/>99<property name="generated.bin" location="${bin}/generated"/>100101<property name="additions.src" location="${src}/src/runtime-additions"/>102<property name="additions.bin" location="${bin}/additions"/>103<property name="additions.jniheaders" location="${jniheaders}/additions"/>104<property name="additions.nativelib.dir" location="${nativelib.dir}"/>105106<property name="test.src" location="${src}/src/tests/java"/>107<property name="test.bin" location="${bin}/test"/>108<property name="test.jniheaders" location="${jniheaders}/test"/>109<property name="test.reports" location="${obj}/test-reports"/>110111<condition property="product.target_path"112value="/System/Library/Java/Extensions"113else="${env.INSTALL_PATH}">114<not><isset property="env.INSTALL_PATH"/></not>115</condition>116117<echo message="(Settings :src '${src}' :cfg '${cfg}' :obj '${obj}' :dst '${dst}')"/>118119<path id="test.lib.path.id">120<fileset dir="/usr/share/java">121<include name="**/*.jar"/>122</fileset>123</path>124125<property name="product.jarfile.dir" location="${obj}"/>126<property name="product.jarfile.name" value="JObjC.jar"/>127<property name="product.jarfile" location="${product.jarfile.dir}/${product.jarfile.name}"/>128129<target name="gen-pcoder" description="Generate PrimitiveCoder.java">130<exec executable="ruby" failonerror="true">131<arg value="${src}/run-and-write-if-okay"/>132<arg value="${src}/src/core/PrimitiveCoder.hs"/>133<arg value="${src}/src/core/java/com/apple/jobjc/PrimitiveCoder.java"/>134</exec>135</target>136137<target name="build-core" depends="gen-pcoder" description="Compile the core runtime classes">138<mkdir dir="${core.bin}" />139<!-- Compile PrimitiveCoder first to work around javac bug. -->140<javac srcdir="${core.src}" destdir="${core.bin}" source="1.5" target="1.5" debug="${compile.debug}"141includes="**/PrimitiveCoder.java"142includeantruntime="false">143<classpath>144<path location="${obj}/../langtools/dist/lib/classes.jar"/>145</classpath>146</javac>147<javac srcdir="${core.src}" destdir="${core.bin}" source="1.5" target="1.5" debug="${compile.debug}" includeantruntime="false">148<classpath>149<path location="${obj}/../langtools/dist/lib/classes.jar"/>150</classpath>151</javac>152153<exec executable="/usr/bin/perl" outputproperty="core.classes" failonerror="true">154<arg value="${src}/extract_classes.pl"/>155<arg path="${core.bin}"/>156</exec>157158<mkdir dir="${core.jniheaders}" />159<javah destdir="${core.jniheaders}" class="${core.classes}">160<classpath path="${core.bin}"/>161</javah>162</target>163164<target name="build-core-native" depends="build-core">165<exec executable="xcodebuild" failonerror="true">166<env key="CC" value=""/>167<env key="CXX" value=""/>168<arg value="-configuration"/>169<arg value="${cfg}"/>170<arg value="-target"/>171<arg value="build-core-native"/>172<arg value="SRCROOT=${src}"/>173<arg value="OBJROOT=${obj}"/>174<arg value="DSTROOT=${dst}"/>175<arg value="TARGET_TEMP_DIR=${env.DSTROOT}"/>176<arg value="PROJECT_TEMP_DIR=${env.DSTROOT}"/>177<arg value="BUILD_DIR=${env.DSTROOT}"/>178</exec>179</target>180181<!-- macosx jdk 7 puts jobjc core classes on the bootclasspath by default -->182<target name="build-generator" description="Compile and assemble the generator">183<mkdir dir="${generator.bin}"/>184<javac srcdir="${generator.src}" destdir="${generator.bin}" source="1.5" target="1.5" debug="${compile.debug}" includeantruntime="false">185<compilerarg value="-version"/>186<compilerarg value="-Xbootclasspath/p:${core.bin}"/>187</javac>188</target>189190<!-- Use this indirection hack to work around buildit lockup when191running the generator. -->192<target name="run-generator" depends="build-generator" description="Invoke the assembled generator">193<mkdir dir="${generated.src}"/>194<exec executable="ruby" failonerror="true">195<arg value="${src}/rungen"/>196<arg value="install"/>197<arg value="${product.jarfile.name}"/>198<arg value="${nativelib.dir}"/>199<arg value="${obj}"/>200<arg value="${ARCHS}"/>201<arg value="${env.STABLE_GEN_DIR}"/>202</exec>203</target>204205<target name="run-generator-old" depends="build-generator" description="Invoke the assembled generator">206<mkdir dir="${generated.src}"/>207<java classname="com.apple.internal.jobjc.generator.Generator" fork="true" failonerror="true">208<jvmarg value="-Xms128m" />209<jvmarg value="-Xmx512m" />210<assertions><enable/></assertions>211<classpath>212<path location="${core.bin}"/>213<path location="${generator.bin}"/>214</classpath>215<sysproperty key="java.library.path" value="${core.nativelib.dir}"/>216<arg value="dst=${generated.src}"/>217</java>218</target>219220<target name="build-generated" description="Build and assemble the JObjC core and all generated frameworks">221<mkdir dir="${generated.bin}"/>222<javac srcdir="${generated.src}" destdir="${generated.bin}" source="1.5" target="1.5" fork="yes" memoryMaximumSize="512m" debug="${compile.debug}" includeantruntime="false">223<classpath>224<path location="${core.bin}"/>225</classpath>226<compilerarg value="-version"/>227</javac>228</target>229230<target name="build-additions" depends="build-generated">231<mkdir dir="${additions.bin}"/>232<javac srcdir="${additions.src}" destdir="${additions.bin}" source="1.5" target="1.5" debug="${compile.debug}" includeantruntime="false">233<classpath>234<path location="${core.bin}"/>235<path location="${generated.bin}"/>236</classpath>237<compilerarg value="-version"/>238</javac>239240<exec executable="/usr/bin/perl" outputproperty="additions.classes" failonerror="true">241<arg value="${src}/extract_classes.pl"/>242<arg path="${additions.bin}"/>243</exec>244245<mkdir dir="${additions.jniheaders}"/>246<javah destdir="${additions.jniheaders}" class="${additions.classes}">247<classpath>248<path location="${core.bin}"/>249<path location="${generated.bin}"/>250<path location="${additions.bin}"/>251</classpath>252</javah>253</target>254255<target name="build-additions-native">256<exec executable="xcodebuild" failonerror="true">257<env key="CC" value=""/>258<env key="CXX" value=""/>259<arg value="-configuration"/>260<arg value="${cfg}"/>261<arg value="-target"/>262<arg value="build-additions-native"/>263<arg value="SRCROOT=${src}"/>264<arg value="OBJROOT=${obj}"/>265<arg value="DSTROOT=${dst}"/>266<arg value="TARGET_TEMP_DIR=${env.DSTROOT}"/>267<arg value="PROJECT_TEMP_DIR=${env.DSTROOT}"/>268<arg value="BUILD_DIR=${env.DSTROOT}"/>269</exec>270</target>271272<target name="assemble-product">273<mkdir dir="${product.jarfile.dir}"/>274<jar jarfile="${product.jarfile}" level="9" index="true">275<fileset dir="${core.bin}"/>276<fileset dir="${generated.bin}"/>277<fileset dir="${additions.bin}"/>278</jar>279280<mkdir dir="${dst}/${product.target_path}"/>281<copy file="${product.jarfile}" toDir="${dst}/${product.target_path}" failonerror="true" verbose="true"/>282<copy file="${nativelib.file}" toDir="${dst}/${product.target_path}" failonerror="true" verbose="true"/>283</target>284285<target name="doc-core">286<mkdir dir="${gendoc}"/>287<javadoc destdir="${gendoc}" access="protected">288<fileset dir="${src}/src" includes="**/*.java"/>289</javadoc>290</target>291292<target name="build-test" description="compile unit tests">293<mkdir dir="${test.bin}"/>294<javac srcdir="${test.src}" destdir="${test.bin}" debug="false" includeantruntime="false">295<classpath>296<pathelement location="${core.bin}"/>297<pathelement location="${generator.bin}"/>298<pathelement location="${generated.bin}"/>299<pathelement location="${additions.bin}"/>300</classpath>301<classpath refid="test.lib.path.id"/>302<compilerarg value="-version"/>303</javac>304305<exec executable="/usr/bin/perl" outputproperty="test.classes" failonerror="true">306<arg value="${src}/extract_classes.pl"/>307<arg path="${test.bin}"/>308</exec>309310<mkdir dir="${test.jniheaders}"/>311<javah destdir="${test.jniheaders}" class="${test.classes}">312<classpath>313<path location="${core.bin}"/>314<path location="${generated.bin}"/>315<path location="${additions.bin}"/>316<path location="${test.bin}"/>317</classpath>318<classpath refid="test.lib.path.id"/>319</javah>320</target>321322<target name="build-test-installed" description="compile unit tests">323<mkdir dir="${test.bin}"/>324<javac srcdir="${test.src}" destdir="${test.bin}" debug="false" includeantruntime="false">325<compilerarg value="-verbose"/>326<classpath>327<pathelement location="${generator.bin}"/>328<pathelement location="${generated.bin}"/>329<pathelement location="${additions.bin}"/>330</classpath>331<classpath refid="test.lib.path.id"/>332<compilerarg value="-version"/>333</javac>334335<exec executable="/usr/bin/perl" outputproperty="test.classes" failonerror="true">336<arg value="${src}/extract_classes.pl"/>337<arg path="${test.bin}"/>338</exec>339340<mkdir dir="${test.jniheaders}"/>341<javah destdir="${test.jniheaders}" class="${test.classes}">342<classpath>343<path location="${generated.bin}"/>344<path location="${additions.bin}"/>345<path location="${test.bin}"/>346</classpath>347<classpath refid="test.lib.path.id"/>348</javah>349</target>350351<target name="build-test-native" depends="build-test">352<exec executable="xcodebuild" failonerror="true">353<env key="CC" value=""/>354<env key="CXX" value=""/>355<arg value="-configuration"/>356<arg value="${cfg}"/>357<arg value="-target"/>358<arg value="build-test-native"/>359<arg value="SRCROOT=${src}"/>360<arg value="OBJROOT=${obj}"/>361<arg value="DSTROOT=${dst}"/>362<arg value="TARGET_TEMP_DIR=${env.DSTROOT}"/>363<arg value="PROJECT_TEMP_DIR=${env.DSTROOT}"/>364<arg value="BUILD_DIR=${env.DSTROOT}"/>365</exec>366</target>367368<target name="build-test-native-installed" depends="build-test-installed">369<exec executable="xcodebuild" failonerror="true">370<env key="CC" value=""/>371<env key="CXX" value=""/>372<arg value="-configuration"/>373<arg value="${cfg}"/>374<arg value="-target"/>375<arg value="build-test-native"/>376<arg value="SRCROOT=${src}"/>377<arg value="OBJROOT=${obj}"/>378<arg value="DSTROOT=${dst}"/>379<arg value="TARGET_TEMP_DIR=${env.DSTROOT}"/>380<arg value="PROJECT_TEMP_DIR=${env.DSTROOT}"/>381<arg value="BUILD_DIR=${env.DSTROOT}"/>382</exec>383</target>384385<target name="test" depends="build-test-native" description="run unit tests">386<mkdir dir="${test.reports}"/>387<junit fork="yes" printsummary="yes">388<assertions>389<enable/>390</assertions>391<jvmarg value="-server" />392393<sysproperty key="java.library.path" value="${nativelib.dir}" />394<classpath>395<pathelement location="${core.bin}"/>396<pathelement location="${generator.bin}"/>397<pathelement location="${generated.bin}"/>398<pathelement location="${additions.bin}"/>399<pathelement location="${test.bin}"/>400</classpath>401<classpath refid="test.lib.path.id"/>402403<formatter type="plain"/>404405<batchtest fork="yes" todir="${test.reports}">406<fileset dir="${test.src}">407<include name="**/*Test.java"/>408<exclude name="**/AllTests.java"/>409</fileset>410</batchtest>411</junit>412</target>413414<target name="test-installed" depends="build-test-native-installed" description="run unit tests">415<mkdir dir="${test.reports}"/>416<junit fork="yes" printsummary="yes">417<assertions>418<enable/>419</assertions>420<jvmarg value="-server" />421422<sysproperty key="java.library.path" value="${nativelib.dir}" />423<classpath>424<pathelement location="${generator.bin}"/>425<pathelement location="${generated.bin}"/>426<pathelement location="${additions.bin}"/>427<pathelement location="${test.bin}"/>428</classpath>429<classpath refid="test.lib.path.id"/>430431<formatter type="plain"/>432433<batchtest fork="yes" todir="${test.reports}">434<fileset dir="${test.src}">435<include name="**/*Test.java"/>436<exclude name="**/AllTests.java"/>437</fileset>438</batchtest>439</junit>440</target>441442443<condition property="bench_match" value="*" else="${env.BENCH_MATCH}">444<not><isset property="env.BENCH_MATCH"/></not>445</condition>446447<target name="bench" depends="build-test-native" description="run benchmarks">448<mkdir dir="${test.reports}"/>449<junit fork="yes" printsummary="yes">450<sysproperty key="java.library.path" value="${nativelib.dir}" />451<classpath>452<pathelement location="${core.bin}"/>453<pathelement location="${generator.bin}"/>454<pathelement location="${generated.bin}"/>455<pathelement location="${additions.bin}"/>456<pathelement location="${test.bin}"/>457</classpath>458<classpath refid="test.lib.path.id"/>459460<jvmarg value="-Xms256m" />461<jvmarg value="-Xmx1024m" />462<jvmarg value="-server" />463464<formatter type="plain"/>465466<batchtest fork="yes" todir="${test.reports}">467<fileset dir="${test.src}">468<include name="**/Bench*${bench_match}*.java"/>469</fileset>470</batchtest>471</junit>472</target>473474<target name="bench-installed" depends="build-test-native-installed" description="run benchmarks">475<mkdir dir="${test.reports}"/>476<junit fork="yes" printsummary="yes">477<sysproperty key="java.library.path" value="${nativelib.dir}" />478<classpath>479<pathelement location="${generator.bin}"/>480<pathelement location="${generated.bin}"/>481<pathelement location="${additions.bin}"/>482<pathelement location="${test.bin}"/>483</classpath>484<classpath refid="test.lib.path.id"/>485486<jvmarg value="-Xms256m" />487<jvmarg value="-Xmx1024m" />488<jvmarg value="-server" />489490<formatter type="plain"/>491492<batchtest fork="yes" todir="${test.reports}">493<fileset dir="${test.src}">494<include name="**/Bench*${bench_match}*.java"/>495</fileset>496</batchtest>497</junit>498</target>499500<target name="clean">501<delete dir="build"/>502<delete dir="${obj}"/>503<delete dir="${dst}"/>504<delete dir="${gendoc}"/>505<delete dir="${test.reports}"/>506</target>507508509<target name="clean-all" depends="clean,build-core,build-core-native,build-generator,run-generator,build-generated,build-additions,build-additions-native,assemble-product">510</target>511<target name="all" depends="build-core,build-core-native,build-generator,run-generator,build-generated,build-additions,build-additions-native,assemble-product">512</target>513<target name="all-test" depends="build-core,build-core-native,build-generator,run-generator,build-generated,build-additions,build-additions-native,assemble-product,test-installed">514</target>515<target name="clean-all-test" depends="clean,build-core,build-core-native,build-generator,run-generator,build-generated,build-additions,build-additions-native,assemble-product,test-installed">516</target>517<target name="all-but-gen" depends="clean,build-core,build-core-native,build-generator,build-generated,build-additions,build-additions-native,assemble-product">518</target>519</project>520521522