Skip to content

Commit

Permalink
Update XcodeGraph (tuist#7339)
Browse files Browse the repository at this point in the history
  • Loading branch information
fortmarek authored Feb 20, 2025
1 parent a3702fc commit 9825ef9
Show file tree
Hide file tree
Showing 8 changed files with 24 additions and 22 deletions.
14 changes: 7 additions & 7 deletions Package.resolved
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"originHash" : "a16b399c6e431c354b77baa85cc6f324a22a268943905f5cf10926c5020f7060",
"originHash" : "0609f46a637f6054472a8187b1010a8a668296872c4f70a92e1ad2dfcf902651",
"pins" : [
{
"identity" : "aexml",
Expand Down Expand Up @@ -33,8 +33,8 @@
"kind" : "remoteSourceControl",
"location" : "https://github.com/tuist/Command.git",
"state" : {
"revision" : "07846291097a593de29846c0083b758471071cdf",
"version" : "0.12.2"
"revision" : "079a7803b581d3022469b3a331bccd51d48d2fc0",
"version" : "0.13.0"
}
},
{
Expand Down Expand Up @@ -348,17 +348,17 @@
"kind" : "remoteSourceControl",
"location" : "https://github.com/tuist/XcodeGraph.git",
"state" : {
"revision" : "bf78c0692488c743c7d5c0356f14b7fde763ec75",
"version" : "1.6.3"
"revision" : "2cbee87f4f69540223103e25c9a36936b912450a",
"version" : "1.7.0"
}
},
{
"identity" : "xcodeproj",
"kind" : "remoteSourceControl",
"location" : "https://github.com/tuist/XcodeProj",
"state" : {
"revision" : "142b7ea0a087eabf4d12207302a185a0e9d4659b",
"version" : "8.27.0"
"revision" : "cbd622399d845f7686ac96c5110cea5a784758a3",
"version" : "8.27.1"
}
},
{
Expand Down
2 changes: 1 addition & 1 deletion Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -514,7 +514,7 @@ let package = Package(
url: "https://github.com/apple/swift-openapi-urlsession", .upToNextMajor(from: "1.0.2")
),
.package(url: "https://github.com/tuist/Path", .upToNextMajor(from: "0.3.0")),
.package(url: "https://github.com/tuist/XcodeGraph.git", exact: "1.6.3"),
.package(url: "https://github.com/tuist/XcodeGraph.git", exact: "1.7.0"),
.package(url: "https://github.com/tuist/FileSystem.git", .upToNextMajor(from: "0.7.0")),
.package(url: "https://github.com/tuist/Command.git", .upToNextMajor(from: "0.8.0")),
.package(url: "https://github.com/sparkle-project/Sparkle.git", from: "2.6.4"),
Expand Down
6 changes: 2 additions & 4 deletions Sources/TuistGenerator/Generator/BuildPhaseGenerator.swift
Original file line number Diff line number Diff line change
Expand Up @@ -207,10 +207,8 @@ final class BuildPhaseGenerator: BuildPhaseGenerating {
.map {
(try? AbsolutePath(validating: $0))?.relative(to: sourceRootPath).pathString ?? $0
},
inputFileListPaths: script.inputFileListPaths.map { $0.relative(to: sourceRootPath).pathString },

outputFileListPaths: script.outputFileListPaths.map { $0.relative(to: sourceRootPath).pathString },

inputFileListPaths: script.inputFileListPaths,
outputFileListPaths: script.outputFileListPaths,
shellPath: script.shellPath,
shellScript: script.shellScript(sourceRootPath: sourceRootPath),
runOnlyForDeploymentPostprocessing: script.runForInstallBuildsOnly,
Expand Down
6 changes: 4 additions & 2 deletions Sources/TuistHasher/TargetScriptsContentHasher.swift
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@ public struct TargetScriptsContentHasher: TargetScriptsContentHashing {
var pathsToHash: [AbsolutePath] = []
script.path.map { pathsToHash.append($0) }

var dynamicPaths = script.inputPaths.compactMap { try? AbsolutePath(validating: $0) } + script.inputFileListPaths
var dynamicPaths = (script.inputPaths + script.inputFileListPaths)
.compactMap { try? AbsolutePath(validating: $0) }
if let dependencyFile = script.dependencyFile {
dynamicPaths += [dependencyFile]
}
Expand All @@ -49,7 +50,8 @@ public struct TargetScriptsContentHasher: TargetScriptsContentHashing {
}
stringsToHash.append(contentsOf: try await pathsToHash.concurrentMap { try await contentHasher.hash(path: $0) })
stringsToHash.append(
contentsOf: (script.outputPaths.compactMap { try? AbsolutePath(validating: $0) } + script.outputFileListPaths)
contentsOf: (script.outputPaths + script.outputFileListPaths)
.compactMap { try? AbsolutePath(validating: $0) }
.map { $0.relative(to: sourceRootPath).pathString }
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ extension XcodeGraph.TargetScript {
generatorPaths: generatorPaths,
fileSystem: fileSystem
)
.map(\.pathString)
let outputPaths = try await absolutePaths(
for: manifest.outputPaths,
generatorPaths: generatorPaths,
Expand All @@ -45,6 +46,7 @@ extension XcodeGraph.TargetScript {
generatorPaths: generatorPaths,
fileSystem: fileSystem
)
.map(\.pathString)
let basedOnDependencyAnalysis = manifest.basedOnDependencyAnalysis
let runForInstallBuildsOnly = manifest.runForInstallBuildsOnly
let shellPath = manifest.shellPath
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,8 +100,8 @@ final class TargetGeneratorTests: XCTestCase {
XCTAssertEqual(preBuildPhase.inputFileListPaths, [])
XCTAssertEqual(preBuildPhase.outputFileListPaths, [])

XCTAssertEqual(postBuildPhase.inputFileListPaths, ["../tmp/b"])
XCTAssertEqual(postBuildPhase.outputFileListPaths, ["../tmp/d"])
XCTAssertEqual(postBuildPhase.inputFileListPaths, ["/tmp/b"])
XCTAssertEqual(postBuildPhase.outputFileListPaths, ["/tmp/d"])
}

func test_generateTargetDependencies() async throws {
Expand Down
4 changes: 2 additions & 2 deletions Tests/TuistHasherTests/TargetScriptsContentHasherTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,9 @@ final class TargetScriptsContentHasherTests: TuistUnitTestCase {
order: order,
script: .tool(path: tool, args: arguments),
inputPaths: inputPaths.map(\.pathString),
inputFileListPaths: inputFileListPaths,
inputFileListPaths: inputFileListPaths.map(\.pathString),
outputPaths: outputPaths.map(\.pathString),
outputFileListPaths: outputFileListPaths,
outputFileListPaths: outputFileListPaths.map(\.pathString),
dependencyFile: dependencyFile
)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,15 +94,15 @@ final class TargetScriptManifestMapperTests: TuistUnitTestCase {
XCTAssertEqual(model.order, .pre)
XCTAssertEqual(
model.inputFileListPaths,
[temporaryPath.appending(try RelativePath(validating: "$(SRCROOT)/foo/bar/**/*.swift"))]
[temporaryPath.appending(try RelativePath(validating: "$(SRCROOT)/foo/bar/**/*.swift")).pathString]
)
XCTAssertEqual(
model.outputPaths,
[temporaryPath.appending(try RelativePath(validating: "$(SRCROOT)/foo/bar/**/*.swift")).pathString]
)
XCTAssertEqual(
model.outputFileListPaths,
[temporaryPath.appending(try RelativePath(validating: "$(SRCROOT)/foo/bar/**/*.swift"))]
[temporaryPath.appending(try RelativePath(validating: "$(SRCROOT)/foo/bar/**/*.swift")).pathString]
)
}

Expand Down Expand Up @@ -163,15 +163,15 @@ final class TargetScriptManifestMapperTests: TuistUnitTestCase {
XCTAssertEqual(model.order, .pre)
XCTAssertEqual(
model.inputFileListPaths,
[temporaryPath.appending(try RelativePath(validating: "$(SRCROOT)/foo/bar/**/*.swift"))]
[temporaryPath.appending(try RelativePath(validating: "$(SRCROOT)/foo/bar/**/*.swift")).pathString]
)
XCTAssertEqual(
model.outputPaths,
[temporaryPath.appending(try RelativePath(validating: "$(SRCROOT)/foo/bar/**/*.swift")).pathString]
)
XCTAssertEqual(
model.outputFileListPaths,
[temporaryPath.appending(try RelativePath(validating: "$(SRCROOT)/foo/bar/**/*.swift"))]
[temporaryPath.appending(try RelativePath(validating: "$(SRCROOT)/foo/bar/**/*.swift")).pathString]
)
}
}

0 comments on commit 9825ef9

Please sign in to comment.