Skip to content

Commit 2a56ae1

Browse files
LocalizableStrings source file type
Correct build phase for plist and strings files
1 parent 900ae0d commit 2a56ae1

File tree

3 files changed

+14
-4
lines changed

3 files changed

+14
-4
lines changed

Source/XCSourceFile.m

+2-2
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ - (BOOL)isBuildFile
115115

116116
- (BOOL)canBecomeBuildFile
117117
{
118-
return _type == SourceCodeObjC || _type == SourceCodeObjCPlusPlus || _type == SourceCodeCPlusPlus || _type == XibFile || _type == Framework || _type == ImageResourcePNG || _type == HTML || _type == Bundle || _type == Archive || _type == AssetCatalog || _type == SourceCodeSwift || _type == PropertyList;
118+
return _type == SourceCodeObjC || _type == SourceCodeObjCPlusPlus || _type == SourceCodeCPlusPlus || _type == XibFile || _type == Framework || _type == ImageResourcePNG || _type == HTML || _type == Bundle || _type == Archive || _type == AssetCatalog || _type == SourceCodeSwift || _type == PropertyList || _type == LocalizableStrings;
119119
}
120120

121121

@@ -127,7 +127,7 @@ - (XcodeMemberType)buildPhase
127127
else if (_type == Framework) {
128128
return PBXFrameworksBuildPhaseType;
129129
}
130-
else if (_type == ImageResourcePNG || _type == HTML || _type == Bundle || _type == AssetCatalog || _type == PropertyList) {
130+
else if (_type == ImageResourcePNG || _type == HTML || _type == Bundle || _type == AssetCatalog || _type == PropertyList || _type == LocalizableStrings) {
131131
return PBXResourcesBuildPhaseType;
132132
}
133133
else if (_type == Archive) {

Source/XcodeSourceFileType.h

+2-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,8 @@ typedef NS_OPTIONS(NSInteger, XcodeSourceFileType)
3737
XMLPropertyList = 21, // .plist (text.plist.xml)
3838
Storyboard = 22, // .storyboard (file.storyboard)
3939
XCConfig = 23, // .xcconfig
40-
XCDataModel = 24 // .xcdatamodel
40+
XCDataModel = 24, // .xcdatamodel
41+
LocalizableStrings = 25 // .strings
4142
};
4243

4344
NSString* NSStringFromXCSourceFileType(XcodeSourceFileType type);

Source/XcodeSourceFileType.m

+10-1
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,8 @@
4444
@"file.storyboard" : @(Storyboard),
4545
@"text.xcconfig" : @(XCConfig),
4646
@"wrapper.xcconfig" : @(XCConfig),
47-
@"wrapper.xcdatamodel": @(XCDataModel)
47+
@"wrapper.xcdatamodel": @(XCDataModel),
48+
@"file.strings": @(LocalizableStrings)
4849
};
4950
});
5051

@@ -97,6 +98,14 @@ XcodeSourceFileType XCSourceFileTypeFromFileName(NSString* fileName)
9798
{
9899
return XCDataModel;
99100
}
101+
if ([fileName hasSuffix:@".strings"])
102+
{
103+
return LocalizableStrings;
104+
}
105+
if ([fileName hasSuffix:@".plist"])
106+
{
107+
return PropertyList;
108+
}
100109
return FileTypeNil;
101110
}
102111

0 commit comments

Comments
 (0)