From b03391d71cc3d90c4310d7648c7889ae5a218a53 Mon Sep 17 00:00:00 2001 From: "SND\\MaddTheSane_cp" Date: Wed, 23 Oct 2013 18:07:35 +0000 Subject: [PATCH] Since RubyCocoa was removed, using an Objective-C tool to do the same thing. git-svn-id: https://pcsxr.svn.codeplex.com/svn/pcsxr@87637 e17a0e51-4ae3-4d35-97c3-1a29b211df97 --- macosx/Pcsxr.xcodeproj/project.pbxproj | 214 +++++++++++++----- .../xcschemes/SPUSharedCode.xcscheme | 59 +++++ .../xcschemes/updateInfoPlist.xcscheme | 86 +++++++ macosx/updateInfoPlist.rb | 22 -- macosx/updateInfoPlist/main.m | 48 ++++ .../updateInfoPlist-Prefix.pch | 9 + macosx/updateInfoPlist/updateInfoPlist.1 | 79 +++++++ 7 files changed, 443 insertions(+), 74 deletions(-) create mode 100644 macosx/Pcsxr.xcodeproj/xcshareddata/xcschemes/SPUSharedCode.xcscheme create mode 100644 macosx/Pcsxr.xcodeproj/xcshareddata/xcschemes/updateInfoPlist.xcscheme delete mode 100644 macosx/updateInfoPlist.rb create mode 100644 macosx/updateInfoPlist/main.m create mode 100644 macosx/updateInfoPlist/updateInfoPlist-Prefix.pch create mode 100644 macosx/updateInfoPlist/updateInfoPlist.1 diff --git a/macosx/Pcsxr.xcodeproj/project.pbxproj b/macosx/Pcsxr.xcodeproj/project.pbxproj index 3cb9dfeb..4b6269ea 100644 --- a/macosx/Pcsxr.xcodeproj/project.pbxproj +++ b/macosx/Pcsxr.xcodeproj/project.pbxproj @@ -6,20 +6,6 @@ objectVersion = 46; objects = { -/* Begin PBXAggregateTarget section */ - 55906B1717C28E490057F60D /* Update SVN revision */ = { - isa = PBXAggregateTarget; - buildConfigurationList = 55906B1817C28E490057F60D /* Build configuration list for PBXAggregateTarget "Update SVN revision" */; - buildPhases = ( - 55906B1C17C28E530057F60D /* ShellScript */, - ); - dependencies = ( - ); - name = "Update SVN revision"; - productName = "Make SVN revision"; - }; -/* End PBXAggregateTarget section */ - /* Begin PBXBuildFile section */ 02717968167884C9004AED62 /* hotkeys.m in Sources */ = {isa = PBXBuildFile; fileRef = 02717967167884C9004AED62 /* hotkeys.m */; }; 0280B7AD16764CC5007B8001 /* HotkeyController.m in Sources */ = {isa = PBXBuildFile; fileRef = 0280B7AC16764CC3007B8001 /* HotkeyController.m */; }; @@ -185,6 +171,9 @@ 554FD70A17C6A14B0056CF66 /* SDL2.framework in Copy Frameworks */ = {isa = PBXBuildFile; fileRef = 554FD70817C6A13E0056CF66 /* SDL2.framework */; }; 554FD70B17C6A1EF0056CF66 /* SDL2.framework in Copy Frameworks */ = {isa = PBXBuildFile; fileRef = 554FD70817C6A13E0056CF66 /* SDL2.framework */; }; 554FD70C17C6A1F10056CF66 /* SDL2.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 554FD70817C6A13E0056CF66 /* SDL2.framework */; }; + 55534AF218183BFA006D6BCB /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 55534AF118183BFA006D6BCB /* Foundation.framework */; }; + 55534AF518183BFB006D6BCB /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 55534AF418183BFB006D6BCB /* main.m */; }; + 55534AF918183BFB006D6BCB /* updateInfoPlist.1 in CopyFiles */ = {isa = PBXBuildFile; fileRef = 55534AF818183BFB006D6BCB /* updateInfoPlist.1 */; }; 5557769A17EBE7D60019D008 /* Media.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 5557769917EBE7D60019D008 /* Media.xcassets */; }; 5581463917AABCD100862DBF /* PcsxrCheatHandler.m in Sources */ = {isa = PBXBuildFile; fileRef = 5581463817AABCD100862DBF /* PcsxrCheatHandler.m */; }; 559366CA12B694DF004ACC1E /* iR3000A-64.c in Sources */ = {isa = PBXBuildFile; fileRef = 559366C112B694DF004ACC1E /* iR3000A-64.c */; }; @@ -326,12 +315,12 @@ remoteGlobalIDString = 551A776517869E430052D185; remoteInfo = DFNet; }; - 55906B1D17C28EE40057F60D /* PBXContainerItemProxy */ = { + 55534AFF18183E5B006D6BCB /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = 08FB7793FE84155DC02AAC07 /* Project object */; proxyType = 1; - remoteGlobalIDString = 55906B1717C28E490057F60D; - remoteInfo = "Make SVN revision"; + remoteGlobalIDString = 55534AEF18183BFA006D6BCB; + remoteInfo = updateInfoPlist; }; /* End PBXContainerItemProxy section */ @@ -370,6 +359,16 @@ name = "Copy Frameworks"; runOnlyForDeploymentPostprocessing = 0; }; + 55534AEE18183BFA006D6BCB /* CopyFiles */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = /usr/share/man/man1/; + dstSubfolderSpec = 0; + files = ( + 55534AF918183BFB006D6BCB /* updateInfoPlist.1 in CopyFiles */, + ); + runOnlyForDeploymentPostprocessing = 1; + }; 71AD2DF010C3573400365243 /* Copy PlugIns */ = { isa = PBXCopyFilesBuildPhase; buildActionMask = 2147483647; @@ -635,6 +634,11 @@ 554FD70817C6A13E0056CF66 /* SDL2.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = SDL2.framework; path = /Library/Frameworks/SDL2.framework; sourceTree = ""; }; 5550D2711683C923006C56B5 /* RecentItemsMenu.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = RecentItemsMenu.h; sourceTree = ""; }; 5550D2721683C923006C56B5 /* RecentItemsMenu.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = RecentItemsMenu.m; sourceTree = ""; usesTabs = 1; }; + 55534AF018183BFA006D6BCB /* updateInfoPlist */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = updateInfoPlist; sourceTree = BUILT_PRODUCTS_DIR; }; + 55534AF118183BFA006D6BCB /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; + 55534AF418183BFB006D6BCB /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; + 55534AF718183BFB006D6BCB /* updateInfoPlist-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "updateInfoPlist-Prefix.pch"; sourceTree = ""; }; + 55534AF818183BFB006D6BCB /* updateInfoPlist.1 */ = {isa = PBXFileReference; lastKnownFileType = text.man; path = updateInfoPlist.1; sourceTree = ""; }; 5557769917EBE7D60019D008 /* Media.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Media.xcassets; sourceTree = ""; }; 55707E41181232A9007CC5D0 /* pt-BR */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.strings; name = "pt-BR"; path = "pt-BR.lproj/InfoPlist.strings"; sourceTree = ""; }; 55707E42181232AA007CC5D0 /* pt-BR */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.strings; name = "pt-BR"; path = "pt-BR.lproj/Localizable.strings"; sourceTree = ""; }; @@ -786,7 +790,6 @@ 55EC05FC178916E70053AC23 /* MemBadgeView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MemBadgeView.h; sourceTree = ""; }; 55EC05FD178916E70053AC23 /* MemBadgeView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MemBadgeView.m; sourceTree = ""; usesTabs = 1; }; 55EE2D9017E2323400FED42A /* ecm.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ecm.h; sourceTree = ""; }; - 55F41A1F17EF771600605DF8 /* updateInfoPlist.rb */ = {isa = PBXFileReference; lastKnownFileType = text.script.ruby; path = updateInfoPlist.rb; sourceTree = ""; }; 55F41A2017EF774500605DF8 /* version.sh */ = {isa = PBXFileReference; lastKnownFileType = text.script.sh; path = version.sh; sourceTree = ""; }; 55F41A2117EF7A3300605DF8 /* Info.plistvers.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plistvers.plist; sourceTree = ""; }; 712FD1E51093096F00575A92 /* debug.c */ = {isa = PBXFileReference; fileEncoding = 0; lastKnownFileType = sourcecode.c.c; path = debug.c; sourceTree = ""; }; @@ -943,6 +946,14 @@ ); runOnlyForDeploymentPostprocessing = 0; }; + 55534AED18183BFA006D6BCB /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 55534AF218183BFA006D6BCB /* Foundation.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ @@ -950,10 +961,10 @@ isa = PBXGroup; children = ( 55F41A2017EF774500605DF8 /* version.sh */, - 55F41A1F17EF771600605DF8 /* updateInfoPlist.rb */, 55858D2F178652F90068B8FC /* Configs */, 08FB7795FE84155DC02AAC07 /* PCSXR */, 551A74AF17868BE90052D185 /* plugins */, + 55534AF318183BFA006D6BCB /* updateInfoPlist */, 551A749D17868B110052D185 /* Frameworks */, 1AB674ADFE9D54B511CA2CBB /* Products */, ); @@ -984,6 +995,7 @@ 551A771F178698C60052D185 /* PeopsSpuAL.psxplugin */, 551A774F17869C280052D185 /* PeopsXGL.psxplugin */, 551A776D17869E430052D185 /* DFNet.psxplugin */, + 55534AF018183BFA006D6BCB /* updateInfoPlist */, ); name = Products; sourceTree = ""; @@ -1110,6 +1122,7 @@ 551A768F178691E60052D185 /* ForceFeedback.framework */, 551A7684178691170052D185 /* IOKit.framework */, 551A76D8178696810052D185 /* libz.dylib */, + 55534AF118183BFA006D6BCB /* Foundation.framework */, 551A74A017868B110052D185 /* Other Frameworks */, ); name = Frameworks; @@ -1577,6 +1590,24 @@ path = ../../../plugins/dfnet; sourceTree = ""; }; + 55534AF318183BFA006D6BCB /* updateInfoPlist */ = { + isa = PBXGroup; + children = ( + 55534AF418183BFB006D6BCB /* main.m */, + 55534AF818183BFB006D6BCB /* updateInfoPlist.1 */, + 55534AF618183BFB006D6BCB /* Supporting Files */, + ); + path = updateInfoPlist; + sourceTree = ""; + }; + 55534AF618183BFB006D6BCB /* Supporting Files */ = { + isa = PBXGroup; + children = ( + 55534AF718183BFB006D6BCB /* updateInfoPlist-Prefix.pch */, + ); + name = "Supporting Files"; + sourceTree = ""; + }; 557649B61786AF6F007C4457 /* File Handlers */ = { isa = PBXGroup; children = ( @@ -1701,7 +1732,7 @@ 2BB3D6D005427FE200831ACB /* PBXBuildRule */, ); dependencies = ( - 55906B1E17C28EE40057F60D /* PBXTargetDependency */, + 55534B0018183E5B006D6BCB /* PBXTargetDependency */, 551A778517869F4B0052D185 /* PBXTargetDependency */, 551A778717869F4B0052D185 /* PBXTargetDependency */, 551A778917869F4B0052D185 /* PBXTargetDependency */, @@ -1875,6 +1906,24 @@ productReference = 551A776D17869E430052D185 /* DFNet.psxplugin */; productType = "com.apple.product-type.bundle"; }; + 55534AEF18183BFA006D6BCB /* updateInfoPlist */ = { + isa = PBXNativeTarget; + buildConfigurationList = 55534AFD18183BFB006D6BCB /* Build configuration list for PBXNativeTarget "updateInfoPlist" */; + buildPhases = ( + 55534AEC18183BFA006D6BCB /* Sources */, + 55534AED18183BFA006D6BCB /* Frameworks */, + 55534AEE18183BFA006D6BCB /* CopyFiles */, + 55534AFE18183D86006D6BCB /* ShellScript */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = updateInfoPlist; + productName = updateInfoPlist; + productReference = 55534AF018183BFA006D6BCB /* updateInfoPlist */; + productType = "com.apple.product-type.tool"; + }; /* End PBXNativeTarget section */ /* Begin PBXProject section */ @@ -1917,7 +1966,7 @@ 551A7706178698C60052D185 /* PeopsSpuAL */, 551A776517869E430052D185 /* DFNet */, 551A75C617868C4E0052D185 /* Bladesio1 */, - 55906B1717C28E490057F60D /* Update SVN revision */, + 55534AEF18183BFA006D6BCB /* updateInfoPlist */, ); }; /* End PBXProject section */ @@ -2036,7 +2085,7 @@ /* End PBXResourcesBuildPhase section */ /* Begin PBXShellScriptBuildPhase section */ - 55906B1C17C28E530057F60D /* ShellScript */ = { + 55534AFE18183D86006D6BCB /* ShellScript */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; files = ( @@ -2049,7 +2098,7 @@ ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "#Some code taken from the MPlayerX people.\nexport PATH=\"/usr/bin:/bin:/usr/sbin:/sbin\"\nruby updateInfoPlist.rb Info.plist\ntouch -amfc Info.plistvers.plist\n\nexit 0\n"; + shellScript = "#Some code taken from the MPlayerX people.\nexport PATH=\"/usr/bin:/bin:/usr/sbin:/sbin\"\ncd $SRCROOT\n$TARGET_BUILD_DIR/$PRODUCT_NAME Info.plist\ntouch -amfc Info.plistvers.plist\n\nexit 0\n"; }; 55F41A3317EF8CFF00605DF8 /* Strip Headers */ = { isa = PBXShellScriptBuildPhase; @@ -2264,6 +2313,14 @@ ); runOnlyForDeploymentPostprocessing = 0; }; + 55534AEC18183BFA006D6BCB /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 55534AF518183BFB006D6BCB /* main.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; /* End PBXSourcesBuildPhase section */ /* Begin PBXTargetDependency section */ @@ -2317,10 +2374,10 @@ target = 551A776517869E430052D185 /* DFNet */; targetProxy = 551A779217869F4B0052D185 /* PBXContainerItemProxy */; }; - 55906B1E17C28EE40057F60D /* PBXTargetDependency */ = { + 55534B0018183E5B006D6BCB /* PBXTargetDependency */ = { isa = PBXTargetDependency; - target = 55906B1717C28E490057F60D /* Update SVN revision */; - targetProxy = 55906B1D17C28EE40057F60D /* PBXContainerItemProxy */; + target = 55534AEF18183BFA006D6BCB /* updateInfoPlist */; + targetProxy = 55534AFF18183E5B006D6BCB /* PBXContainerItemProxy */; }; /* End PBXTargetDependency section */ @@ -3117,6 +3174,81 @@ }; name = Release; }; + 55534AFA18183BFB006D6BCB /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + ARCHS = "$(NATIVE_ARCH_ACTUAL)"; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + COPY_PHASE_STRIP = NO; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_DYNAMIC_NO_PIC = NO; + GCC_ENABLE_OBJC_EXCEPTIONS = YES; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "updateInfoPlist/updateInfoPlist-Prefix.pch"; + GCC_PREPROCESSOR_DEFINITIONS = "$(inherited)"; + GCC_SYMBOLS_PRIVATE_EXTERN = NO; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + MACOSX_DEPLOYMENT_TARGET = ""; + ONLY_ACTIVE_ARCH = NO; + PRODUCT_NAME = "$(TARGET_NAME)"; + }; + name = Debug; + }; + 55534AFB18183BFB006D6BCB /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + ARCHS = "$(NATIVE_ARCH_ACTUAL)"; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CODE_SIGN_IDENTITY = ""; + COPY_PHASE_STRIP = YES; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + ENABLE_NS_ASSERTIONS = NO; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_ENABLE_OBJC_EXCEPTIONS = YES; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "updateInfoPlist/updateInfoPlist-Prefix.pch"; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + MACOSX_DEPLOYMENT_TARGET = ""; + ONLY_ACTIVE_ARCH = NO; + PRODUCT_NAME = "$(TARGET_NAME)"; + }; + name = Release; + }; + 55534AFC18183BFB006D6BCB /* Instrument */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + ARCHS = "$(NATIVE_ARCH_ACTUAL)"; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + COPY_PHASE_STRIP = YES; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + ENABLE_NS_ASSERTIONS = NO; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_ENABLE_OBJC_EXCEPTIONS = YES; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "updateInfoPlist/updateInfoPlist-Prefix.pch"; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + MACOSX_DEPLOYMENT_TARGET = ""; + ONLY_ACTIVE_ARCH = NO; + PRODUCT_NAME = "$(TARGET_NAME)"; + }; + name = Instrument; + }; 557649B91786B09E007C4457 /* Instrument */ = { isa = XCBuildConfiguration; baseConfigurationReference = 55858D2B17864DC90068B8FC /* Pcsxr-Instrument.xcconfig */; @@ -3341,27 +3473,6 @@ }; name = Instrument; }; - 55906B1917C28E490057F60D /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - PRODUCT_NAME = "$(TARGET_NAME)"; - }; - name = Debug; - }; - 55906B1A17C28E490057F60D /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - PRODUCT_NAME = "$(TARGET_NAME)"; - }; - name = Release; - }; - 55906B1B17C28E490057F60D /* Instrument */ = { - isa = XCBuildConfiguration; - buildSettings = { - PRODUCT_NAME = "$(TARGET_NAME)"; - }; - name = Instrument; - }; 71F353F40FD98DFE00CBEC28 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { @@ -3561,15 +3672,14 @@ defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; - 55906B1817C28E490057F60D /* Build configuration list for PBXAggregateTarget "Update SVN revision" */ = { + 55534AFD18183BFB006D6BCB /* Build configuration list for PBXNativeTarget "updateInfoPlist" */ = { isa = XCConfigurationList; buildConfigurations = ( - 55906B1917C28E490057F60D /* Debug */, - 55906B1A17C28E490057F60D /* Release */, - 55906B1B17C28E490057F60D /* Instrument */, + 55534AFA18183BFB006D6BCB /* Debug */, + 55534AFB18183BFB006D6BCB /* Release */, + 55534AFC18183BFB006D6BCB /* Instrument */, ); defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; }; 71F353F30FD98DFE00CBEC28 /* Build configuration list for PBXNativeTarget "PCSXR" */ = { isa = XCConfigurationList; diff --git a/macosx/Pcsxr.xcodeproj/xcshareddata/xcschemes/SPUSharedCode.xcscheme b/macosx/Pcsxr.xcodeproj/xcshareddata/xcschemes/SPUSharedCode.xcscheme new file mode 100644 index 00000000..975a74c4 --- /dev/null +++ b/macosx/Pcsxr.xcodeproj/xcshareddata/xcschemes/SPUSharedCode.xcscheme @@ -0,0 +1,59 @@ + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/macosx/Pcsxr.xcodeproj/xcshareddata/xcschemes/updateInfoPlist.xcscheme b/macosx/Pcsxr.xcodeproj/xcshareddata/xcschemes/updateInfoPlist.xcscheme new file mode 100644 index 00000000..294aeb77 --- /dev/null +++ b/macosx/Pcsxr.xcodeproj/xcshareddata/xcschemes/updateInfoPlist.xcscheme @@ -0,0 +1,86 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/macosx/updateInfoPlist.rb b/macosx/updateInfoPlist.rb deleted file mode 100644 index e022801c..00000000 --- a/macosx/updateInfoPlist.rb +++ /dev/null @@ -1,22 +0,0 @@ -require 'osx/cocoa' -include OSX -OSX.require_framework 'ScriptingBridge' - -info = NSMutableDictionary.alloc.initWithContentsOfFile_(ARGV[0]) - -if info != nil then - ## could read the plist file - currentVersion = %x[bash version.sh] - - if currentVersion == "unknown" then - puts "version is invalid!" - else - puts "version is valid:" + currentVersion - - currentVersion = currentVersion.chomp - - info.setValue_forKey_(currentVersion, "CFBundleVersion") - - info.writeToFile_atomically_(ARGV[0] + "vers.plist", 0) - end -end \ No newline at end of file diff --git a/macosx/updateInfoPlist/main.m b/macosx/updateInfoPlist/main.m new file mode 100644 index 00000000..03de0410 --- /dev/null +++ b/macosx/updateInfoPlist/main.m @@ -0,0 +1,48 @@ +// +// main.m +// updateInfoPlist +// +// Created by C.W. Betts on 10/23/13. +// Code based on the RubyCocoa script used by the MPlayerX team +// Original code can be found at http://blog.mplayerx.org/blog/2013/05/10/use-version-number-with-xcode-and-git/ +// +// + +#import + +int main(int argc, const char * argv[]) +{ + @autoreleasepool { + if (argc != 2) { + NSLog(@"Usage: %s \"path to plist\"", argv[0]); + abort(); + return EXIT_FAILURE; + } + NSString *plistLocation =[[NSFileManager defaultManager] stringWithFileSystemRepresentation:argv[1] length:strlen(argv[1])]; + NSMutableDictionary *plistDict = [[NSMutableDictionary alloc] initWithContentsOfFile:plistLocation]; + if (!plistDict) { + return EXIT_FAILURE; + } + NSTask *versionTask = [[NSTask alloc] init]; + [versionTask setLaunchPath:@"/bin/bash"]; + versionTask.arguments = @[@"version.sh"]; + NSPipe *soPipe = [NSPipe new]; + versionTask.standardOutput = soPipe; + + [versionTask launch]; + [versionTask waitUntilExit]; + + NSData *outData = [soPipe.fileHandleForReading readDataToEndOfFile]; + versionTask = nil; + NSString *outString = [[NSString alloc] initWithData:outData encoding:NSUTF8StringEncoding]; + outString = [outString stringByTrimmingCharactersInSet:[NSCharacterSet newlineCharacterSet]]; + if ([outString isEqualToString:@"unknown"]) { + NSLog(@"Version is invalid!"); + return EXIT_FAILURE; + } + plistDict[@"CFBundleVersion"] = outString; + + [plistDict writeToFile:[NSString stringWithFormat:@"%@vers.plist", plistLocation] atomically:NO]; + } + return 0; +} diff --git a/macosx/updateInfoPlist/updateInfoPlist-Prefix.pch b/macosx/updateInfoPlist/updateInfoPlist-Prefix.pch new file mode 100644 index 00000000..37fdbe67 --- /dev/null +++ b/macosx/updateInfoPlist/updateInfoPlist-Prefix.pch @@ -0,0 +1,9 @@ +// +// Prefix header +// +// The contents of this file are implicitly included at the beginning of every source file. +// + +#ifdef __OBJC__ + #import +#endif diff --git a/macosx/updateInfoPlist/updateInfoPlist.1 b/macosx/updateInfoPlist/updateInfoPlist.1 new file mode 100644 index 00000000..31d4883d --- /dev/null +++ b/macosx/updateInfoPlist/updateInfoPlist.1 @@ -0,0 +1,79 @@ +.\"Modified from man(1) of FreeBSD, the NetBSD mdoc.template, and mdoc.samples. +.\"See Also: +.\"man mdoc.samples for a complete listing of options +.\"man mdoc for the short list of editing options +.\"/usr/share/misc/mdoc.template +.Dd 10/23/13 \" DATE +.Dt updateInfoPlist 1 \" Program name and manual section number +.Os Darwin +.Sh NAME \" Section Header - required - don't modify +.Nm updateInfoPlist, +.\" The following lines are read in generating the apropos(man -k) database. Use only key +.\" words here as the database is built based on the words here and in the .ND line. +.Nm Other_name_for_same_program(), +.Nm Yet another name for the same program. +.\" Use .Nm macro to designate other names for the documented program. +.Nd This line parsed for whatis database. +.Sh SYNOPSIS \" Section Header - required - don't modify +.Nm +.Op Fl abcd \" [-abcd] +.Op Fl a Ar path \" [-a path] +.Op Ar file \" [file] +.Op Ar \" [file ...] +.Ar arg0 \" Underlined argument - use .Ar anywhere to underline +arg2 ... \" Arguments +.Sh DESCRIPTION \" Section Header - required - don't modify +Use the .Nm macro to refer to your program throughout the man page like such: +.Nm +Underlining is accomplished with the .Ar macro like this: +.Ar underlined text . +.Pp \" Inserts a space +A list of items with descriptions: +.Bl -tag -width -indent \" Begins a tagged list +.It item a \" Each item preceded by .It macro +Description of item a +.It item b +Description of item b +.El \" Ends the list +.Pp +A list of flags and their descriptions: +.Bl -tag -width -indent \" Differs from above in tag removed +.It Fl a \"-a flag as a list item +Description of -a flag +.It Fl b +Description of -b flag +.El \" Ends the list +.Pp +.\" .Sh ENVIRONMENT \" May not be needed +.\" .Bl -tag -width "ENV_VAR_1" -indent \" ENV_VAR_1 is width of the string ENV_VAR_1 +.\" .It Ev ENV_VAR_1 +.\" Description of ENV_VAR_1 +.\" .It Ev ENV_VAR_2 +.\" Description of ENV_VAR_2 +.\" .El +.Sh FILES \" File used or created by the topic of the man page +.Bl -tag -width "/Users/joeuser/Library/really_long_file_name" -compact +.It Pa /usr/share/file_name +FILE_1 description +.It Pa /Users/joeuser/Library/really_long_file_name +FILE_2 description +.El \" Ends the list +.\" .Sh DIAGNOSTICS \" May not be needed +.\" .Bl -diag +.\" .It Diagnostic Tag +.\" Diagnostic informtion here. +.\" .It Diagnostic Tag +.\" Diagnostic informtion here. +.\" .El +.Sh SEE ALSO +.\" List links in ascending order by section, alphabetically within a section. +.\" Please do not reference files that do not exist without filing a bug report +.Xr a 1 , +.Xr b 1 , +.Xr c 1 , +.Xr a 2 , +.Xr b 2 , +.Xr a 3 , +.Xr b 3 +.\" .Sh BUGS \" Document known, unremedied bugs +.\" .Sh HISTORY \" Document history if command behaves in a unique manner \ No newline at end of file