Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Treat all directories with known UTI as file wrapper #896

Merged
merged 6 commits into from
Jun 25, 2020
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@

## 2.16.0

#### Fixed
- Bugfix: Treat all directories with known UTI as file wrapper. [#896](https://github.com/yonaskolb/XcodeGen/pull/896) @KhaosT
brentleyjones marked this conversation as resolved.
Show resolved Hide resolved

#### Added
- Improve speed of metadata parsing and dependency resolution. [#803](https://github.com/yonaskolb/XcodeGen/pull/803) @michaeleisel
- Improve support for iOS sticker packs and add support for `launchAutomaticallySubstyle` to run schemes. [#824](https://github.com/yonaskolb/XcodeGen/pull/824) @scelis
Expand Down
13 changes: 2 additions & 11 deletions Sources/XcodeGenKit/XCProjExtensions.swift
Original file line number Diff line number Diff line change
Expand Up @@ -64,16 +64,7 @@ extension Xcode {
}

public static func isDirectoryFileWrapper(path: Path) -> Bool {
guard path.isDirectory, let fileType = fileType(path: path) else { return false }

let wrapperUTIPrefixs = ["folder.", "wrapper."]

for wrapperUTIPrefix in wrapperUTIPrefixs {
if fileType.hasPrefix(wrapperUTIPrefix) {
return true
}
}

return false
guard path.isDirectory else { return false }
return fileType(path: path) != nil
}
}
10 changes: 10 additions & 0 deletions Tests/Fixtures/TestProject/Project.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -470,6 +470,7 @@
020E4DA91C9132845CAFDC5D /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.stringsdict; name = en; path = en.lproj/Localizable.stringsdict; sourceTree = "<group>"; };
039F208D1138598CE060F140 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist; path = Info.plist; sourceTree = "<group>"; };
03D6D1E34022DA9524E5B38D /* Mintfile */ = {isa = PBXFileReference; path = Mintfile; sourceTree = "<group>"; };
0510CEA09E3BFD387E3EDE28 /* MyPlayground.playground */ = {isa = PBXFileReference; lastKnownFileType = file.playground; path = MyPlayground.playground; sourceTree = "<group>"; };
068EDF47F0B087F6A4052AC0 /* Empty.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = Empty.h; sourceTree = "<group>"; };
0704B6CAFBB53E0EBB08F6B3 /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = "<group>"; };
09B82F603D981398F38D762E /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -755,6 +756,7 @@
BDA839814AF73F01F7710518 /* StaticLibrary_ObjC */,
CBDAC144248EE9D3838C6AAA /* StaticLibrary_Swift */,
8CFD8AD4820FAB9265663F92 /* Tool */,
4C7F5EB7D6F3E0E9B426AB4A /* Utilities */,
3FEA12CF227D41EF50E5C2DB /* Vendor */,
80C3A0E524EC1ABCB9149EA2 /* XPC Service */,
DAA7880242A9DE61E68026CC /* Folder */,
Expand Down Expand Up @@ -803,6 +805,14 @@
path = Vendor;
sourceTree = "<group>";
};
4C7F5EB7D6F3E0E9B426AB4A /* Utilities */ = {
isa = PBXGroup;
children = (
0510CEA09E3BFD387E3EDE28 /* MyPlayground.playground */,
);
path = Utilities;
sourceTree = "<group>";
};
5CBCE0E2A145046265FE99E2 /* FileGroup */ = {
isa = PBXGroup;
children = (
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import Cocoa

var str = "Hello, playground"
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<playground version='5.0' target-platform='macos' executeOnSourceChanges='false'>
<timeline fileName='timeline.xctimeline'/>
</playground>

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict/>
<dict>
<key>IDEDidComputeMac32BitWarning</key>
<true/>
</dict>
</plist>
1 change: 1 addition & 0 deletions Tests/Fixtures/TestProject/project.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ fileGroups:
- Configs
- FileGroup
- SomeFile
- Utilities
projectReferences:
AnotherProject:
path: ./AnotherProject/AnotherProject.xcodeproj
Expand Down