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

Create less diffs in pbxproj #663

Merged
merged 3 commits into from Sep 28, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Expand Up @@ -14,6 +14,7 @@

- Expand template variable in Array of Any [#651](https://github.com/yonaskolb/XcodeGen/pull/651) @kateinoigakukun
- Significantly improve performance when running with a large number files. [#658](https://github.com/yonaskolb/XcodeGen/pull/658) @kateinoigakukun
- Removed some more diffs between the generated .pbxproj and when Xcode resaves it [#663](https://github.com/yonaskolb/XcodeGen/pull/663) @yonaskolb

#### Internal
- Removed needless `Array` initialization. [#661](https://github.com/yonaskolb/XcodeGen/pull/661) @RomanPodymov
Expand Down
2 changes: 1 addition & 1 deletion SettingPresets/Platforms/iOS.yml
@@ -1,3 +1,3 @@
LD_RUNPATH_SEARCH_PATHS: "$(inherited) @executable_path/Frameworks"
LD_RUNPATH_SEARCH_PATHS: ["$(inherited)", "@executable_path/Frameworks"]
SDKROOT: iphoneos
TARGETED_DEVICE_FAMILY: '1,2'
2 changes: 1 addition & 1 deletion SettingPresets/Platforms/macOS.yml
@@ -1,3 +1,3 @@
LD_RUNPATH_SEARCH_PATHS: "$(inherited) @executable_path/../Frameworks"
LD_RUNPATH_SEARCH_PATHS: ["$(inherited)", "@executable_path/../Frameworks"]
SDKROOT: macosx
COMBINE_HIDPI_IMAGES: 'YES'
2 changes: 1 addition & 1 deletion SettingPresets/Platforms/tvOS.yml
@@ -1,3 +1,3 @@
TARGETED_DEVICE_FAMILY: 3
LD_RUNPATH_SEARCH_PATHS: "$(inherited) @executable_path/Frameworks"
LD_RUNPATH_SEARCH_PATHS: ["$(inherited)", "@executable_path/Frameworks"]
SDKROOT: appletvos
2 changes: 1 addition & 1 deletion SettingPresets/Product_Platform/bundle.unit-test_macOS.yml
@@ -1 +1 @@
LD_RUNPATH_SEARCH_PATHS: $(inherited) @executable_path/../Frameworks @loader_path/../Frameworks
LD_RUNPATH_SEARCH_PATHS: [$(inherited)", "@executable_path/../Frameworks", "@loader_path/../Frameworks]
2 changes: 1 addition & 1 deletion SettingPresets/Products/app-extension.intents-service.yml
@@ -1 +1 @@
LD_RUNPATH_SEARCH_PATHS: "$(inherited) @executable_path/Frameworks @executable_path/../../Frameworks @executable_path/../../../../Frameworks"
LD_RUNPATH_SEARCH_PATHS: ["$(inherited)", "@executable_path/Frameworks", "@executable_path/../../Frameworks", "@executable_path/../../../../Frameworks"]
2 changes: 1 addition & 1 deletion SettingPresets/Products/app-extension.messages.yml
@@ -1,2 +1,2 @@
ASSETCATALOG_COMPILER_APPICON_NAME: iMessage App Icon
LD_RUNPATH_SEARCH_PATHS: "$(inherited) @executable_path/Frameworks @executable_path/../../Frameworks"
LD_RUNPATH_SEARCH_PATHS: ["$(inherited)", "@executable_path/Frameworks", "@executable_path/../../Frameworks"]
2 changes: 1 addition & 1 deletion SettingPresets/Products/app-extension.yml
@@ -1 +1 @@
LD_RUNPATH_SEARCH_PATHS: "$(inherited) @executable_path/Frameworks @executable_path/../../Frameworks"
LD_RUNPATH_SEARCH_PATHS: ["$(inherited)", "@executable_path/Frameworks", "@executable_path/../../Frameworks"]
2 changes: 1 addition & 1 deletion SettingPresets/Products/bundle.ui-testing.yml
@@ -1,2 +1,2 @@
BUNDLE_LOADER: $(TEST_HOST)
LD_RUNPATH_SEARCH_PATHS: "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"
LD_RUNPATH_SEARCH_PATHS: ["$(inherited)", "@executable_path/Frameworks", "@loader_path/Frameworks"]
2 changes: 1 addition & 1 deletion SettingPresets/Products/bundle.unit-test.yml
@@ -1,2 +1,2 @@
BUNDLE_LOADER: $(TEST_HOST)
LD_RUNPATH_SEARCH_PATHS: "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"
LD_RUNPATH_SEARCH_PATHS: ["$(inherited)", "@executable_path/Frameworks", "@loader_path/Frameworks"]
2 changes: 1 addition & 1 deletion SettingPresets/Products/tv-app-extension.yml
@@ -1,2 +1,2 @@
SKIP_INSTALL: 'YES'
LD_RUNPATH_SEARCH_PATHS: "$(inherited) @executable_path/Frameworks @executable_path/../../Frameworks"
LD_RUNPATH_SEARCH_PATHS: ["$(inherited)", "@executable_path/Frameworks", "@executable_path/../../Frameworks"]
2 changes: 1 addition & 1 deletion SettingPresets/Products/watchkit2-extension.yml
@@ -1,2 +1,2 @@
LD_RUNPATH_SEARCH_PATHS: "$(inherited) @executable_path/Frameworks @executable_path/../../Frameworks"
LD_RUNPATH_SEARCH_PATHS: ["$(inherited)", "@executable_path/Frameworks", "@executable_path/../../Frameworks"]
ASSETCATALOG_COMPILER_COMPLICATION_NAME: Complication
13 changes: 12 additions & 1 deletion Sources/XcodeGenKit/XCProjExtensions.swift
Expand Up @@ -46,6 +46,17 @@ extension Dictionary {
extension Xcode {

public static func fileType(path: Path) -> String? {
return path.extension.flatMap { Xcode.filetype(extension: $0) }
guard let fileExtension = path.extension else { return nil}
switch fileExtension {
// cases that aren't handled (yet) in XcodeProj.
// they can be removed once XcodeProj supports them
case "stringsdict": return "text.plist.stringsdict"
case "tbd": return "sourcecode.text-based-dylib-definition"
case "xpc": return "wrapper.xpc-service"
case "xcfilelist": return "text.xcfilelist"
default:
// fallback to XcodeProj defaults
return Xcode.filetype(extension: fileExtension)
}
}
}
30 changes: 24 additions & 6 deletions Tests/Fixtures/CarthageProject/Project.xcodeproj/project.pbxproj
Expand Up @@ -429,7 +429,10 @@
"$(PROJECT_DIR)/Carthage/Build/iOS",
);
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
);
PRODUCT_NAME = Framework;
SDKROOT = iphoneos;
SKIP_INSTALL = YES;
Expand Down Expand Up @@ -474,7 +477,10 @@
"$(PROJECT_DIR)/Carthage/Build/tvOS",
);
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
);
PRODUCT_NAME = Framework;
SDKROOT = appletvos;
SKIP_INSTALL = YES;
Expand Down Expand Up @@ -519,7 +525,10 @@
"$(PROJECT_DIR)/Carthage/Build/iOS",
);
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
);
PRODUCT_NAME = Framework;
SDKROOT = iphoneos;
SKIP_INSTALL = YES;
Expand Down Expand Up @@ -601,7 +610,10 @@
"$(PROJECT_DIR)/Carthage/Build/Mac",
);
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks";
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/../Frameworks",
);
PRODUCT_NAME = Framework;
SDKROOT = macosx;
SKIP_INSTALL = YES;
Expand All @@ -624,7 +636,10 @@
"$(PROJECT_DIR)/Carthage/Build/Mac",
);
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks";
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/../Frameworks",
);
PRODUCT_NAME = Framework;
SDKROOT = macosx;
SKIP_INSTALL = YES;
Expand All @@ -646,7 +661,10 @@
"$(PROJECT_DIR)/Carthage/Build/tvOS",
);
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
);
PRODUCT_NAME = Framework;
SDKROOT = appletvos;
SKIP_INSTALL = YES;
Expand Down
20 changes: 16 additions & 4 deletions Tests/Fixtures/SPM/SPM.xcodeproj/project.pbxproj
Expand Up @@ -238,7 +238,10 @@
0CCC06807E5CD8361D899B7F /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
);
SDKROOT = iphoneos;
SKIP_INSTALL = YES;
TARGETED_DEVICE_FAMILY = "1,2";
Expand All @@ -248,7 +251,10 @@
1640ABF22E84A6AB9FFFB0D9 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
);
SDKROOT = iphoneos;
SKIP_INSTALL = YES;
TARGETED_DEVICE_FAMILY = "1,2";
Expand All @@ -261,7 +267,10 @@
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CODE_SIGN_IDENTITY = "iPhone Developer";
INFOPLIST_FILE = SPM/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
);
OTHER_LDFLAGS = (
"$(inherited)",
"-ObjC",
Expand All @@ -277,7 +286,10 @@
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CODE_SIGN_IDENTITY = "iPhone Developer";
INFOPLIST_FILE = SPM/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
);
OTHER_LDFLAGS = (
"$(inherited)",
"-ObjC",
Expand Down