1 /*
   2  * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   5  * This code is free software; you can redistribute it and/or modify it
   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.  Oracle designates this
   8  * particular file as subject to the "Classpath" exception as provided
   9  * by Oracle in the LICENSE file that accompanied this code.
  10  *
  11  * This code is distributed in the hope that it will be useful, but WITHOUT
  12  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  13  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  14  * version 2 for more details (a copy is included in the LICENSE file that
  15  * accompanied this code).
  16  *
  17  * You should have received a copy of the GNU General Public License version
  18  * 2 along with this work; if not, write to the Free Software Foundation,
  19  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  20  *
  21  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  22  * or visit www.oracle.com if you need additional information or have any
  23  * questions.
  24  */
  25 
  26 ext.IOS = [:]
  27 
  28 if (BUILD_CLOSED) {
  29     fetchExternalTools('IOS', 
  30       ["ios-libs-08.tgz"], 
  31       rootProject.CROSS_TOOLS_DIR, rootProject.IS_IMPORT_CROSS_TOOLS)
  32 }
  33 
  34 // TODO Check for presence of iOS tools
  35 IOS.canBuild = IS_MAC
  36 if (!IOS.canBuild) return;
  37 
  38 IOS.compileSwing = false;
  39 IOS.compileSWT = false;
  40 IOS.compileFXPackager = false;
  41 
  42 defineProperty("USE_LIPO", "false")
  43 IOS.useLipo = Boolean.parseBoolean(USE_LIPO)
  44 
  45 defineProperty("GENERATE_SYMBOLS", "false")
  46 IOS.generateSymbols = Boolean.parseBoolean(GENERATE_SYMBOLS)
  47 
  48 defineProperty("BUILD_IOS_TOOLS", "true")
  49 ext.IS_BUILD_IOS_TOOLS = Boolean.parseBoolean(BUILD_IOS_TOOLS)
  50 
  51 IOS.generateSymbolsExcludes = [
  52     "libprism_sw.a",
  53     "libdecora_sse_armv7.a"
  54 ]
  55 
  56 defineProperty("IOS_VERSION", "7.0")
  57 
  58 // Lambda for naming the generated libs
  59 IOS.library = { name -> return "lib${name}.a" as String }
  60 
  61 IOS.libDest = "lib"
  62 
  63 IOS.jfxrtJarExcludes = [
  64     "**/*.hlsl",
  65     "com/sun/glass/ui/win",
  66     "com/sun/prism/d3d",
  67     "com/sun/prism/es2/gl/win",
  68     "com/sun/prism/null3d",
  69     "com/sun/scenario/effect/impl/hw/d3d",
  70     
  71     "com/sun/glass/events/mac",
  72     "com/sun/glass/ui/mac",
  73     "com/sun/prism/es2/gl/mac",
  74     "com/sun/glass/ui/android",
  75     "com/sun/glass/ui/gtk",
  76     
  77     "com/sun/glass/ui/lens",
  78     "com/sun/prism/es2/gl/eglfb",
  79     "com/sun/prism/es2/gl/eglx11",
  80     "com/sun/prism/es2/gl/x11",
  81     
  82     "com/sun/glass/ui/swt", // SWT glass
  83     
  84     "javafx/embed/swing", // Swing Interop
  85     
  86     "javafx/embed/swt", // SWT Interop
  87 ]
  88 
  89 def archArm = "armv7"
  90 def archX86 = "i386"
  91 def iPhoneOS = "iPhoneOS"
  92 def iPhoneSim = "iPhoneSimulator"
  93 
  94 String sdkPath(String platform) {
  95     return "/Applications/Xcode.app/Contents/Developer/Platforms/${platform}.platform/Developer/SDKs/${platform}${IOS_VERSION}.sdk";
  96 }
  97 
  98 def linkFlags = [
  99     "-static",
 100     "-framework", "Foundation",
 101     "-framework", "CoreGraphics",
 102     "-framework", "CoreText",
 103     "-framework", "UIKit",
 104     "-framework", "QuartzCore",
 105     "-framework", "OpenGLES"].flatten()
 106 
 107 def ccFlags = [
 108     "-miphoneos-version-min=6.0", "-fmessage-length=0", "-std=c99", "-fno-common",
 109     "-Wall", "-fno-strict-aliasing", "-fwrapv", "-fpascal-strings", "-fobjc-abi-version=2", "-fobjc-legacy-dispatch",
 110     "-I$JDK_HOME/include", "-I$JDK_HOME/include/darwin", "-c",
 111     IS_DEBUG_NATIVE ? ["-O0", "-DDEBUG", "-g"] : ["-O3", "-DNDEBUG"]].flatten()
 112 
 113 def compiler = "clang"
 114 def linker = "libtool"
 115 
 116 IOS.javafxPlatformProperties ="""javafx.platform=ios
 117 ios.jfxmedia.platforms=IOSPlatform
 118 ios.glass.platform=ios
 119 ios.prism.allowhidpi=false
 120 ios.prism.mintexturesize=16
 121 ios.prism.verbose=true
 122 ios.prism.static.libraries=true
 123 ios.prism.useNativeIIO=false"""
 124 
 125 IOS.glass = [:]
 126 IOS.glass.variants = ["arm", "x86"];
 127 IOS.glass.javahInclude = [
 128     "com/sun/glass/events/**",
 129     "com/sun/glass/ui/*",
 130     "com/sun/glass/ui/ios/*"]
 131 IOS.glass.lib = "glass"
 132 
 133 IOS.glass.arm = [:]
 134 IOS.glass.arm.nativeSource = file("modules/graphics/src/main/native-glass/ios")
 135 IOS.glass.arm.compiler = compiler
 136 IOS.glass.arm.ccFlags = ["-x", "objective-c", ccFlags, "-arch", archArm, "-isysroot", sdkPath(iPhoneOS)].flatten()
 137 IOS.glass.arm.linker = linker
 138 IOS.glass.arm.linkFlags = ["-arch_only", archArm, "-syslibroot", sdkPath(iPhoneOS), linkFlags, "-L${sdkPath(iPhoneOS)}/usr/lib"].flatten()
 139 IOS.glass.arm.lib = "glass_${archArm}"
 140 
 141 IOS.glass.x86 = [:]
 142 IOS.glass.x86.nativeSource = file("modules/graphics/src/main/native-glass/ios")
 143 IOS.glass.x86.compiler = compiler
 144 IOS.glass.x86.ccFlags = ["-x", "objective-c", ccFlags, "-arch", archX86, "-isysroot", sdkPath(iPhoneSim)].flatten()
 145 IOS.glass.x86.linker = linker
 146 IOS.glass.x86.linkFlags = ["-arch_only", archX86, "-syslibroot", sdkPath(iPhoneSim), linkFlags, "-L${sdkPath(iPhoneSim)}/usr/lib"].flatten()
 147 IOS.glass.x86.lib = "glass_${archX86}"
 148 
 149 IOS.extensions = [:]
 150 IOS.extensions.variants = ["arm", "x86"];
 151 IOS.extensions.javahSource = files("modules/extensions/build/classes/ios")
 152 IOS.extensions.javahClasspath = files("modules/extensions/build/classes/ios/")
 153 IOS.extensions.javahInclude = ["com/sun/javafx/ext/device/ios/**/*"]
 154 IOS.extensions.lib = "extensions_ios"
 155 
 156 IOS.extensions.arm = [:]
 157 IOS.extensions.arm.nativeSource = file("modules/extensions/src/ios/native-device/ios")
 158 IOS.extensions.arm.compiler = compiler
 159 IOS.extensions.arm.ccFlags = ["-x", "objective-c", ccFlags, "-arch", archArm, "-isysroot", sdkPath(iPhoneOS)].flatten()
 160 IOS.extensions.arm.linker = linker
 161 IOS.extensions.arm.linkFlags = ["-arch_only", archArm, "-syslibroot", sdkPath(iPhoneOS), linkFlags, "-L${sdkPath(iPhoneOS)}/usr/lib"].flatten()
 162 IOS.extensions.arm.lib = "extensions_ios_${archArm}"
 163 
 164 IOS.extensions.x86 = [:]
 165 IOS.extensions.x86.nativeSource = file("modules/extensions/src/ios/native-device/ios")
 166 IOS.extensions.x86.compiler = compiler
 167 IOS.extensions.x86.ccFlags = ["-x", "objective-c", ccFlags, "-arch", archX86, "-isysroot", sdkPath(iPhoneSim)].flatten()
 168 IOS.extensions.x86.linker = linker
 169 IOS.extensions.x86.linkFlags = ["-arch_only", archX86, "-syslibroot", sdkPath(iPhoneSim), linkFlags, "-L${sdkPath(iPhoneSim)}/usr/lib"].flatten()
 170 IOS.extensions.x86.lib = "extensions_ios_${archX86}"
 171 
 172 IOS.decora = [:]
 173 IOS.decora.compiler = compiler
 174 IOS.decora.ccFlags = [ccFlags, "-arch", archArm, "-isysroot", sdkPath(iPhoneOS), "-ffast-math"].flatten()
 175 IOS.decora.linker = linker
 176 IOS.decora.linkFlags = ["-arch_only", archArm, "-syslibroot", sdkPath(iPhoneOS), linkFlags].flatten()
 177 IOS.decora.lib = "decora_sse_${archArm}"
 178 
 179 IOS.prism = [:]
 180 IOS.prism.lib = "prism_common"
 181 IOS.prism.javahInclude = ["com/sun/prism/impl/**/*", "com/sun/prism/PresentableState*"]
 182 IOS.prism.variants = ["arm", "x86"];
 183 
 184 IOS.prism.arm = [:]
 185 IOS.prism.arm.nativeSource = file("modules/graphics/src/main/native-prism")
 186 IOS.prism.arm.compiler = compiler
 187 IOS.prism.arm.ccFlags = [ccFlags, "-arch", archArm, "-isysroot", sdkPath(iPhoneOS), "-DINLINE=inline"].flatten()
 188 IOS.prism.arm.linker = linker
 189 IOS.prism.arm.linkFlags = ["-arch_only", archArm, "-syslibroot", sdkPath(iPhoneOS), linkFlags].flatten()
 190 IOS.prism.arm.lib = "prism_common_${archArm}"
 191 
 192 IOS.prism.x86 = [:]
 193 IOS.prism.x86.nativeSource = file("modules/graphics/src/main/native-prism")
 194 IOS.prism.x86.compiler = compiler
 195 IOS.prism.x86.ccFlags = [ccFlags, "-arch", archX86, "-isysroot", sdkPath(iPhoneSim), "-DINLINE=inline"].flatten()
 196 IOS.prism.x86.linker = linker
 197 IOS.prism.x86.linkFlags = ["-arch_only", archX86, "-syslibroot", sdkPath(iPhoneSim), linkFlags].flatten()
 198 IOS.prism.x86.lib = "prism_common_${archX86}"
 199 
 200 IOS.prismSW = [:]
 201 IOS.prismSW.lib = "prism_sw"
 202 IOS.prismSW.javahInclude = ["com/sun/pisces/**/*"]
 203 IOS.prismSW.variants = ["arm", "x86"];
 204 
 205 IOS.prismSW.arm = [:]
 206 IOS.prismSW.arm.nativeSource = file("modules/graphics/src/main/native-prism-sw")
 207 IOS.prismSW.arm.compiler = compiler
 208 IOS.prismSW.arm.ccFlags = [IOS.prism.arm.ccFlags].flatten()
 209 IOS.prismSW.arm.linker = linker
 210 IOS.prismSW.arm.linkFlags = [IOS.prism.arm.linkFlags].flatten()
 211 IOS.prismSW.arm.lib = "prism_sw_${archArm}"
 212 
 213 IOS.prismSW.x86 = [:]
 214 IOS.prismSW.x86.nativeSource = file("modules/graphics/src/main/native-prism-sw")
 215 IOS.prismSW.x86.compiler = compiler
 216 IOS.prismSW.x86.ccFlags = [IOS.prism.x86.ccFlags].flatten()
 217 IOS.prismSW.x86.linker = linker
 218 IOS.prismSW.x86.linkFlags = [IOS.prism.x86.linkFlags].flatten()
 219 IOS.prismSW.x86.lib = "prism_sw_${archX86}"
 220 
 221 IOS.iio = [:]
 222 IOS.iio.lib = "javafx_iio"
 223 IOS.iio.javahInclude = ["com/sun/javafx/iio/**/*"]
 224 IOS.iio.variants = ["arm", "x86"];
 225 
 226 IOS.iio.arm = [:]
 227 IOS.iio.arm.nativeSource = [
 228     file("modules/graphics/src/main/native-iio"),
 229     file("modules/graphics/src/main/native-iio/ios"),
 230     file("modules/graphics/src/main/native-iio/libjpeg7")]
 231 IOS.iio.arm.compiler = compiler
 232 IOS.iio.arm.ccFlags = ["-x", "objective-c", ccFlags, "-arch", archArm, "-isysroot", sdkPath(iPhoneOS), "-ffast-math"].flatten()
 233 IOS.iio.arm.linker = linker
 234 IOS.iio.arm.linkFlags = ["-arch_only", archArm, "-syslibroot", sdkPath(iPhoneOS), linkFlags].flatten()
 235 IOS.iio.arm.lib = "javafx_iio_${archArm}"
 236 
 237 IOS.iio.x86 = [:]
 238 IOS.iio.x86.nativeSource = [IOS.iio.arm.nativeSource].flatten()
 239 IOS.iio.x86.compiler = compiler
 240 IOS.iio.x86.ccFlags = ["-x", "objective-c", ccFlags, "-arch", archX86, "-isysroot", sdkPath(iPhoneSim), "-ffast-math"].flatten()
 241 IOS.iio.x86.linker = linker
 242 IOS.iio.x86.linkFlags = ["-arch_only", archX86, "-syslibroot", sdkPath(iPhoneSim), linkFlags].flatten()
 243 IOS.iio.x86.lib = "javafx_iio_${archX86}"
 244 
 245 IOS.prismES2 = [:]
 246 IOS.prismES2.lib = "prism_es2"
 247 IOS.prismES2.javahInclude = ["com/sun/prism/es2/**/*"]
 248 IOS.prismES2.variants = ["arm", "x86"];
 249 
 250 IOS.prismES2.arm = [:]
 251 IOS.prismES2.arm.nativeSource = [
 252     file("modules/graphics/src/main/native-prism-es2"),
 253     file("modules/graphics/src/main/native-prism-es2/GL"),
 254     file("modules/graphics/src/main/native-prism-es2/ios")
 255 ]
 256 IOS.prismES2.arm.compiler = compiler
 257 IOS.prismES2.arm.ccFlags = ["-x", "objective-c", ccFlags, "-arch", archArm, "-isysroot", sdkPath(iPhoneOS)].flatten()
 258 IOS.prismES2.arm.linker = linker
 259 IOS.prismES2.arm.linkFlags = ["-arch_only", archArm, "-syslibroot", sdkPath(iPhoneOS), linkFlags].flatten()
 260 IOS.prismES2.arm.lib = "prism_es2_${archArm}"
 261 
 262 IOS.prismES2.x86 = [:]
 263 IOS.prismES2.x86.nativeSource = [IOS.prismES2.arm.nativeSource].flatten()
 264 IOS.prismES2.x86.compiler = compiler
 265 IOS.prismES2.x86.ccFlags = ["-x", "objective-c", ccFlags, "-arch", archX86, "-isysroot", sdkPath(iPhoneSim)].flatten()
 266 IOS.prismES2.x86.linker = linker
 267 IOS.prismES2.x86.linkFlags = ["-arch_only", archX86, "-syslibroot", sdkPath(iPhoneSim), linkFlags].flatten()
 268 IOS.prismES2.x86.lib = "prism_es2_${archX86}"
 269 
 270 def closedDir = file("$projectDir/../rt-closed")
 271 IOS.font = [:]
 272 IOS.font.lib = "javafx_font"
 273 IOS.font.javahInclude = [
 274         "com/sun/javafx/font/**/*",
 275         "com/sun/javafx/text/**/*"]
 276 IOS.font.variants = ["arm", "x86"];
 277 
 278 IOS.font.arm = [:]
 279 IOS.font.arm.nativeSource = [file("modules/graphics/src/main/native-font")]
 280 IOS.font.arm.compiler = compiler
 281 IOS.font.arm.ccFlags = ["-DJFXFONT_PLUS", ccFlags, "-arch", archArm, "-isysroot", sdkPath(iPhoneOS)].flatten()
 282 IOS.font.arm.linker = linker
 283 IOS.font.arm.linkFlags = ["-arch_only", archArm, "-syslibroot", sdkPath(iPhoneOS), linkFlags].flatten()
 284 IOS.font.arm.lib = "javafx_font_${archArm}"
 285 
 286 IOS.font.x86 = [:]
 287 IOS.font.x86.nativeSource = [IOS.font.arm.nativeSource].flatten()
 288 IOS.font.x86.compiler = compiler
 289 IOS.font.x86.ccFlags = ["-DJFXFONT_PLUS", ccFlags, "-arch", archX86, "-isysroot", sdkPath(iPhoneSim)].flatten()
 290 IOS.font.x86.linker = linker
 291 IOS.font.x86.linkFlags = ["-arch_only", archX86, "-syslibroot", sdkPath(iPhoneSim), linkFlags].flatten()
 292 IOS.font.x86.lib = "javafx_font_${archX86}"
 293 
 294 IOS.fontT2K = [:]
 295 IOS.fontT2K.lib = "javafx_font_t2k"
 296 IOS.fontT2K.javahInclude = ["com/sun/javafx/font/t2k/**/*"]
 297 IOS.fontT2K.variants = ["arm", "x86"];
 298 
 299 IOS.fontT2K.arm = [:]
 300 IOS.fontT2K.arm.nativeSource = [
 301         file("$closedDir/javafx-font-t2k-native/src"),
 302         file("$closedDir/javafx-font-t2k-native/src/layout")]
 303 IOS.fontT2K.arm.compiler = compiler
 304 IOS.fontT2K.arm.ccFlags = ["-DJFXFONT_PLUS", "-DLE_STANDALONE", ccFlags, "-arch", archArm, "-isysroot", sdkPath(iPhoneOS)].flatten()
 305 IOS.fontT2K.arm.linker = linker
 306 IOS.fontT2K.arm.linkFlags = ["-arch_only", archArm, "-syslibroot", sdkPath(iPhoneOS), linkFlags].flatten()
 307 IOS.fontT2K.arm.lib = "javafx_font_t2k_${archArm}"
 308 
 309 IOS.fontT2K.x86 = [:]
 310 IOS.fontT2K.x86.nativeSource = [IOS.fontT2K.arm.nativeSource].flatten()
 311 IOS.fontT2K.x86.compiler = compiler
 312 IOS.fontT2K.x86.ccFlags = ["-DJFXFONT_PLUS", "-DLE_STANDALONE", ccFlags, "-arch", archX86, "-isysroot", sdkPath(iPhoneSim)].flatten()
 313 IOS.fontT2K.x86.linker = linker
 314 IOS.fontT2K.x86.linkFlags = ["-arch_only", archX86, "-syslibroot", sdkPath(iPhoneSim), linkFlags].flatten()
 315 IOS.fontT2K.x86.lib = "javafx_font_t2k_${archX86}"
 316 
 317 IOS.webview = [:]
 318 IOS.webview.lib = "javafx_ios_webnode"
 319 IOS.webview.javahInclude = ["javafx/scene/web/*"]
 320 IOS.webview.variants = ["arm", "x86"];
 321 
 322 IOS.webview.arm = [:]
 323 IOS.webview.arm.nativeSource = file("modules/web/src/ios/native")
 324 IOS.webview.arm.compiler = compiler
 325 IOS.webview.arm.ccFlags = [ccFlags, "-arch", archArm, "-isysroot", sdkPath(iPhoneOS)].flatten()
 326 IOS.webview.arm.linker = linker
 327 IOS.webview.arm.linkFlags = ["-arch_only", archArm, "-syslibroot", sdkPath(iPhoneOS), linkFlags].flatten()
 328 IOS.webview.arm.lib = "javafx_ios_webnode_${archArm}"
 329 
 330 IOS.webview.x86 = [:]
 331 IOS.webview.x86.nativeSource = [IOS.webview.arm.nativeSource].flatten()
 332 IOS.webview.x86.compiler = compiler
 333 IOS.webview.x86.ccFlags = [ccFlags, "-arch", archX86, "-isysroot", sdkPath(iPhoneSim)].flatten()
 334 IOS.webview.x86.linker = linker
 335 IOS.webview.x86.linkFlags = ["-arch_only", archX86, "-syslibroot", sdkPath(iPhoneSim), linkFlags].flatten()
 336 IOS.webview.x86.lib = "javafx_ios_webnode_${archX86}"
 337 
 338 project(":web") {
 339     apply plugin: 'java'
 340 
 341     compileJava {
 342         enabled = false
 343     }
 344 
 345     afterEvaluate {
 346         def compileWebJavaIos = task("compileWebJavaIos",
 347             type: JavaCompile, group: "Build") {
 348 
 349             dependsOn(project(":graphics").classes, project(":base").classes)
 350             description = "Task compiles web component for iOS."
 351             classpath = files(
 352                 project(":controls").sourceSets.main.output.classesDir,
 353                 project(":graphics").sourceSets.main.output.classesDir,
 354                 project(":base").sourceSets.main.output.classesDir
 355             )
 356             destinationDir = file("modules/web/build/classes/ios")
 357             sourceSets.main.output.classesDir = destinationDir
 358             dependencyCacheDir = file("modules/web/build/dependency-cache")
 359             source file("modules/web/src/ios/java")
 360             doLast {
 361                 copy {
 362                     from "modules/web/src/ios/resources"
 363                     into "modules/web/build/resources/ios"
 364                 }
 365             }
 366         }
 367 
 368         def jarWebJavaIos = task("jarWebJavaIos",
 369             type: Jar, group: "Build") {
 370             description = "Creates web.jar for iOS."
 371             dependsOn(compileWebJavaIos)
 372             archiveName = "web.jar"
 373             includeEmptyDirs = false
 374             destinationDir = project.file("build/libs/ios")
 375             from("build/classes/ios")
 376         }
 377 
 378         addNative(project, "webview")
 379         javahIosWebview.dependsOn(compileWebJavaIos)
 380         javahIosWebview.classpath += files(project(":base").sourceSets.main.output.classesDir,
 381                              project(":graphics").sourceSets.main.output.classesDir,
 382                              project(":controls").sourceSets.main.output.classesDir)
 383 
 384         jfxrtIos {
 385             from ("modules/web/build/classes/ios", "modules/web/build/resources/main");
 386             exclude("com/sun/webkit", "com/sun/javafx/webkit");
 387         }
 388 
 389         sdkIos  {
 390             dependsOn(jarWebJavaIos)
 391             doLast {
 392                 def props = project.ext["IOS"]
 393                 copy {
 394                     if (props.useLipo) {
 395                         from ("modules/web/build/libs/webview/ios/${props.library(props.webview.lib)}")
 396                     } else {
 397                         from ("modules/web/build/libs/webview/ios")
 398                     }
 399                     into ("build/ios-sdk/rt/${props.libDest}")
 400                 }
 401             }
 402         }
 403     }
 404 }
 405 
 406 IOS.media = [:]
 407 IOS.media.lib = "jfxmedia"
 408 IOS.media.javahSource = files("modules/media/build/classes/main")
 409 IOS.media.javahClasspath = files("modules/media/build/classes/main")
 410 IOS.media.javahInclude = ["com/sun/media/jfxmediaimpl/*"]
 411 IOS.media.variants = ["arm", "x86"];
 412 
 413 IOS.media.arm = [:]
 414 IOS.media.arm.nativeSource = [
 415     file("modules/media/src/main/native/jfxmedia/platform/ios"),
 416     file("modules/media/src/main/native/jfxmedia/platform/ios/jni")
 417 ]
 418 IOS.media.arm.compiler = compiler
 419 IOS.media.arm.ccFlags = ["-x", "objective-c", ccFlags, "-arch", archArm, "-isysroot", sdkPath(iPhoneOS)].flatten()
 420 IOS.media.arm.linker = linker
 421 IOS.media.arm.linkFlags = ["-arch_only", archArm, "-syslibroot", sdkPath(iPhoneOS), linkFlags].flatten()
 422 IOS.media.arm.lib = "jfxmedia_${archArm}"
 423 
 424 IOS.media.x86 = [:]
 425 IOS.media.x86.nativeSource = [IOS.media.arm.nativeSource].flatten()
 426 IOS.media.x86.compiler = compiler
 427 IOS.media.x86.ccFlags = ["-x", "objective-c", ccFlags, "-arch", archX86, "-isysroot", sdkPath(iPhoneSim)].flatten()
 428 IOS.media.x86.linker = linker
 429 IOS.media.x86.linkFlags = ["-arch_only", archX86, "-syslibroot", sdkPath(iPhoneSim), linkFlags].flatten()
 430 IOS.media.x86.lib = "jfxmedia_${archX86}"
 431 
 432 project(":media") {
 433     afterEvaluate {
 434         addNative(project, "media")
 435 
 436         sdkIos  {
 437             doLast {
 438                 def props = project.ext["IOS"]
 439                 copy {
 440                     if (props.useLipo) {
 441                         from ("modules/media/build/libs/media/ios/${props.library(props.media.lib)}")
 442                     } else {
 443                         from ("modules/media/build/libs/media/ios")
 444                     }
 445                     into ("build/ios-sdk/rt/${props.libDest}")
 446                 }
 447             }
 448         }
 449     }
 450 }
 451 
 452 project(":extensions") {
 453     apply plugin: 'java'
 454 
 455     compileJava {
 456         destinationDir = file("build/classes/ios")
 457         source file("src/ios/java")
 458     }
 459     
 460     jar {
 461         from("build/classes/ios")
 462     }
 463     
 464     afterEvaluate {
 465 
 466         addNative(project, "extensions")
 467         javahIosExtensions.classpath += files(project(":base").sourceSets.main.output.classesDir,
 468                              project(":graphics").sourceSets.main.output.classesDir)
 469 
 470         sdkIos  {
 471             doLast {
 472                 def props = project.ext["IOS"]
 473                 copy {
 474                     if (props.useLipo) {
 475                         from ("modules/extensions/build/libs/extensions/ios/${props.library(props.extensions.lib)}")
 476                     } else {
 477                         from ("modules/extensions/build/libs/extensions/ios")
 478                     }
 479                     into ("build/ios-sdk/rt/${props.libDest}")
 480                 }
 481             }
 482         }
 483     }
 484 }