Skip to content

Commit 6e1a1a2

Browse files
Add mechanism to include newly introduced info subpaths
- Add code to include subpaths based on Xcode version - Move new MetalLinker subpath to introduced subpaths in plist - Resolves #69
1 parent 4b19d08 commit 6e1a1a2

File tree

2 files changed

+26
-3
lines changed

2 files changed

+26
-3
lines changed

BuildSettingExtractor/BuildSettingCommentGenerator.m

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -189,6 +189,23 @@ - (BOOL)loadBuildSettingInfo {
189189
if (subpathsToAdd) {
190190
buildSettingInfoSubpaths = [buildSettingInfoSubpaths arrayByAddingObjectsFromArray:subpathsToAdd];
191191
}
192+
193+
// Add introduced subpaths that are valid in the version of Xcode we are using
194+
subpathsToAdd = nil;
195+
NSDictionary *introducedSubpaths = buildSettingInfoDict[@"introducedSubpathsByVersion"];
196+
for (NSString *versionKey in [introducedSubpaths allKeys]) {
197+
NSInteger minVersion = [versionKey integerValue];
198+
if (xcodeVersion >= minVersion) {
199+
if (!subpathsToAdd) {
200+
subpathsToAdd = [NSMutableArray array];
201+
}
202+
[subpathsToAdd addObjectsFromArray:introducedSubpaths[versionKey]];
203+
}
204+
}
205+
if (subpathsToAdd) {
206+
buildSettingInfoSubpaths = [buildSettingInfoSubpaths arrayByAddingObjectsFromArray:subpathsToAdd];
207+
}
208+
192209

193210
// Rather than track exactly what Xcode versions contain which files, group versions of an expected file in an array.
194211
// Log if no file in the group can be read in.

BuildSettingExtractor/BuildSettingInfoSubpaths.plist

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,15 @@
4949
</array>
5050
</array>
5151
</dict>
52+
<key>introducedSubpathsByVersion</key>
53+
<dict>
54+
<key>1200</key>
55+
<array>
56+
<array>
57+
<string>Contents/PlugIns/Xcode3Core.ideplugin/Contents/SharedSupport/Developer/Library/Xcode/Plug-ins/Metal.xcplugin/Contents/Resources/MetalLinker.strings</string>
58+
</array>
59+
</array>
60+
</dict>
5261
<key>subpaths</key>
5362
<array>
5463
<array>
@@ -76,9 +85,6 @@
7685
<string>Contents/PlugIns/Xcode3Core.ideplugin/Contents/SharedSupport/Developer/Library/Xcode/Plug-ins/Metal.xcplugin/Contents/Resources/Metal Compiler.strings</string>
7786
<string>Contents/PlugIns/Xcode3Core.ideplugin/Contents/SharedSupport/Developer/Library/Xcode/Plug-ins/Metal.xcplugin/Contents/Resources/MetalCompiler.strings</string>
7887
</array>
79-
<array>
80-
<string>Contents/PlugIns/Xcode3Core.ideplugin/Contents/SharedSupport/Developer/Library/Xcode/Plug-ins/Metal.xcplugin/Contents/Resources/MetalLinker.strings</string>
81-
</array>
8288
<array>
8389
<string>Contents/PlugIns/Xcode3Core.ideplugin/Contents/SharedSupport/Developer/Library/Xcode/Plug-ins/Core Data.xcplugin/Contents/Resources/en.lproj/com.apple.compilers.model.coredata.strings</string>
8490
<string>Contents/PlugIns/Xcode3Core.ideplugin/Contents/SharedSupport/Developer/Library/Xcode/Plug-ins/Core Data.xcplugin/Contents/Resources/English.lproj/com.apple.compilers.model.coredata.strings</string>

0 commit comments

Comments
 (0)