diff options
author | Sravan Kumar Lakkimsetti | 2021-04-07 11:54:30 +0000 |
---|---|---|
committer | Sravan Kumar Lakkimsetti | 2021-04-15 14:36:22 +0000 |
commit | 45b974b94378b64a95832f7f058b9f3933056304 (patch) | |
tree | 0af5c9a2eed295ce74bc1c165720f8f0f387dfd6 | |
parent | 1661b445f32ed8cf52971c0b26d615ccad6b33e3 (diff) | |
download | rt.equinox.framework-45b974b94378b64a95832f7f058b9f3933056304.tar.gz rt.equinox.framework-45b974b94378b64a95832f7f058b9f3933056304.tar.xz rt.equinox.framework-45b974b94378b64a95832f7f058b9f3933056304.zip |
Bug 572187 - Move Eclipse launcher executable to macOS 10.14 SDK with
deployment target at 10.10
Change-Id: Icdc6c98ab8b035556867b0e0efcb11532bc368d9
Signed-off-by: Sravan Kumar Lakkimsetti <sravankumarl@in.ibm.com>
Reviewed-on: https://git.eclipse.org/r/c/equinox/rt.equinox.framework/+/179386
7 files changed, 51 insertions, 43 deletions
diff --git a/features/org.eclipse.equinox.executable.feature/bin/cocoa/macosx/x86_64/Eclipse.app/Contents/Info.plist b/features/org.eclipse.equinox.executable.feature/bin/cocoa/macosx/x86_64/Eclipse.app/Contents/Info.plist index 9e82bca38..e09882674 100644 --- a/features/org.eclipse.equinox.executable.feature/bin/cocoa/macosx/x86_64/Eclipse.app/Contents/Info.plist +++ b/features/org.eclipse.equinox.executable.feature/bin/cocoa/macosx/x86_64/Eclipse.app/Contents/Info.plist @@ -3,6 +3,8 @@ <plist version="1.0"> <dict> + <key>NSRequiresAquaSystemAppearance</key> + <true/> <key>CFBundleExecutable</key> <string>eclipse</string> <key>CFBundleGetInfoString</key> diff --git a/features/org.eclipse.equinox.executable.feature/library/cocoa/build.sh b/features/org.eclipse.equinox.executable.feature/library/cocoa/build.sh index 997a04ad4..f049eec87 100755 --- a/features/org.eclipse.equinox.executable.feature/library/cocoa/build.sh +++ b/features/org.eclipse.equinox.executable.feature/library/cocoa/build.sh @@ -69,7 +69,7 @@ if [ "$defaultOSArch" == "arm64" ] then SDKROOT_PATH="/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk" else - SDKROOT_PATH="/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk" + SDKROOT_PATH="/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk" fi # /System/Library/Frameworks/JavaVM.framework/Headers does not exist anymore on Yosemite diff --git a/features/org.eclipse.equinox.executable.feature/library/cocoa/eclipseCocoa.c b/features/org.eclipse.equinox.executable.feature/library/cocoa/eclipseCocoa.c index e93adb197..a38047f4e 100644 --- a/features/org.eclipse.equinox.executable.feature/library/cocoa/eclipseCocoa.c +++ b/features/org.eclipse.equinox.executable.feature/library/cocoa/eclipseCocoa.c @@ -111,11 +111,10 @@ static NSWindow* window = nil; NSImage* image = [[NSImage alloc] initByReferencingFile: featureImage]; [featureImage release]; if (image != NULL) { - NSImageRep* imageRep = [image bestRepresentationForDevice: [[NSScreen mainScreen] deviceDescription]]; - NSRect rect = {{0, 0}, {[imageRep pixelsWide], [imageRep pixelsHigh]}}; - [image setSize: NSMakeSize([imageRep pixelsWide], [imageRep pixelsHigh])]; + NSSize size = [image size]; + NSRect rect = {{0, 0}, {size.width, size.height}}; [image autorelease]; - window = [[KeyWindow alloc] initWithContentRect: rect styleMask: NSBorderlessWindowMask backing: NSBackingStoreBuffered defer: 0]; + window = [[KeyWindow alloc] initWithContentRect: rect styleMask: NSWindowStyleMaskBorderless backing: NSBackingStoreBuffered defer: 0]; if (window != nil) { [window center]; [window setBackgroundColor: [NSColor colorWithPatternImage: image]]; @@ -141,7 +140,7 @@ static NSWindow* window = nil; NSAutoreleasePool* pool = [[NSAutoreleasePool alloc] init]; NSEvent* event; NSApplication* application = [NSApplication sharedApplication]; - while ((event = [application nextEventMatchingMask: NSAnyEventMask untilDate: nil inMode: NSDefaultRunLoopMode dequeue: TRUE]) != nil) { + while ((event = [application nextEventMatchingMask: NSEventMaskAny untilDate: nil inMode: NSDefaultRunLoopMode dequeue: TRUE]) != nil) { [application sendEvent: event]; } [pool release]; @@ -173,9 +172,7 @@ static NSWindow* window = nil; CFURLRef url = NULL; NSAppleEventDescriptor *desc = [event descriptorAtIndex:index], *coerceDesc; if (!desc) continue; - if ((coerceDesc = [desc coerceToDescriptorType: typeFSRef]) != NULL) { - url = CFURLCreateFromFSRef(kCFAllocatorDefault, [[coerceDesc data] bytes]); - } else if ((coerceDesc = [desc coerceToDescriptorType: typeFileURL]) != NULL) { + if ((coerceDesc = [desc coerceToDescriptorType: typeFileURL]) != NULL) { NSData *data = [coerceDesc data]; url = CFURLCreateWithBytes(kCFAllocatorDefault, [data bytes], [data length], kCFStringEncodingUTF8, NULL); } @@ -670,5 +667,5 @@ const char* getUUID() { _TCHAR* getFolderForApplicationData() { NSString* bundleId = getCFBundleIdentifier(); NSString* appSupport = getApplicationSupport(); - return [[NSString stringWithFormat:@"%@/%@_%s", appSupport, bundleId, getUUID()] UTF8String]; + return (_TCHAR*)[[NSString stringWithFormat:@"%@/%@_%s", appSupport, bundleId, getUUID()] UTF8String]; } diff --git a/features/org.eclipse.equinox.executable.feature/library/cocoa/eclipseCocoaCommon.c b/features/org.eclipse.equinox.executable.feature/library/cocoa/eclipseCocoaCommon.c index 34aadbaf2..ff7944f3e 100644 --- a/features/org.eclipse.equinox.executable.feature/library/cocoa/eclipseCocoaCommon.c +++ b/features/org.eclipse.equinox.executable.feature/library/cocoa/eclipseCocoaCommon.c @@ -66,9 +66,12 @@ void displayMessage(char *title, char *message) } NSAutoreleasePool* pool = [[NSAutoreleasePool alloc] init]; - NSAlert* alert = [NSAlert alertWithMessageText: (NSString*)(inDescription != nil ? inError : nil) defaultButton: nil alternateButton: nil otherButton: nil informativeTextWithFormat: (NSString*)(inDescription != nil ? inDescription : inError)]; + NSAlert *alert = [[NSAlert alloc] init]; + [alert setMessageText:(NSString*)(inDescription != nil ? inError : nil)]; + [alert setInformativeText:(NSString*)(inDescription != nil ? inDescription : inError)]; + [alert addButtonWithTitle:@"Ok"]; [[alert window] setTitle: [NSString stringWithUTF8String: title]]; - [alert setAlertStyle: NSCriticalAlertStyle]; + [alert setAlertStyle: NSAlertStyleCritical]; [alert runModal]; [pool release]; CFRelease(inError); @@ -103,7 +106,7 @@ void * loadLibrary( char * library ){ // check if it's a JVM bundle if (strstr(bundle, "libjvm") && (start = strstr(bundle, "/Contents/Home/")) != NULL) { - start[0] = NULL; + start[0] = 0; loadVMBundle(bundle); free(bundle); if (javaVMBundle) { @@ -143,8 +146,11 @@ char * resolveSymlinks( char * path ) { char * result = 0; CFURLRef url, resolved; CFStringRef string; - FSRef fsRef; - Boolean isFolder, wasAliased; + Boolean isStale; + CFDataRef data; + CFErrorRef errorRef; + + if(path == NULL) return path; @@ -154,24 +160,26 @@ char * resolveSymlinks( char * path ) { CFRelease(string); if(url == NULL) return path; - - if(CFURLGetFSRef(url, &fsRef)) { - if( FSResolveAliasFile(&fsRef, true, &isFolder, &wasAliased) == noErr) { - resolved = CFURLCreateFromFSRef(kCFAllocatorDefault, &fsRef); - if(resolved != NULL) { - string = CFURLCopyFileSystemPath(resolved, kCFURLPOSIXPathStyle); - CFIndex length = CFStringGetMaximumSizeForEncoding(CFStringGetLength(string), kCFStringEncodingUTF8); - char *s = malloc(length); - if (CFStringGetCString(string, s, length, kCFStringEncodingUTF8)) { - result = s; - } else { - free(s); - } - CFRelease(string); - CFRelease(resolved); - } - } - } + + data = CFURLCreateBookmarkDataFromFile(kCFAllocatorDefault, url, &errorRef); + if (data == NULL) { + CFRelease(url); + return path; + } + + resolved = CFURLCreateByResolvingBookmarkData(kCFAllocatorDefault, data, kCFURLBookmarkResolutionWithoutMountingMask|kCFURLBookmarkResolutionWithoutUIMask, NULL, NULL, &isStale, &errorRef); + if(resolved != NULL) { + string = CFURLCopyFileSystemPath(resolved, kCFURLPOSIXPathStyle); + CFIndex length = CFStringGetMaximumSizeForEncoding(CFStringGetLength(string), kCFStringEncodingUTF8); + char *s = malloc(length); + if (CFStringGetCString(string, s, length, kCFStringEncodingUTF8)) { + result = s; + } else { + free(s); + } + CFRelease(string); + CFRelease(resolved); + } CFRelease(url); return result; } diff --git a/features/org.eclipse.equinox.executable.feature/library/cocoa/eclipseCocoaMain.c b/features/org.eclipse.equinox.executable.feature/library/cocoa/eclipseCocoaMain.c index c7973f1f6..052ce7edd 100644 --- a/features/org.eclipse.equinox.executable.feature/library/cocoa/eclipseCocoaMain.c +++ b/features/org.eclipse.equinox.executable.feature/library/cocoa/eclipseCocoaMain.c @@ -26,6 +26,7 @@ #include <sys/wait.h> #include <sys/ioctl.h> #include <unistd.h> +#include <Cocoa/Cocoa.h> #include <CoreServices/CoreServices.h> #include <mach-o/dyld.h> @@ -49,14 +50,12 @@ static int fgPid; extern int original_main(int argc, char* argv[]); int main( int argc, char* argv[] ) { - SInt32 systemVersion= 0; - if (Gestalt(gestaltSystemVersion, &systemVersion) == noErr) { - systemVersion &= 0xffff; - if (systemVersion < 0x1050) { - displayMessage("Error", "This application requires Mac OS X 10.5 (Leopard) or greater."); - return 0; - } - } + + NSOperatingSystemVersion version = [[NSProcessInfo processInfo] operatingSystemVersion]; + if ((version.majorVersion < 10) || ((version.majorVersion == 10) && (version.minorVersion < 14))) { + displayMessage("Error", "This application requires Mac OS 10.14 or greater."); + return 0; + } fgConsoleLog= fopen("/dev/console", "w"); fgPid= getpid(); diff --git a/features/org.eclipse.equinox.executable.feature/library/cocoa/make_cocoa.mak b/features/org.eclipse.equinox.executable.feature/library/cocoa/make_cocoa.mak index 6d0f6a8c0..1f5438ecd 100644 --- a/features/org.eclipse.equinox.executable.feature/library/cocoa/make_cocoa.mak +++ b/features/org.eclipse.equinox.executable.feature/library/cocoa/make_cocoa.mak @@ -41,7 +41,7 @@ ifeq ($(ARCHS),-arch x86_64) LDFLAGS=-pagezero_size 0x1000 endif -CFLAGS = -O -s \ +CFLAGS = -O \ -Wall \ -DCOCOA -xobjective-c \ $(ARCHS) \ @@ -88,4 +88,4 @@ install: all rm -f $(EXEC) $(OBJS) clean: - rm -f $(EXEC) $(DLL) $(MAIN_OBJS) $(COMMON_OBJS) $(DLL_OBJS)
\ No newline at end of file + rm -f $(EXEC) $(DLL) $(MAIN_OBJS) $(COMMON_OBJS) $(DLL_OBJS) diff --git a/features/org.eclipse.equinox.executable.feature/library/eclipse.c b/features/org.eclipse.equinox.executable.feature/library/eclipse.c index d6767b25e..f3ab12442 100644 --- a/features/org.eclipse.equinox.executable.feature/library/eclipse.c +++ b/features/org.eclipse.equinox.executable.feature/library/eclipse.c @@ -216,8 +216,10 @@ static _TCHAR* startupMsg = _T_ECLIPSE("The %s executable launcher was unable to locate its \n\ companion launcher jar."); +#ifdef LINUX static _TCHAR* gtk2Msg = _T_ECLIPSE("The %s executable launcher no longer supports running with GTK + 2.x. Continuing using GTK+ 3.x."); +#endif static _TCHAR* homeMsg = _T_ECLIPSE("The %s executable launcher was unable to locate its \n\ |