mirror of
https://github.com/yonaskolb/XcodeGen.git
synced 2024-09-20 00:58:04 +03:00
Merge pull request #558 from KhaosT/fix-embed-watch-target
Fix Carthage dependencies for watchOS target
This commit is contained in:
commit
17db27bb9d
@ -13,6 +13,7 @@
|
|||||||
#### Fixed
|
#### Fixed
|
||||||
- Fixed `optional` file sources not being added to the project [#557](https://github.com/yonaskolb/XcodeGen/pull/557) @yonaskolb
|
- Fixed `optional` file sources not being added to the project [#557](https://github.com/yonaskolb/XcodeGen/pull/557) @yonaskolb
|
||||||
- Fixed order of file generation. Plists are now generated before the project is generated so that the project includes the generated plists [#544](https://github.com/yonaskolb/XcodeGen/issues/544) @tomquist
|
- Fixed order of file generation. Plists are now generated before the project is generated so that the project includes the generated plists [#544](https://github.com/yonaskolb/XcodeGen/issues/544) @tomquist
|
||||||
|
- Addressed an issue that causes Carthage depencencies incorrectly embedded in WatchKit app bundle instead of WatchKit app extension [#558](https://github.com/yonaskolb/XcodeGen/pull/558) @KhaosT
|
||||||
|
|
||||||
## 2.4.0
|
## 2.4.0
|
||||||
|
|
||||||
|
@ -420,7 +420,9 @@ public class PBXProjGenerator {
|
|||||||
let targetDependencies = (target.transitivelyLinkDependencies ?? project.options.transitivelyLinkDependencies) ?
|
let targetDependencies = (target.transitivelyLinkDependencies ?? project.options.transitivelyLinkDependencies) ?
|
||||||
getAllDependenciesPlusTransitiveNeedingEmbedding(target: target) : target.dependencies
|
getAllDependenciesPlusTransitiveNeedingEmbedding(target: target) : target.dependencies
|
||||||
|
|
||||||
let directlyEmbedCarthage = target.directlyEmbedCarthageDependencies ?? !(target.platform.requiresSimulatorStripping && target.type.isApp)
|
let targetSupportsDirectEmbed = !(target.platform.requiresSimulatorStripping &&
|
||||||
|
(target.type.isApp || target.type == .watch2Extension))
|
||||||
|
let directlyEmbedCarthage = target.directlyEmbedCarthageDependencies ?? targetSupportsDirectEmbed
|
||||||
|
|
||||||
func getEmbedSettings(dependency: Dependency, codeSign: Bool) -> [String: Any] {
|
func getEmbedSettings(dependency: Dependency, codeSign: Bool) -> [String: Any] {
|
||||||
var embedAttributes: [String] = []
|
var embedAttributes: [String] = []
|
||||||
@ -612,7 +614,7 @@ public class PBXProjGenerator {
|
|||||||
for dependency in carthageDependencies {
|
for dependency in carthageDependencies {
|
||||||
guard target.type != .staticLibrary else { break }
|
guard target.type != .staticLibrary else { break }
|
||||||
|
|
||||||
let embed = dependency.embed ?? target.shouldEmbedDependencies
|
let embed = dependency.embed ?? target.shouldEmbedCarthageDependencies
|
||||||
|
|
||||||
var platformPath = Path(carthageResolver.buildPath(for: target.platform))
|
var platformPath = Path(carthageResolver.buildPath(for: target.platform))
|
||||||
var frameworkPath = platformPath + dependency.reference
|
var frameworkPath = platformPath + dependency.reference
|
||||||
@ -1004,6 +1006,12 @@ extension Target {
|
|||||||
var shouldEmbedDependencies: Bool {
|
var shouldEmbedDependencies: Bool {
|
||||||
return type.isApp || type.isTest
|
return type.isApp || type.isTest
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var shouldEmbedCarthageDependencies: Bool {
|
||||||
|
return (type.isApp && platform != .watchOS)
|
||||||
|
|| type == .watch2Extension
|
||||||
|
|| type.isTest
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
extension Platform {
|
extension Platform {
|
||||||
|
@ -1171,7 +1171,6 @@
|
|||||||
buildPhases = (
|
buildPhases = (
|
||||||
91C895DE8170C96A75D29426BA2BC597 /* Sources */,
|
91C895DE8170C96A75D29426BA2BC597 /* Sources */,
|
||||||
B7B71FA7D279029BF7A7FC7C08E41BB0 /* Resources */,
|
B7B71FA7D279029BF7A7FC7C08E41BB0 /* Resources */,
|
||||||
261B4BE58AA60B68A81874E3318793F3 /* Carthage */,
|
|
||||||
C765431E5FF4B02F59DE79B068D2CB68 /* Embed App Extensions */,
|
C765431E5FF4B02F59DE79B068D2CB68 /* Embed App Extensions */,
|
||||||
);
|
);
|
||||||
buildRules = (
|
buildRules = (
|
||||||
@ -1190,6 +1189,7 @@
|
|||||||
buildPhases = (
|
buildPhases = (
|
||||||
AE7971E1CA54D23C264E6541EA9BAE1B /* Sources */,
|
AE7971E1CA54D23C264E6541EA9BAE1B /* Sources */,
|
||||||
4A6E8F3A477AA5F67A8EB733DFAD8387 /* Resources */,
|
4A6E8F3A477AA5F67A8EB733DFAD8387 /* Resources */,
|
||||||
|
8F8EE32AFABD8FEF976253259FA39ABC /* Carthage */,
|
||||||
);
|
);
|
||||||
buildRules = (
|
buildRules = (
|
||||||
);
|
);
|
||||||
@ -1629,22 +1629,6 @@
|
|||||||
shellPath = /bin/sh;
|
shellPath = /bin/sh;
|
||||||
shellScript = "ditto \"${SCRIPT_INPUT_FILE_0}\" \"${SCRIPT_OUTPUT_FILE_0}\"\n";
|
shellScript = "ditto \"${SCRIPT_INPUT_FILE_0}\" \"${SCRIPT_OUTPUT_FILE_0}\"\n";
|
||||||
};
|
};
|
||||||
261B4BE58AA60B68A81874E3318793F3 /* Carthage */ = {
|
|
||||||
isa = PBXShellScriptBuildPhase;
|
|
||||||
buildActionMask = 2147483647;
|
|
||||||
files = (
|
|
||||||
);
|
|
||||||
inputPaths = (
|
|
||||||
"$(SRCROOT)/Carthage/Build/watchOS/Result.framework",
|
|
||||||
);
|
|
||||||
name = Carthage;
|
|
||||||
outputPaths = (
|
|
||||||
"$(BUILT_PRODUCTS_DIR)/$(FRAMEWORKS_FOLDER_PATH)/Result.framework",
|
|
||||||
);
|
|
||||||
runOnlyForDeploymentPostprocessing = 0;
|
|
||||||
shellPath = /bin/sh;
|
|
||||||
shellScript = "carthage copy-frameworks\n";
|
|
||||||
};
|
|
||||||
37182EC208DBF03DB1BAF452E1D2C836 /* Carthage */ = {
|
37182EC208DBF03DB1BAF452E1D2C836 /* Carthage */ = {
|
||||||
isa = PBXShellScriptBuildPhase;
|
isa = PBXShellScriptBuildPhase;
|
||||||
buildActionMask = 2147483647;
|
buildActionMask = 2147483647;
|
||||||
@ -1733,6 +1717,22 @@
|
|||||||
shellPath = /bin/sh;
|
shellPath = /bin/sh;
|
||||||
shellScript = "echo \"You ran a script\"\n";
|
shellScript = "echo \"You ran a script\"\n";
|
||||||
};
|
};
|
||||||
|
8F8EE32AFABD8FEF976253259FA39ABC /* Carthage */ = {
|
||||||
|
isa = PBXShellScriptBuildPhase;
|
||||||
|
buildActionMask = 2147483647;
|
||||||
|
files = (
|
||||||
|
);
|
||||||
|
inputPaths = (
|
||||||
|
"$(SRCROOT)/Carthage/Build/watchOS/Result.framework",
|
||||||
|
);
|
||||||
|
name = Carthage;
|
||||||
|
outputPaths = (
|
||||||
|
"$(BUILT_PRODUCTS_DIR)/$(FRAMEWORKS_FOLDER_PATH)/Result.framework",
|
||||||
|
);
|
||||||
|
runOnlyForDeploymentPostprocessing = 0;
|
||||||
|
shellPath = /bin/sh;
|
||||||
|
shellScript = "carthage copy-frameworks\n";
|
||||||
|
};
|
||||||
BA454AAC926EDFCDA9226CBCACCBEDB1 /* MyScript */ = {
|
BA454AAC926EDFCDA9226CBCACCBEDB1 /* MyScript */ = {
|
||||||
isa = PBXShellScriptBuildPhase;
|
isa = PBXShellScriptBuildPhase;
|
||||||
buildActionMask = 2147483647;
|
buildActionMask = 2147483647;
|
||||||
|
Loading…
Reference in New Issue
Block a user