Bug 478210

Summary: Restructure Eclipse RCP Bundle on Mac
Product: [Retired] penrose Reporter: Chandrasekar Kannan <ckannan>
Component: ConfigurationAssignee: Endi Sukma Dewata <edewata>
Status: CLOSED EOL QA Contact: Ben Levenson <benl>
Severity: low Docs Contact:
Priority: low    
Version: unspecifiedCC: benl, nmalki, ykaul
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2020-03-27 19:36:40 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Chandrasekar Kannan 2008-12-27 08:09:03 UTC
http://www.rcpquickstart.com/packaging_an_rcp_application_for_mac_os_x
Additional Comments From jimyang dated Sat Jun 30 23:41:26 CDT 2007 
Packaging Step 1: Rearranging files

The first step in creating a properly formatted Mac OS X bundle is to rearrange the files. This can be accomplished by using the following ant script:


<property name="build.dir" location="my build directory" />
<property name="app.dir" location="${build.dir}/myapp.app" />
<property name="java.dir" location="${app.dir}/Resources/Java" />
<target name="restructure-app-bundle">
     <mkdir dir="${java.dir}"/>
     <move todir="${java.dir}">
          <fileset dir="${build.dir}">
               <exclude name="myapp.app/**"/>
          </fileset>
     </move>
</target>

Packaging Step 2: Replacing the Info.plist file

A Mac OS X application bundle's configuration is described by an Information Property List File. The RCP build process creates this Info.plist file for you, but the settings will not work with the new structure. I've experimented with doing string replacement on the generated file, but in the end have found it easier to just replace the file entirely. Here is the file that I use:


<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
     <key>CFBundleExecutable</key>
     <string>myapp</string>
     <key>CFBundleGetInfoString</key>
     <string>My Application Name, Copyright My Company 2006. All rights reserved.</string>
     <key>CFBundleIconFile</key><
     <string>myapp.icns</string>
     <key>CFBundleIdentifier</key>
     <string>org.eclipse.eclipse</string>
     <key>CFBundleInfoDictionaryVersion</key>
     <string>6.0</string>
     <key>CFBundleName</key>
     <string>My Application Name</string>
     <key>CFBundlePackageType</key>
     <string>APPL</string>
     <key>CFBundleShortVersionString</key>
     <string>1.0</string>
     <key>CFBundleSignature</key>
     <string>????</string>
     <key>CFBundleVersion</key>
     <string>1.0</string>
     <key>Eclipse</key>
     <array>
          <string>-vm</string>
          <string>/System/Library/Frameworks/JavaVM.framework/Versions/1.5/Commands/java</string>
          <string>-startup</string>
          <string>$APP_PACKAGE/Contents/Resources/Java/startup.jar</string>
          <string>-keyring</string>
          <string>~/.eclipse_keyring</string>
          <string>-consoleLog</string>
          <string>-showlocation</string>
     </array>
     <key>LSBackgroundOnly</key>
     <string>1</string>
     <key>WorkingDirectory</key>
     <string>$APP_PACKAGE/Contents/Resources/Java</string>
</dict>
</plist>

Note: LSBackgroundOnly is not necessary if you're deploying Eclipse versions beginning with 3.3 M4. Thanks to Alex Blewitt for the tip.

Now that you've rearranged the files and replaced the Info.plist file, you should be able to double-click your bundle and run your RCP application. You should also be able to drag your application to the Dock and run it from there.

Packaging Step 3: Moving the workspace out of the bundle

One final packaging issue remains, and that is that by default Eclipse will create the workspace directory inside your application bundle. This has a number of negative effects, the main one being that your users will be unable to navigate to their workspace files using the Finder. In addition, users won't be able to throw away the application without deleting their own data. Not pretty.

To resolve this issue, you can simply redirect Eclipse to create these directories in another location. The natural home for a workspace is in the users ~/Documents directory, so in your config.ini file you would add the following line:

osgi.instance.area.default=/Documents/[Workspace Name]

For instance, in the Market Contours RCP application, the workspace is set to ~/Documents/Market Contours.

After making this change, your users will see their files where they expect them to be and your application bundle will not contain embedded user data.

Additional Comments From endisd dated Mon Jul 02 11:50:06 CDT 2007 
This should be implemented in Penrose Studio 2.0 because the new behavior is different from 1.2.x.

Additional Comments From endisd dated Mon Jul 02 14:56:18 CDT 2007 
This issue can be generalized to cover all platforms, not just Mac OS. Basically we need to move the "work" directory from Penrose Studio installation directory to somewhere inside the user's home directory. Currently Penrose Studio already creates ~/.penrose directory to store some files, so the "work" directory can be moved there too.

Additional Comments From jimyang dated Mon Jul 02 15:36:58 CDT 2007 
This should be a relatively small changes. I suggest that this goes to 1.2.3 instead of 2.0.

Additional Comments From jimyang dated Tue Jul 31 09:21:14 CDT 2007 
https://bugs.eclipse.org/bugs/show_bug.cgi?id=57349

Additional Comments From jimyang dated Tue Jul 31 09:31:33 CDT 2007 
http://sourceforge.net/project/showfiles.php?group_id=142821&package_id=186320&release_id=407191
http://alblue.blogspot.com/2006/04/eclipsemac-maclipse-and-maclipse-lite.html


=========================================================
Issue dump from jira
$VAR1 = {
          'priority' => '3',
          'customFieldValues' => [],
          'project' => 'PENROSE',
          'status' => '1',
          'components' => [
                            {
                              'name' => 'Configuration',
                              'id' => '10014'
                            },
                            {
                              'name' => 'Studio',
                              'id' => '10010'
                            }
                          ],
          'attachmentNames' => 'ContentsMacOS.png',
          'reporter' => 'jimyang',
          'key' => 'PENROSE-239',
          'assignee' => 'jimyang',
          'summary' => 'Restructure Eclipse RCP Bundle on Mac',
          'id' => '10749',
          'updated' => '2008-03-21 10:17:44.0',
          'votes' => '0',
          'fixVersions' => [
                           {
                             'releaseDate' => '2008-09-18 00:00:00.0',
                             'sequence' => '31',
                             'name' => 'Penrose-2.1',
                             'released' => 'false',
                             'id' => '10130',
                             'archived' => 'false'
                           }
                         ],
          'affectsVersions' => [],
          'description' => 'http://www.rcpquickstart.com/packaging_an_rcp_application_for_mac_os_x',
          'created' => '2007-06-30 23:40:34.0',
          'type' => '4'
        };


=========================================================

Comment 1 Jim Yang 2009-01-26 15:47:59 UTC
Not supporting mac.