Skip to content

Commit b8af21d

Browse files
authored
Add Support for DocC in Xcode 13 (#1091)
* Add support for DocC DocC "files" are actually folders `.docc` appended to the name, but Xcode 13 treats them differently. Therefore, we need to exclude them from the normal BuildPhase. Resolves #1089 * Add tests for DocC Expanded an existing test to include .docc support. Also added a .docc catalog to the Test Project. * Update changelog.md * Update changelog.md to get the correct PR Link
1 parent 39ee9c2 commit b8af21d

6 files changed

Lines changed: 16 additions & 0 deletions

File tree

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22

33
## Next Version
44

5+
### Added
6+
7+
- Added support for DocC Catalogs [#1091](https://github.com/yonaskolb/XcodeGen/pull/1091) @brevansio
8+
59
## 2.23.1
610

711
### Changed

Sources/ProjectSpec/FileType.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,5 +111,6 @@ extension FileType {
111111
"xcfilelist": FileType(buildPhase: BuildPhaseSpec.none),
112112
"apns": FileType(buildPhase: BuildPhaseSpec.none),
113113
"pch": FileType(buildPhase: BuildPhaseSpec.none),
114+
"docc": FileType(buildPhase: BuildPhaseSpec.none),
114115
]
115116
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# ``App_Clip``
2+
3+
Test
4+
5+
## Overview
6+
7+
Test

Tests/Fixtures/TestProject/App_iOS/Documentation.docc/Resources/resource.png

Loading

Tests/Fixtures/TestProject/Project.xcodeproj/project.pbxproj

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -674,6 +674,7 @@
674674
B198242976C3395E31FE000A /* MessagesViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MessagesViewController.swift; sourceTree = "<group>"; };
675675
B1C33BB070583BE3B0EC0E68 /* App_iOS.app */ = {isa = PBXFileReference; includeInIndex = 0; lastKnownFileType = wrapper.application; path = App_iOS.app; sourceTree = BUILT_PRODUCTS_DIR; };
676676
B221F5A689AD7D3AD52F56B8 /* libStaticLibrary_ObjC.a */ = {isa = PBXFileReference; includeInIndex = 0; lastKnownFileType = archive.ar; path = libStaticLibrary_ObjC.a; sourceTree = BUILT_PRODUCTS_DIR; };
677+
B5C943D39DD7812CAB94B614 /* Documentation.docc */ = {isa = PBXFileReference; path = Documentation.docc; sourceTree = "<group>"; };
677678
B76E17CE3574081D5BF45B44 /* Result.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = Result.framework; sourceTree = "<group>"; };
678679
BA040F1F7D6CA08878323A55 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist; path = Info.plist; sourceTree = "<group>"; };
679680
BB178D03E75929F3F5B10C56 /* Result.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = Result.framework; sourceTree = "<group>"; };
@@ -862,6 +863,7 @@
862863
7F1A2F579A6F79C62DDA0571 /* AppDelegate.swift */,
863864
3797E591F302ECC0AA2FC607 /* Assets.xcassets */,
864865
9D4AB3FCF725428EFB56F542 /* Configuration.storekit */,
866+
B5C943D39DD7812CAB94B614 /* Documentation.docc */,
865867
C9DDE1B06BCC1CDE0ECF1589 /* Info.plist */,
866868
AAA49985DFFE797EE8416887 /* inputList.xcfilelist */,
867869
CE1F06D99242F4223D081F0D /* LaunchScreen.storyboard */,

Tests/XcodeGenKitTests/SourceGeneratorTests.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -598,6 +598,7 @@ class SourceGeneratorTests: XCTestCase {
598598
- Root.plist
599599
- WithPeriod2.0:
600600
- file.swift
601+
- Documentation.docc
601602
"""
602603
try createDirectories(directories)
603604

@@ -654,6 +655,7 @@ class SourceGeneratorTests: XCTestCase {
654655
try pbxProj.expectFileMissing(paths: ["C", "Settings.bundle", "Root.plist"])
655656
try pbxProj.expectFileMissing(paths: ["C", "WithPeriod2.0"])
656657
try pbxProj.expectFile(paths: ["C", "WithPeriod2.0", "file.swift"], buildPhase: .sources)
658+
try pbxProj.expectFile(paths: ["C", "Documentation.docc"], buildPhase: BuildPhaseSpec.none)
657659
}
658660

659661
$0.it("only omits the defined Info.plist from resource build phases but not other plists") {

0 commit comments

Comments
 (0)