mirror of
https://github.com/yonaskolb/XcodeGen.git
synced 2026-03-18 20:02:25 +00:00
Merge pull request #84 from mironal/add-carthage-output-files
Add outputpaths to carthage copy-framewors script
This commit is contained in:
@@ -17,6 +17,7 @@
|
||||
BF3862341101 /* MyFramework.framework in Copy Files */ = {isa = PBXBuildFile; fileRef = FR2993497801 /* MyFramework.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
|
||||
BF4946816301 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = VG1473702401 /* Main.storyboard */; };
|
||||
BF5986511201 = {isa = PBXBuildFile; fileRef = FR6523263101 /* TestProject.app */; };
|
||||
BF6182896901 /* Result.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FR9215298301 /* Result.framework */; };
|
||||
BF9001417701 /* TestProjectTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = FR6877173101 /* TestProjectTests.swift */; };
|
||||
BF9155249601 /* FrameworkFile.swift in Sources */ = {isa = PBXBuildFile; fileRef = FR7078510801 /* FrameworkFile.swift */; };
|
||||
/* End PBXBuildFile section */
|
||||
@@ -68,9 +69,29 @@
|
||||
FR6877173101 /* TestProjectTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TestProjectTests.swift; sourceTree = "<group>"; };
|
||||
FR7078510801 /* FrameworkFile.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FrameworkFile.swift; sourceTree = "<group>"; };
|
||||
FR7740960501 /* MyFramework.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MyFramework.h; sourceTree = "<group>"; };
|
||||
FR9215298301 /* Result.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = Result.framework; sourceTree = "<group>"; };
|
||||
/* End PBXFileReference section */
|
||||
|
||||
/* Begin PBXFrameworksBuildPhase section */
|
||||
FBP652326301 /* Frameworks */ = {
|
||||
isa = PBXFrameworksBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
BF6182896901 /* Result.framework in Frameworks */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
/* End PBXFrameworksBuildPhase section */
|
||||
|
||||
/* Begin PBXGroup section */
|
||||
G19527407101 /* Frameworks */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
G28836901501 /* Carthage */,
|
||||
);
|
||||
name = Frameworks;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
G26536595301 /* TestProjectTests */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
@@ -81,6 +102,15 @@
|
||||
path = TestProjectTests;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
G28836901501 /* Carthage */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
G47994500501 /* iOS */,
|
||||
);
|
||||
name = Carthage;
|
||||
path = Carthage/Build;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
G29934978701 /* MyFramework */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
@@ -92,6 +122,15 @@
|
||||
path = MyFramework;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
G47994500501 /* iOS */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
FR9215298301 /* Result.framework */,
|
||||
);
|
||||
name = iOS;
|
||||
path = iOS;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
G65232631501 /* TestProject */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
@@ -124,6 +163,7 @@
|
||||
G65232631501 /* TestProject */,
|
||||
G26536595301 /* TestProjectTests */,
|
||||
G86202385201 /* Products */,
|
||||
G19527407101 /* Frameworks */,
|
||||
);
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
@@ -206,7 +246,9 @@
|
||||
SBP652326301 /* Sources */,
|
||||
RBP652326301 /* Resources */,
|
||||
HBP652326301 /* Headers */,
|
||||
FBP652326301 /* Frameworks */,
|
||||
CFBP50493301 /* CopyFiles */,
|
||||
SSBP58567701 /* Carthage */,
|
||||
SSBP24648001 /* Strip Unused Architectures from Frameworks */,
|
||||
SSBP19207501 /* Swiftlint */,
|
||||
);
|
||||
@@ -313,6 +355,22 @@
|
||||
shellPath = /bin/sh;
|
||||
shellScript = "if which swiftlint >/dev/null; then\n swiftlint\nelse\n echo \"warning: SwiftLint not installed, download from https://github.com/realm/SwiftLint\"\nfi\n";
|
||||
};
|
||||
SSBP58567701 /* Carthage */ = {
|
||||
isa = PBXShellScriptBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
);
|
||||
inputPaths = (
|
||||
"$(SRCROOT)/Carthage/Build/iOS/Result.framework",
|
||||
);
|
||||
name = Carthage;
|
||||
outputPaths = (
|
||||
"$(BUILT_PRODUCTS_DIR)/$(FRAMEWORKS_FOLDER_PATH)/Result.framework",
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
shellPath = /bin/sh;
|
||||
shellScript = "/usr/local/bin/carthage copy-frameworks\n";
|
||||
};
|
||||
/* End PBXShellScriptBuildPhase section */
|
||||
|
||||
/* Begin PBXSourcesBuildPhase section */
|
||||
@@ -409,6 +467,10 @@
|
||||
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
|
||||
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
|
||||
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
||||
FRAMEWORK_SEARCH_PATHS = (
|
||||
"$(inherited)",
|
||||
"$(PROJECT_DIR)/Carthage/Build/iOS",
|
||||
);
|
||||
INFOPLIST_FILE = TestProject/Info.plist;
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 10.0;
|
||||
LD_RUNPATH_SEARCH_PATHS = (
|
||||
@@ -482,6 +544,10 @@
|
||||
buildSettings = {
|
||||
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
||||
BUNDLE_LOADER = "$(TEST_HOST)";
|
||||
FRAMEWORK_SEARCH_PATHS = (
|
||||
"$(inherited)",
|
||||
"$(PROJECT_DIR)/Carthage/Build/iOS",
|
||||
);
|
||||
INFOPLIST_FILE = TestProjectTests/Info.plist;
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 10.0;
|
||||
LD_RUNPATH_SEARCH_PATHS = (
|
||||
@@ -501,6 +567,10 @@
|
||||
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
|
||||
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
|
||||
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
||||
FRAMEWORK_SEARCH_PATHS = (
|
||||
"$(inherited)",
|
||||
"$(PROJECT_DIR)/Carthage/Build/iOS",
|
||||
);
|
||||
INFOPLIST_FILE = TestProject/Info.plist;
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 10.0;
|
||||
LD_RUNPATH_SEARCH_PATHS = (
|
||||
@@ -566,6 +636,10 @@
|
||||
buildSettings = {
|
||||
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
||||
BUNDLE_LOADER = "$(TEST_HOST)";
|
||||
FRAMEWORK_SEARCH_PATHS = (
|
||||
"$(inherited)",
|
||||
"$(PROJECT_DIR)/Carthage/Build/iOS",
|
||||
);
|
||||
INFOPLIST_FILE = TestProjectTests/Info.plist;
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 10.0;
|
||||
LD_RUNPATH_SEARCH_PATHS = (
|
||||
|
||||
@@ -12,6 +12,7 @@ targets:
|
||||
INFOPLIST_FILE: TestProject/Info.plist
|
||||
dependencies:
|
||||
- target: MyFramework
|
||||
- carthage: Result
|
||||
scheme:
|
||||
testTargets:
|
||||
- TestProjectTests
|
||||
|
||||
@@ -381,14 +381,17 @@ public class PBXProjGenerator {
|
||||
buildPhases.append(copyFilesPhase.reference)
|
||||
}
|
||||
|
||||
let carthageFrameworksToEmbed = carthageDependencies
|
||||
.filter { ($0.embed ?? true) }
|
||||
.map { $0.reference }
|
||||
let carthageFrameworksToEmbed = Array(Set(carthageDependencies
|
||||
.filter { $0.embed ?? true }
|
||||
.map { $0.reference }))
|
||||
.sorted()
|
||||
|
||||
if !carthageFrameworksToEmbed.isEmpty {
|
||||
|
||||
if target.type.isApp && target.platform != .macOS {
|
||||
let inputPaths = Set(carthageFrameworksToEmbed).map { "$(SRCROOT)/\(carthageBuildPath)/\(target.platform)/\($0)\($0.contains(".") ? "" : ".framework")" }
|
||||
let carthageScript = PBXShellScriptBuildPhase(reference: generateUUID(PBXShellScriptBuildPhase.self, "Carthage" + target.name), files: [], name: "Carthage", inputPaths: inputPaths, outputPaths: [], shellPath: "/bin/sh", shellScript: "/usr/local/bin/carthage copy-frameworks\n")
|
||||
let inputPaths = carthageFrameworksToEmbed.map { "$(SRCROOT)/\(carthageBuildPath)/\(target.platform)/\($0)\($0.contains(".") ? "" : ".framework")" }
|
||||
let outputPaths = carthageFrameworksToEmbed.map { "$(BUILT_PRODUCTS_DIR)/$(FRAMEWORKS_FOLDER_PATH)/\($0)\($0.contains(".") ? "" : ".framework")" }
|
||||
let carthageScript = PBXShellScriptBuildPhase(reference: generateUUID(PBXShellScriptBuildPhase.self, "Carthage" + target.name), files: [], name: "Carthage", inputPaths: inputPaths, outputPaths: outputPaths, shellPath: "/bin/sh", shellScript: "/usr/local/bin/carthage copy-frameworks\n")
|
||||
addObject(carthageScript)
|
||||
buildPhases.append(carthageScript.reference)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user