From 0ade6e85bdc7c6f3ea1f31a76ed15e0b02351704 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miko=C5=82aj=20Siedlarek?= Date: Sun, 4 Jan 2015 14:32:21 +0100 Subject: [PATCH] Added file extension association through UTI. --- Add-Lua.sh | 5 +- LuaUTIProvider.app/Contents/Info.plist | 102 +++++++++++++++++++++++++ README.md | 6 +- 3 files changed, 109 insertions(+), 4 deletions(-) create mode 100644 LuaUTIProvider.app/Contents/Info.plist diff --git a/Add-Lua.sh b/Add-Lua.sh index dce7a83..da420f6 100755 --- a/Add-Lua.sh +++ b/Add-Lua.sh @@ -40,7 +40,7 @@ cat >AdditionalLanguages.plist < identifier - com.apple.xcode.lua-source + public.lua-script id @@ -80,3 +80,6 @@ cp "$SCRIPT_PATH/Lua.xclangspec" "$DVTFOUNDATION_PATH" # Remove any cached Xcode plugins # rm -f /private/var/folders/*/*/*/com.apple.DeveloperTools/*/Xcode/PlugInCache.xcplugincache + +# Register Lua script Uniform Type Identifier +/System/Library/Frameworks/CoreServices.framework/Frameworks/LaunchServices.framework/Versions/A/Support/lsregister "$SCRIPT_PATH/LuaUTIProvider.app" diff --git a/LuaUTIProvider.app/Contents/Info.plist b/LuaUTIProvider.app/Contents/Info.plist new file mode 100644 index 0000000..74de380 --- /dev/null +++ b/LuaUTIProvider.app/Contents/Info.plist @@ -0,0 +1,102 @@ + + + + + AMIsApplet + + AMStayOpen + + BuildMachineOSBuild + 14A359 + CFBundleDevelopmentRegion + English + CFBundleDocumentTypes + + + CFBundleTypeExtensions + + * + + CFBundleTypeName + Automator workflow file + CFBundleTypeOSTypes + + **** + + CFBundleTypeRole + Viewer + + + CFBundleExecutable + Application Stub + CFBundleIconFile + AutomatorApplet + CFBundleIdentifier + com.apple.automator.LuaUTIProvider + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + LuaUTIProvider + CFBundlePackageType + APPL + CFBundleShortVersionString + 1.2 + CFBundleSignature + ???? + CFBundleURLTypes + + CFBundleVersion + 409 + DTCompiler + com.apple.compilers.llvm.clang.1_0 + DTPlatformBuild + 6A280m + DTPlatformVersion + GM + DTSDKBuild + 14A359 + DTSDKName + macosx10.10internal + DTXcode + 0600 + DTXcodeBuild + 6A280m + LSMinimumSystemVersion + 10.5 + LSMinimumSystemVersionByArchitecture + + x86_64 + 10.6 + + LSUIElement + + NSAppleScriptEnabled + YES + NSMainNibFile + ApplicationStub + NSPrincipalClass + NSApplication + NSServices + + UTExportedTypeDeclarations + + + UTTypeConformsTo + + public.shell-script + + UTTypeIdentifier + public.lua-script + UTTypeTagSpecification + + public.filename-extension + + lua + + + + + UTImportedTypeDeclarations + + + diff --git a/README.md b/README.md index e907e34..708a29f 100644 --- a/README.md +++ b/README.md @@ -1,10 +1,10 @@ # Lua Support for Xcode 4+ # -1. download the two files (Add-Lua.sh, Lua.xclangspec) +1. Clone this repository 2. Open Add-Lua.sh and change the DVTFOUNDATION_PATH if necessary. You probably do not need to change this if you are on Xcode 4.3+ 3. Make sure Xcode is closed 4. Run Add-Lua.sh from the terminal with sudo (I.E. 'sudo Add-Lua.sh') 5. Enter your admin password and hit enter -6. Open Xcode and notice the 'Lua' entry under "Editor->Syntax Coloring" +6. Lua should now be correctly highlighted in Xcode -Special thanks to [araxara](https://github.com/araxara) for the Objective-J version of this code. \ No newline at end of file +Special thanks to [araxara](https://github.com/araxara) for the Objective-J version of this code.