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

fix: Remove @inlinable from ApolloAPI to enable xcframework builds #2613

Merged
merged 2 commits into from
Oct 27, 2022
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,21 @@ jobs:
- run:
command: swift build

XCFramework_Build:
macos:
xcode: << pipeline.parameters.xcode_version >>
steps:
- common_test_setup
- run:
name: Build XCArchive (iOS Simulator)
command: xcodebuild archive -configuration Release -project "Apollo.xcodeproj" -scheme "Apollo" -destination 'generic/platform=iOS Simulator' -archivePath "./build/iphonesimulator.xcarchive" SKIP_INSTALL=NO BUILD_LIBRARY_FOR_DISTRIBUTION=YES
- run:
name: Build XCArchive (iOS)
command: xcodebuild archive -configuration Release -project "Apollo.xcodeproj" -scheme "Apollo" -destination 'generic/platform=iOS' -archivePath "./build/iphoneos.xcarchive" SKIP_INSTALL=NO BUILD_LIBRARY_FOR_DISTRIBUTION=YES
- run:
name: Build XCFramework
command: xcodebuild -create-xcframework -output ./build/Apollo.xcframework -framework ./build/iphonesimulator.xcarchive/Products/@rpath/Apollo.framework -framework ./build/iphoneos.xcarchive/Products/@rpath/Apollo.framework

IntegrationTests_macOS_current:
macos:
xcode: << pipeline.parameters.xcode_version >>
Expand Down Expand Up @@ -242,6 +257,8 @@ workflows:
jobs:
- Swift_Build:
name: Build as Swift package
- XCFramework_Build:
name: Build XCFramework
- IntegrationTests_macOS_current:
name: Apollo Integration Tests - macOS << pipeline.parameters.macos_version >>
- macOS_current:
Expand Down
2 changes: 1 addition & 1 deletion Sources/ApolloAPI/CacheKeyInfo.swift
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ public struct CacheKeyInfo {
/// - id: The unique cache key for the response object for the ``CacheKeyInfo``.
/// - uniqueKeyGroup: An optional identifier for a group of objects that should be grouped
/// together in the `NormalizedCache`.
@inlinable public init(id: String, uniqueKeyGroup: String? = nil) {
public init(id: String, uniqueKeyGroup: String? = nil) {
self.id = id
self.uniqueKeyGroup = uniqueKeyGroup
}
Expand Down
2 changes: 1 addition & 1 deletion Sources/ApolloAPI/CacheReference.swift
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ public struct CacheReference: Hashable {
///
/// - Parameters:
/// - key: The unique identifier for the referenced object.
@inlinable public init(_ key: String) {
public init(_ key: String) {
self.key = key
}

Expand Down
2 changes: 1 addition & 1 deletion Sources/ApolloAPI/DataDict.swift
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ public struct DataDict: Hashable {
public var _data: JSONObject
public let _variables: GraphQLOperation.Variables?

@inlinable public init(
public init(
_ data: JSONObject,
variables: GraphQLOperation.Variables?
) {
Expand Down
10 changes: 5 additions & 5 deletions Sources/ApolloAPI/Selection+Conditions.swift
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,15 @@ public extension Selection {
struct Conditions: Hashable {
public let value: [[Condition]]

@inlinable public init(_ value: [[Condition]]) {
public init(_ value: [[Condition]]) {
self.value = value
}

@inlinable public init(_ conditions: [Condition]...) {
public init(_ conditions: [Condition]...) {
self.value = Array(conditions)
}

@inlinable public init(_ condition: Condition) {
public init(_ condition: Condition) {
self.value = [[condition]]
}

Expand All @@ -36,15 +36,15 @@ public extension Selection {
public let variableName: String
public let inverted: Bool

@inlinable public init(
public init(
variableName: String,
inverted: Bool
) {
self.variableName = variableName
self.inverted = inverted;
}

@inlinable public init(stringLiteral value: StringLiteralType) {
public init(stringLiteral value: StringLiteralType) {
self.variableName = value
self.inverted = false
}
Expand Down
2 changes: 1 addition & 1 deletion Sources/ApolloAPI/Selection.swift
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public enum Selection {
return alias ?? name
}

@inlinable public init(
public init(
_ name: String,
alias: String? = nil,
type: OutputType,
Expand Down