From b6894904c48b3187a1f0585388439f11705d28da Mon Sep 17 00:00:00 2001 From: starkos Date: Thu, 3 Sep 2009 19:25:09 +0000 Subject: [PATCH] Added support for .strings --- src/actions/xcode/xcode_pbxproj.lua | 13 +++++++------ tests/actions/test_xcode.lua | 19 ++++++++++++++----- 2 files changed, 21 insertions(+), 11 deletions(-) diff --git a/src/actions/xcode/xcode_pbxproj.lua b/src/actions/xcode/xcode_pbxproj.lua index a2ef6976..223b145e 100644 --- a/src/actions/xcode/xcode_pbxproj.lua +++ b/src/actions/xcode/xcode_pbxproj.lua @@ -163,15 +163,16 @@ function xcode.getfilecategory(fname) local categories = { - [".c" ] = "Sources", - [".cc" ] = "Sources", - [".cpp" ] = "Sources", - [".cxx" ] = "Sources", + [".c"] = "Sources", + [".cc"] = "Sources", + [".cpp"] = "Sources", + [".cxx"] = "Sources", [".framework"] = "Frameworks", [".lproj"] = "Resources", - [".m" ] = "Sources", + [".m"] = "Sources", [".plist"] = "Resources", - [".xib" ] = "Resources", + [".strings"] = "Resources", + [".xib"] = "Resources", } return categories[path.getextension(fname)] end diff --git a/tests/actions/test_xcode.lua b/tests/actions/test_xcode.lua index 3863c1d5..4488ca11 100644 --- a/tests/actions/test_xcode.lua +++ b/tests/actions/test_xcode.lua @@ -146,16 +146,25 @@ end - function T.xcode3.PBXBuildFile_SeparatesResourcesByProject() - files { "MyProject/English.lproj/MainMenu.xib", "MyProject/French.lproj/MainMenu.xib" } - project2() - files { "MyProject2/English.lproj/MainMenu.xib", "MyProject2/French.lproj/MainMenu.xib" } + function T.xcode3.PBXBuildFile_ListsResourceFilesOnlyOnceWithGroupID() + files { "English.lproj/MainMenu.xib", "French.lproj/MainMenu.xib" } prepare() xcode.PBXBuildFile(ctx) test.capture [[ /* Begin PBXBuildFile section */ [MainMenu.xib:build] /* MainMenu.xib in Resources */ = {isa = PBXBuildFile; fileRef = [MainMenu.xib:group] /* MainMenu.xib */; }; - [MainMenu.xib:build(2)] /* MainMenu.xib in Resources */ = {isa = PBXBuildFile; fileRef = [MainMenu.xib:group(2)] /* MainMenu.xib */; }; +/* End PBXBuildFile section */ + ]] + end + + + function T.xcode3.PBXBuildFile_IncludesStringsFiles() + files { "MyProject/English.lproj/InfoPList.strings", "MyProject/French.lproj/InfoPList.strings" } + prepare() + xcode.PBXBuildFile(ctx) + test.capture [[ +/* Begin PBXBuildFile section */ + [InfoPList.strings:build] /* InfoPList.strings in Resources */ = {isa = PBXBuildFile; fileRef = [InfoPList.strings:group] /* InfoPList.strings */; }; /* End PBXBuildFile section */ ]] end