From: Gunnar A. G. <gun...@df...> - 2009-05-27 09:17:23
|
Hi all, I've spent a long overdue hour looking into aperture on osx issues. Mainly there are some problems with the osgi packaging. Background ---------- Two things are special for aperture on osx: * OSX requires special behaviour when crawling files, OSX has the concept of "bundles", which is actually a directory, but which all applications treat as a file. Aperture should also treat this as a single thing. The JVM shipped with osx provides special classes that lets you check if this flag is set. * We have two OSX specific crawlers, iPhoto and Apple addressbook. Both are implemented using Applescript, and another special class in OSX JVM is used to execute the applescript. Now - to solve the problem that the special OSX classes are only available on OSX (surprise), we've split them into a separate library, which can only be compiled on OSX, and we take care only to call methods in this library when running on OSX. Problems: --------- * In the current aperture.runtime-onejar the .applescript file is missing for iphoto (although it's in svn) * The magic osx class we use for launching applescript from java (NSAppleScript) is deprecated, and is no longer shipped in the new 1.6 jvm. * Applescript sucks badly for what we use it for, as it requires the actual applications to be running. I.e. when crawling iphoto/addressbook will pop up. (Applescript is slow, and painful to program. ) * For OSGI, the aperture.runtime-onejar does NOT depend on the aperture.tools.apple-wrapper bundle. It should have an option dependency for this. * For OSGI, the osx specific classes are not exposed by OSGI by default, because they are not in the normal jvm specs. To fix this - one must write a fragment-bundle that attaches to the system.bundle and exports these, i.e. a bundle with only a MANIFEST file contained f.x. this: Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: Apple_classes Fragment Bundle-SymbolicName: apple_classes Bundle-Version: 1.0.0 Fragment-Host: system.bundle; extension:=framework Export-Package: com.apple.eawt,apple.laf,com.apple.cocoa.foundation Actions: -------- * I propose we delete the iphoto and apple addressbook crawlers. They have been broken for a long time and noone complained, so they are clearly not used much. They were never well tested, nor well programmed and the applescript approach is awful. We can make a ticket for someone to rewrite them using objective-C, which will let you access the addressbook database etc. without opening the application. * Fix the OSGI details :) Cheers, - Gunnar |