Skip to content

Commit

Permalink
Merge branch 'main' into on-demand-resources
Browse files Browse the repository at this point in the history
  • Loading branch information
kapitoshka438 committed Apr 23, 2024
2 parents f4776c3 + 781f3dc commit 87d6b47
Show file tree
Hide file tree
Showing 8 changed files with 26 additions and 93 deletions.
9 changes: 9 additions & 0 deletions .all-contributorsrc
Original file line number Diff line number Diff line change
Expand Up @@ -1328,6 +1328,15 @@
"contributions": [
"doc"
]
},
{
"login": "kapitoshka438",
"name": "Eduard Miniakhmetov",
"avatar_url": "https://avatars.githubusercontent.com/u/3232401?v=4",
"profile": "https://github.com/kapitoshka438",
"contributions": [
"code"
]
}
],
"contributorsPerLine": 7,
Expand Down
2 changes: 1 addition & 1 deletion .mise.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[tools]
tuist = "4.10.1"
tuist = "4.10.2"
swiftlint = "0.54.0"
swiftformat = "0.53.3"
pnpm = "8.15.6"
Expand Down
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
# Changelog

## 4.10.2 - 2024-04-23

### Tuist

- no changes

### Tuist Cloud

- no changes

## 4.10.1 - 2024-04-22

### Tuist
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -523,6 +523,7 @@ Thanks goes to these wonderful people:
<td align="center" valign="top" width="14.28%"><a href="https://github.com/leszko11"><img src="https://avatars.githubusercontent.com/u/23533452?v=4" width="100px;" alt=""/><br /><sub><b>Łukasz Lech</b></sub></a></td>
<td align="center" valign="top" width="14.28%"><a href="https://github.com/costapombo"><img src="https://avatars.githubusercontent.com/u/31352351?v=4" width="100px;" alt=""/><br /><sub><b>costapombo</b></sub></a></td>
<td align="center" valign="top" width="14.28%"><a href="https://github.com/isavynskyi"><img src="https://avatars.githubusercontent.com/u/18377497?v=4" width="100px;" alt=""/><br /><sub><b>Ihor Savynskyi</b></sub></a></td>
<td align="center" valign="top" width="14.28%"><a href="https://github.com/kapitoshka438"><img src="https://avatars.githubusercontent.com/u/3232401?v=4" width="100px;" alt=""/><br /><sub><b>Eduard Miniakhmetov</b></sub></a></td>
</tr>
</tbody>
</table>
Expand Down
4 changes: 2 additions & 2 deletions Sources/TuistAutomation/XcodeBuild/XcodeBuildController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -196,11 +196,11 @@ public final class XcodeBuildController: XcodeBuildControlling {
}

public func createXCFramework(
arguments: [XcodeBuildControllerCreateXCFrameworkArgument],
arguments: [String],
output: AbsolutePath
) throws -> AsyncThrowingStream<SystemEvent<XcodeBuildOutput>, Error> {
var command = ["/usr/bin/xcrun", "xcodebuild", "-create-xcframework"]
command.append(contentsOf: arguments.flatMap(\.xcodebuildArguments))
command.append(contentsOf: arguments)
command.append(contentsOf: ["-output", output.pathString])
command.append("-allow-internal-distribution")

Expand Down
57 changes: 1 addition & 56 deletions Sources/TuistCore/Automation/XcodeBuildControlling.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,61 +7,6 @@ public enum XcodeBuildDestination: Equatable {
case mac
}

/// An enum that represents value pairs that can be passed when creating an .xcframework.
public enum XcodeBuildControllerCreateXCFrameworkArgument { // swiftlint:disable:this type_name
/**
An argument that represents a framework archive. The argument is a tuple containing the
absolute path to the archive, and the name of the framework inside the archive.
xcodebuild -create-xcframework
-archive archives/MyFramework-iOS.xcarchive -framework MyFramework.framework
-archive archives/MyFramework-iOS_Simulator.xcarchive -framework MyFramework.framework
-archive archives/MyFramework-macOS.xcarchive -framework MyFramework.framework
-archive archives/MyFramework-Mac_Catalyst.xcarchive -framework MyFramework.framework
-output xcframeworks/MyFramework.xcframework
*/
case framework(archivePath: AbsolutePath, framework: String)

/**
An argument that represents a library. The argument is a tuple containing the absolute path
to the library, and the absolute path to the directory containing the headers.
xcodebuild -create-xcframework
-library products/iOS/usr/local/lib/libMyLibrary.a -headers products/iOS/usr/local/include
-library products/iOS_Simulator/usr/local/lib/libMyLibrary.a -headers products/iOS/usr/local/include
-library products/macOS/usr/local/lib/libMyLibrary.a -headers products/macOS/usr/local/include
-library products/Mac\ Catalyst/usr/local/lib/libMyLibrary.a -headers products/Mac\ Catalyst/usr/local/include
-output xcframeworks/MyLibrary.xcframework
*/
case library(path: AbsolutePath, headers: AbsolutePath)

/**
It passes the -debug-symbol argument when creating frameworks.
*/
case debugSymbols(path: AbsolutePath)

/**
Returns the arguments that represent his argument when invoking xcodebuild.
*/
public var xcodebuildArguments: [String] {
func sanitizedPath(_ path: AbsolutePath) -> String {
// It's workaround for Xcode 15 RC bug
// remove it since bug will be fixed
// more details here: https://github.com/tuist/tuist/issues/5354
path.pathString.hasPrefix("/var/") ? path.pathString.replacingOccurrences(of: "/var/", with: "/private/var/") : path
.pathString
}
switch self {
case let .framework(archivePath, framework):
return ["-archive", sanitizedPath(archivePath), "-framework", framework]
case let .library(libraryPath, headers):
return ["-library", sanitizedPath(libraryPath), "-headers", sanitizedPath(headers)]
case let .debugSymbols(path):
return ["-debug-symbols", sanitizedPath(path)]
}
}
}

public protocol XcodeBuildControlling {
/// Returns an observable to build the given project using xcodebuild.
/// - Parameters:
Expand Down Expand Up @@ -130,7 +75,7 @@ public protocol XcodeBuildControlling {
/// - arguments: A set of arguments to configure the XCFramework creation.
/// - output: Path to the output .xcframework.
func createXCFramework(
arguments: [XcodeBuildControllerCreateXCFrameworkArgument],
arguments: [String],
output: AbsolutePath
)
throws -> AsyncThrowingStream<SystemEvent<XcodeBuildOutput>, Error>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -131,11 +131,11 @@ final class MockXcodeBuildController: XcodeBuildControlling {
}

var createXCFrameworkStub: (
([XcodeBuildControllerCreateXCFrameworkArgument], AbsolutePath)
([String], AbsolutePath)
-> [SystemEvent<XcodeBuildOutput>]
)?
func createXCFramework(
arguments: [XcodeBuildControllerCreateXCFrameworkArgument],
arguments: [String],
output: AbsolutePath
) -> AsyncThrowingStream<SystemEvent<XcodeBuildOutput>, Error> {
if let createXCFrameworkStub {
Expand Down
32 changes: 0 additions & 32 deletions Tests/TuistCoreTests/Automation/XcodeBuildControllingTests.swift

This file was deleted.

0 comments on commit 87d6b47

Please sign in to comment.