| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1160,10 +1160,13 @@ protected boolean exportApplication(File destFolder, | |||
| 1160 | 1160 | /// on macosx, need to copy .app skeleton since that's | |
| 1161 | 1161 | /// also where the jar files will be placed | |
| 1162 | 1162 | File dotAppFolder = null; | |
| 1163 | + String jdkFolderName = null; | ||
| 1163 | 1164 | if (exportPlatform == PConstants.MACOSX) { | |
| 1164 | 1165 | dotAppFolder = new File(destFolder, sketch.getName() + ".app"); | |
| 1165 | 1166 | ||
| 1166 | 1167 | File contentsOrig = new File(Base.getJavaHome(), "../../../../.."); | |
| 1168 | + File jdkFolder = new File(Base.getJavaHome(), "../../.."); | ||
| 1169 | + jdkFolderName = jdkFolder.getCanonicalFile().getName(); | ||
| 1167 | 1170 | ||
| 1168 | 1171 | // File dotAppSkeleton = mode.getContentFile("application/template.app"); | |
| 1169 | 1172 | // Base.copyDir(dotAppSkeleton, dotAppFolder); | |
@@ -1409,13 +1412,22 @@ protected boolean exportApplication(File destFolder, | |||
| 1409 | 1412 | ||
| 1410 | 1413 | /// figure out run options for the VM | |
| 1411 | 1414 | ||
| 1412 | - String runOptions = Preferences.get("run.options"); | ||
| 1415 | + // this is too vague. if anyone is using it, we can bring it back | ||
| 1416 | + // String runOptions = Preferences.get("run.options"); | ||
| 1417 | + List<String> runOptions = new ArrayList<String>(); | ||
| 1413 | 1418 | if (Preferences.getBoolean("run.options.memory")) { | |
| 1414 | - runOptions += " -Xms" + | ||
| 1415 | - Preferences.get("run.options.memory.initial") + "m"; | ||
| 1416 | - runOptions += " -Xmx" + | ||
| 1417 | - Preferences.get("run.options.memory.maximum") + "m"; | ||
| 1419 | + runOptions.add("-Xms" + Preferences.get("run.options.memory.initial") + "m"); | ||
| 1420 | + runOptions.add("-Xmx" + Preferences.get("run.options.memory.maximum") + "m"); | ||
| 1418 | 1421 | } | |
| 1422 | + | ||
| 1423 | + StringBuilder jvmOptionsList = new StringBuilder(); | ||
| 1424 | + for (String opt : runOptions) { | ||
| 1425 | + jvmOptionsList.append(" <string>"); | ||
| 1426 | + jvmOptionsList.append(opt); | ||
| 1427 | + jvmOptionsList.append("</string>"); | ||
| 1428 | + jvmOptionsList.append('\n'); | ||
| 1429 | + } | ||
| 1430 | + | ||
| 1419 | 1431 | // if (exportPlatform == PConstants.MACOSX) { | |
| 1420 | 1432 | // // If no bits specified (libs are all universal, or no native libs) | |
| 1421 | 1433 | // // then exportBits will be 0, and can be controlled via "Get Info". | |
@@ -1430,10 +1442,12 @@ protected boolean exportApplication(File destFolder, | |||
| 1430 | 1442 | /// macosx: write out Info.plist (template for classpath, etc) | |
| 1431 | 1443 | ||
| 1432 | 1444 | if (exportPlatform == PConstants.MACOSX) { | |
| 1433 | - String PLIST_TEMPLATE = "template.plist"; | ||
| 1445 | + //String PLIST_TEMPLATE = "template.plist"; | ||
| 1446 | + String PLIST_TEMPLATE = "Info.plist.tmpl"; | ||
| 1434 | 1447 | File plistTemplate = new File(sketch.getFolder(), PLIST_TEMPLATE); | |
| 1435 | 1448 | if (!plistTemplate.exists()) { | |
| 1436 | - plistTemplate = mode.getContentFile("application/template.plist"); | ||
| 1449 | + //plistTemplate = mode.getContentFile("application/template.plist"); | ||
| 1450 | + plistTemplate = mode.getContentFile("application/Info.plist.tmpl"); | ||
| 1437 | 1451 | } | |
| 1438 | 1452 | File plistFile = new File(dotAppFolder, "Contents/Info.plist"); | |
| 1439 | 1453 | PrintWriter pw = PApplet.createWriter(plistFile); | |
@@ -1443,33 +1457,37 @@ protected boolean exportApplication(File destFolder, | |||
| 1443 | 1457 | if (lines[i].indexOf("@@") != -1) { | |
| 1444 | 1458 | StringBuffer sb = new StringBuffer(lines[i]); | |
| 1445 | 1459 | int index = 0; | |
| 1446 | - while ((index = sb.indexOf("@@vmoptions@@")) != -1) { | ||
| 1447 | - sb.replace(index, index + "@@vmoptions@@".length(), | ||
| 1448 | - runOptions); | ||
| 1460 | + while ((index = sb.indexOf("@@jdk_folder@@")) != -1) { | ||
| 1461 | + sb.replace(index, index + "@@jdk_folder@@".length(), | ||
| 1462 | + jdkFolderName); | ||
| 1463 | + } | ||
| 1464 | + while ((index = sb.indexOf("@@jvm_options_list@@")) != -1) { | ||
| 1465 | + sb.replace(index, index + "@@jvm_options_list@@".length(), | ||
| 1466 | + jvmOptionsList.toString()); | ||
| 1449 | 1467 | } | |
| 1450 | 1468 | while ((index = sb.indexOf("@@sketch@@")) != -1) { | |
| 1451 | 1469 | sb.replace(index, index + "@@sketch@@".length(), | |
| 1452 | 1470 | sketch.getName()); | |
| 1453 | 1471 | } | |
| 1454 | - while ((index = sb.indexOf("@@classpath@@")) != -1) { | ||
| 1455 | - sb.replace(index, index + "@@classpath@@".length(), | ||
| 1456 | - exportClassPath.toString()); | ||
| 1457 | - } | ||
| 1472 | + // while ((index = sb.indexOf("@@classpath@@")) != -1) { | ||
| 1473 | + // sb.replace(index, index + "@@classpath@@".length(), | ||
| 1474 | + // exportClassPath.toString()); | ||
| 1475 | + // } | ||
| 1458 | 1476 | while ((index = sb.indexOf("@@lsuipresentationmode@@")) != -1) { | |
| 1459 | 1477 | sb.replace(index, index + "@@lsuipresentationmode@@".length(), | |
| 1460 | 1478 | Preferences.getBoolean("export.application.fullscreen") ? "4" : "0"); | |
| 1461 | 1479 | } | |
| 1462 | - while ((index = sb.indexOf("@@lsarchitecturepriority@@")) != -1) { | ||
| 1463 | - // More about this mess: http://support.apple.com/kb/TS2827 | ||
| 1464 | - // First default to exportBits == 0 case | ||
| 1465 | - String arch = "<string>x86_64</string>\n <string>i386</string>"; | ||
| 1466 | - if (exportBits == 32) { | ||
| 1467 | - arch = "<string>i386</string>"; | ||
| 1468 | - } else if (exportBits == 64) { | ||
| 1469 | - arch = "<string>x86_64</string>"; | ||
| 1470 | - } | ||
| 1471 | - sb.replace(index, index + "@@lsarchitecturepriority@@".length(), arch); | ||
| 1472 | - } | ||
| 1480 | + // while ((index = sb.indexOf("@@lsarchitecturepriority@@")) != -1) { | ||
| 1481 | + // // More about this mess: http://support.apple.com/kb/TS2827 | ||
| 1482 | + // // First default to exportBits == 0 case | ||
| 1483 | + // String arch = "<string>x86_64</string>\n <string>i386</string>"; | ||
| 1484 | + // if (exportBits == 32) { | ||
| 1485 | + // arch = "<string>i386</string>"; | ||
| 1486 | + // } else if (exportBits == 64) { | ||
| 1487 | + // arch = "<string>x86_64</string>"; | ||
| 1488 | + // } | ||
| 1489 | + // sb.replace(index, index + "@@lsarchitecturepriority@@".length(), arch); | ||
| 1490 | + // } | ||
| 1473 | 1491 | ||
| 1474 | 1492 | lines[i] = sb.toString(); | |
| 1475 | 1493 | } | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -0,0 +1,75 @@ | |||
| 1 | + <?xml version="1.0" ?> | ||
| 2 | + <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | ||
| 3 | + <plist version="1.0"> | ||
| 4 | + <dict> | ||
| 5 | + <key>CFBundleDevelopmentRegion</key> | ||
| 6 | + <string>English</string> | ||
| 7 | + <key>CFBundleExecutable</key> | ||
| 8 | + <string>@@sketch@@</string> | ||
| 9 | + <key>CFBundleIconFile</key> | ||
| 10 | + <string>sketch.icns</string> | ||
| 11 | + <key>CFBundleIdentifier</key> | ||
| 12 | + <string>@@sketch@@</string> | ||
| 13 | + <key>CFBundleDisplayName</key> | ||
| 14 | + <string>@@sketch@@</string> | ||
| 15 | + <key>CFBundleInfoDictionaryVersion</key> | ||
| 16 | + <string>6.0</string> | ||
| 17 | + <key>CFBundleName</key> | ||
| 18 | + <string>@@sketch@@</string> | ||
| 19 | + <key>CFBundlePackageType</key> | ||
| 20 | + <string>APPL</string> | ||
| 21 | + | ||
| 22 | + <!-- Customize this set as you wish --> | ||
| 23 | + <key>CFBundleShortVersionString</key> | ||
| 24 | + <string>1</string> | ||
| 25 | + <key>CFBundleVersion</key> | ||
| 26 | + <string>1</string> | ||
| 27 | + <key>CFBundleSignature</key> | ||
| 28 | + <string>????</string> | ||
| 29 | + <key>NSHumanReadableCopyright</key> | ||
| 30 | + <string>Your copyright here</string> | ||
| 31 | + <key>CFBundleGetInfoString</key> | ||
| 32 | + <string>Created with Processing</string> | ||
| 33 | + <!-- End of the set that can be customized --> | ||
| 34 | + | ||
| 35 | + <key>JVMRuntime</key> | ||
| 36 | + <string>@@jdk_folder@@</string> | ||
| 37 | + | ||
| 38 | + <key>JVMMainClassName</key> | ||
| 39 | + <string>@@sketch@@</string> | ||
| 40 | + | ||
| 41 | + <key>LSMinimumSystemVersion</key> | ||
| 42 | + <string>10.7.3</string> | ||
| 43 | + | ||
| 44 | + <key>NSHighResolutionCapable</key> | ||
| 45 | + <true/> | ||
| 46 | + | ||
| 47 | + <key>LSArchitecturePriority</key> | ||
| 48 | + <array> | ||
| 49 | + <string>x86_64</string> | ||
| 50 | + </array> | ||
| 51 | + | ||
| 52 | + <key>LSEnvironment</key> | ||
| 53 | + <dict> | ||
| 54 | + <key>LC_CTYPE</key> | ||
| 55 | + <string>UTF-8</string> | ||
| 56 | + </dict> | ||
| 57 | + | ||
| 58 | + <key>LSUIPresentationMode</key> | ||
| 59 | + <integer>@@lsuipresentationmode@@</integer> | ||
| 60 | + | ||
| 61 | + <key>JVMOptions</key> | ||
| 62 | + <array> | ||
| 63 | + @@jvm_options_list@@ | ||
| 64 | + <string>-Xdock:icon=Contents/Resources/sketch.icns</string> | ||
| 65 | + <string>-Dapple.laf.useScreenMenuBar=true</string> | ||
| 66 | + <string>-Dcom.apple.macos.use-file-dialog-packages=true</string> | ||
| 67 | + <string>-Dcom.apple.macos.useScreenMenuBar=true</string> | ||
| 68 | + <string>-Dcom.apple.mrj.application.apple.menu.about.name=@@sketch@@</string> | ||
| 69 | + <string>-Dcom.apple.smallTabs=true</string> | ||
| 70 | + </array> | ||
| 71 | + <key>JVMArguments</key> | ||
| 72 | + <array> | ||
| 73 | + </array> | ||
| 74 | + </dict> | ||
| 75 | + </plist> | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -161,6 +161,9 @@ _ and where the font is needed most | |||
| 161 | 161 | _ make note of this on the platforms page | |
| 162 | 162 | _ also make note re: only JRE needed (instead of JDK) | |
| 163 | 163 | _ http://wiki.processing.org/index.php?title=Supported_Platforms&action=edit§ion=4 | |
| 164 | + _ now Info.plist.tmpl instead of template.plist | ||
| 165 | + _ can be embedded in a sketch | ||
| 166 | + _ name change due to major modifications | ||
| 164 | 167 | ||
| 165 | 168 | 7u40 macosx | |
| 166 | 169 | X make OS X launch from its local JRE | |
| Back | FazBrowse Home | New Git URL |
0 commit comments