Skip to content

Commit 359c2cb

Browse files
authored
Fix archiving error for XCFrameworks linking this library (#476)
1 parent d2987af commit 359c2cb

File tree

5 files changed

+349
-3
lines changed

5 files changed

+349
-3
lines changed

.github/workflows/ci.yml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -172,3 +172,39 @@ jobs:
172172
- if: ${{ matrix.platform[0] != 'watchOS' }}
173173
name: Run Tests
174174
run: fastlane test platform:${{ matrix.platform[0] }} version:${{ matrix.platform[1] }} scheme:SwiftUIIntrospectTests configuration:Debug
175+
176+
framework-archiving:
177+
name: Archive Framework (${{ matrix.platform }})
178+
runs-on: macos-15
179+
strategy:
180+
fail-fast: false
181+
matrix:
182+
platform: [iOS, macOS, tvOS, watchOS, visionOS, macCatalyst]
183+
include:
184+
- platform: iOS
185+
destination: "generic/platform=iOS"
186+
- platform: macOS
187+
destination: "generic/platform=macOS"
188+
- platform: tvOS
189+
destination: "generic/platform=tvOS"
190+
- platform: watchOS
191+
destination: "generic/platform=watchOS"
192+
- platform: visionOS
193+
destination: "generic/platform=visionOS"
194+
- platform: macCatalyst
195+
destination: "platform=macOS,variant=Mac Catalyst"
196+
steps:
197+
- name: Git Checkout
198+
uses: actions/checkout@v4
199+
200+
- name: Select Xcode version
201+
run: sudo xcodes select 16.4
202+
203+
- name: Archive Framework
204+
run: |
205+
xcodebuild archive \
206+
-scheme "SwiftUIIntrospectTestFramework" \
207+
-destination "${{ matrix.destination }}" \
208+
-archivePath .build/archiving/${{ matrix.platform }} \
209+
SKIP_INSTALL=NO \
210+
BUILD_LIBRARY_FOR_DISTRIBUTION=YES

Sources/IntrospectionSelector.swift

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
#if !os(watchOS)
2-
@_spi(Advanced)
2+
#if os(iOS) || os(tvOS) || os(visionOS)
3+
public import UIKit
4+
#elseif os(macOS)
5+
public import AppKit
6+
#endif
37

8+
@_spi(Advanced)
49
@MainActor
510
public struct IntrospectionSelector<Target: PlatformEntity> {
611
@_spi(Advanced)
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
//
2+
// TestFramework.swift
3+
// TestFramework
4+
//
5+
// Created by David Roman on 30/07/2025.
6+
//
7+
8+
import Foundation
9+

Tests/Tests.xcodeproj/project.pbxproj

Lines changed: 231 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,12 @@
33
archiveVersion = 1;
44
classes = {
55
};
6-
objectVersion = 55;
6+
objectVersion = 70;
77
objects = {
88

99
/* Begin PBXBuildFile section */
1010
D503B2AC2A49BFE300027F5F /* VideoPlayerTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = D503B2AB2A49BFE300027F5F /* VideoPlayerTests.swift */; };
11+
D50556532E3A6F5A00312263 /* SwiftUIIntrospect in Frameworks */ = {isa = PBXBuildFile; productRef = D50556522E3A6F5A00312263 /* SwiftUIIntrospect */; };
1112
D50FFE8E2A17E2A400C32641 /* ScrollViewTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = D50FFE8D2A17E2A400C32641 /* ScrollViewTests.swift */; };
1213
D534D4DC2A4A596200218BFB /* WindowTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = D534D4DB2A4A596200218BFB /* WindowTests.swift */; };
1314
D55BAD142DFF2B050038443E /* WebViewTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = D55BAD132DFF2B050038443E /* WebViewTests.swift */; };
@@ -78,6 +79,7 @@
7879

7980
/* Begin PBXFileReference section */
8081
D503B2AB2A49BFE300027F5F /* VideoPlayerTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = VideoPlayerTests.swift; sourceTree = "<group>"; };
82+
D505564B2E3A6F2700312263 /* TestFramework.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = TestFramework.framework; sourceTree = BUILT_PRODUCTS_DIR; };
8183
D50FFE8D2A17E2A400C32641 /* ScrollViewTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ScrollViewTests.swift; sourceTree = "<group>"; };
8284
D534D4DB2A4A596200218BFB /* WindowTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WindowTests.swift; sourceTree = "<group>"; };
8385
D55BAD132DFF2B050038443E /* WebViewTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WebViewTests.swift; sourceTree = "<group>"; };
@@ -137,7 +139,19 @@
137139
D5F8D5EE2A1E87950054E9AB /* NavigationViewWithColumnsStyleTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NavigationViewWithColumnsStyleTests.swift; sourceTree = "<group>"; };
138140
/* End PBXFileReference section */
139141

142+
/* Begin PBXFileSystemSynchronizedRootGroup section */
143+
D505564C2E3A6F2700312263 /* TestFramework */ = {isa = PBXFileSystemSynchronizedRootGroup; explicitFileTypes = {}; explicitFolders = (); path = TestFramework; sourceTree = "<group>"; };
144+
/* End PBXFileSystemSynchronizedRootGroup section */
145+
140146
/* Begin PBXFrameworksBuildPhase section */
147+
D50556482E3A6F2700312263 /* Frameworks */ = {
148+
isa = PBXFrameworksBuildPhase;
149+
buildActionMask = 2147483647;
150+
files = (
151+
D50556532E3A6F5A00312263 /* SwiftUIIntrospect in Frameworks */,
152+
);
153+
runOnlyForDeploymentPostprocessing = 0;
154+
};
141155
D5F0BE4629C0DBE800AD95AB /* Frameworks */ = {
142156
isa = PBXFrameworksBuildPhase;
143157
buildActionMask = 2147483647;
@@ -220,6 +234,7 @@
220234
children = (
221235
D5F0BE4B29C0DBE800AD95AB /* TestsHostApp */,
222236
D5F0BE5E29C0DC0000AD95AB /* Tests */,
237+
D505564C2E3A6F2700312263 /* TestFramework */,
223238
D5F0BE4A29C0DBE800AD95AB /* Products */,
224239
D5F0BE7029C0E12300AD95AB /* Frameworks */,
225240
);
@@ -230,6 +245,7 @@
230245
children = (
231246
D5F0BE4929C0DBE800AD95AB /* TestsHostApp.app */,
232247
D5F0BE5D29C0DC0000AD95AB /* Tests.xctest */,
248+
D505564B2E3A6F2700312263 /* TestFramework.framework */,
233249
);
234250
name = Products;
235251
sourceTree = "<group>";
@@ -262,7 +278,41 @@
262278
};
263279
/* End PBXGroup section */
264280

281+
/* Begin PBXHeadersBuildPhase section */
282+
D50556462E3A6F2700312263 /* Headers */ = {
283+
isa = PBXHeadersBuildPhase;
284+
buildActionMask = 2147483647;
285+
files = (
286+
);
287+
runOnlyForDeploymentPostprocessing = 0;
288+
};
289+
/* End PBXHeadersBuildPhase section */
290+
265291
/* Begin PBXNativeTarget section */
292+
D505564A2E3A6F2700312263 /* TestFramework */ = {
293+
isa = PBXNativeTarget;
294+
buildConfigurationList = D50556512E3A6F2700312263 /* Build configuration list for PBXNativeTarget "TestFramework" */;
295+
buildPhases = (
296+
D50556462E3A6F2700312263 /* Headers */,
297+
D50556472E3A6F2700312263 /* Sources */,
298+
D50556482E3A6F2700312263 /* Frameworks */,
299+
D50556492E3A6F2700312263 /* Resources */,
300+
);
301+
buildRules = (
302+
);
303+
dependencies = (
304+
);
305+
fileSystemSynchronizedGroups = (
306+
D505564C2E3A6F2700312263 /* TestFramework */,
307+
);
308+
name = TestFramework;
309+
packageProductDependencies = (
310+
D50556522E3A6F5A00312263 /* SwiftUIIntrospect */,
311+
);
312+
productName = TestFramework;
313+
productReference = D505564B2E3A6F2700312263 /* TestFramework.framework */;
314+
productType = "com.apple.product-type.framework";
315+
};
266316
D5F0BE4829C0DBE800AD95AB /* TestsHostApp */ = {
267317
isa = PBXNativeTarget;
268318
buildConfigurationList = D5F0BE5829C0DBE900AD95AB /* Build configuration list for PBXNativeTarget "TestsHostApp" */;
@@ -308,9 +358,12 @@
308358
isa = PBXProject;
309359
attributes = {
310360
BuildIndependentTargetsInParallel = 1;
311-
LastSwiftUpdateCheck = 1500;
361+
LastSwiftUpdateCheck = 2600;
312362
LastUpgradeCheck = 1500;
313363
TargetAttributes = {
364+
D505564A2E3A6F2700312263 = {
365+
CreatedOnToolsVersion = 26.0;
366+
};
314367
D5F0BE4829C0DBE800AD95AB = {
315368
CreatedOnToolsVersion = 14.2;
316369
};
@@ -338,11 +391,19 @@
338391
targets = (
339392
D5F0BE4829C0DBE800AD95AB /* TestsHostApp */,
340393
D5F0BE5C29C0DC0000AD95AB /* Tests */,
394+
D505564A2E3A6F2700312263 /* TestFramework */,
341395
);
342396
};
343397
/* End PBXProject section */
344398

345399
/* Begin PBXResourcesBuildPhase section */
400+
D50556492E3A6F2700312263 /* Resources */ = {
401+
isa = PBXResourcesBuildPhase;
402+
buildActionMask = 2147483647;
403+
files = (
404+
);
405+
runOnlyForDeploymentPostprocessing = 0;
406+
};
346407
D5F0BE4729C0DBE800AD95AB /* Resources */ = {
347408
isa = PBXResourcesBuildPhase;
348409
buildActionMask = 2147483647;
@@ -360,6 +421,13 @@
360421
/* End PBXResourcesBuildPhase section */
361422

362423
/* Begin PBXSourcesBuildPhase section */
424+
D50556472E3A6F2700312263 /* Sources */ = {
425+
isa = PBXSourcesBuildPhase;
426+
buildActionMask = 2147483647;
427+
files = (
428+
);
429+
runOnlyForDeploymentPostprocessing = 0;
430+
};
363431
D5F0BE4529C0DBE800AD95AB /* Sources */ = {
364432
isa = PBXSourcesBuildPhase;
365433
buildActionMask = 2147483647;
@@ -441,6 +509,154 @@
441509
/* End PBXTargetDependency section */
442510

443511
/* Begin XCBuildConfiguration section */
512+
D505564F2E3A6F2700312263 /* Debug */ = {
513+
isa = XCBuildConfiguration;
514+
buildSettings = {
515+
ALLOW_TARGET_PLATFORM_SPECIALIZATION = YES;
516+
ALWAYS_SEARCH_USER_PATHS = NO;
517+
BUILD_LIBRARY_FOR_DISTRIBUTION = YES;
518+
CLANG_ANALYZER_NONNULL = YES;
519+
CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
520+
CLANG_CXX_LANGUAGE_STANDARD = "gnu++20";
521+
CLANG_ENABLE_MODULES = YES;
522+
CLANG_ENABLE_OBJC_ARC = YES;
523+
CLANG_ENABLE_OBJC_WEAK = YES;
524+
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
525+
CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
526+
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
527+
CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
528+
CODE_SIGN_STYLE = Automatic;
529+
COPY_PHASE_STRIP = NO;
530+
CURRENT_PROJECT_VERSION = 1;
531+
DEBUG_INFORMATION_FORMAT = dwarf;
532+
DYLIB_COMPATIBILITY_VERSION = 1;
533+
DYLIB_CURRENT_VERSION = 1;
534+
DYLIB_INSTALL_NAME_BASE = "@rpath";
535+
ENABLE_MODULE_VERIFIER = YES;
536+
ENABLE_USER_SCRIPT_SANDBOXING = YES;
537+
GCC_C_LANGUAGE_STANDARD = gnu17;
538+
GCC_DYNAMIC_NO_PIC = NO;
539+
GCC_OPTIMIZATION_LEVEL = 0;
540+
GCC_PREPROCESSOR_DEFINITIONS = (
541+
"DEBUG=1",
542+
"$(inherited)",
543+
);
544+
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
545+
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
546+
GENERATE_INFOPLIST_FILE = YES;
547+
INFOPLIST_KEY_NSHumanReadableCopyright = "";
548+
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
549+
IPHONEOS_DEPLOYMENT_TARGET = 14.0;
550+
LD_RUNPATH_SEARCH_PATHS = (
551+
"@executable_path/Frameworks",
552+
"@loader_path/Frameworks",
553+
);
554+
"LD_RUNPATH_SEARCH_PATHS[sdk=macosx*]" = (
555+
"@executable_path/../Frameworks",
556+
"@loader_path/Frameworks",
557+
);
558+
LOCALIZATION_PREFERS_STRING_CATALOGS = YES;
559+
MACOSX_DEPLOYMENT_TARGET = 11.0;
560+
MARKETING_VERSION = 1.0;
561+
MODULE_VERIFIER_SUPPORTED_LANGUAGES = "objective-c objective-c++";
562+
MODULE_VERIFIER_SUPPORTED_LANGUAGE_STANDARDS = "gnu17 gnu++20";
563+
MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
564+
MTL_FAST_MATH = YES;
565+
PRODUCT_BUNDLE_IDENTIFIER = com.siteline.TestFramework;
566+
PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)";
567+
SDKROOT = auto;
568+
SKIP_INSTALL = YES;
569+
STRING_CATALOG_GENERATE_SYMBOLS = YES;
570+
SUPPORTED_PLATFORMS = "appletvos appletvsimulator iphoneos iphonesimulator macosx watchos watchsimulator xros xrsimulator";
571+
SUPPORTS_MACCATALYST = YES;
572+
SWIFT_ACTIVE_COMPILATION_CONDITIONS = "DEBUG $(inherited)";
573+
SWIFT_APPROACHABLE_CONCURRENCY = YES;
574+
SWIFT_EMIT_LOC_STRINGS = YES;
575+
SWIFT_INSTALL_MODULE = YES;
576+
SWIFT_INSTALL_OBJC_HEADER = NO;
577+
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
578+
SWIFT_UPCOMING_FEATURE_MEMBER_IMPORT_VISIBILITY = YES;
579+
SWIFT_VERSION = 5.0;
580+
TARGETED_DEVICE_FAMILY = "1,2,3,4,7";
581+
TVOS_DEPLOYMENT_TARGET = 14.0;
582+
VERSIONING_SYSTEM = "apple-generic";
583+
VERSION_INFO_PREFIX = "";
584+
WATCHOS_DEPLOYMENT_TARGET = 6;
585+
XROS_DEPLOYMENT_TARGET = 1.0;
586+
};
587+
name = Debug;
588+
};
589+
D50556502E3A6F2700312263 /* Release */ = {
590+
isa = XCBuildConfiguration;
591+
buildSettings = {
592+
ALLOW_TARGET_PLATFORM_SPECIALIZATION = YES;
593+
ALWAYS_SEARCH_USER_PATHS = NO;
594+
BUILD_LIBRARY_FOR_DISTRIBUTION = YES;
595+
CLANG_ANALYZER_NONNULL = YES;
596+
CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
597+
CLANG_CXX_LANGUAGE_STANDARD = "gnu++20";
598+
CLANG_ENABLE_MODULES = YES;
599+
CLANG_ENABLE_OBJC_ARC = YES;
600+
CLANG_ENABLE_OBJC_WEAK = YES;
601+
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
602+
CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
603+
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
604+
CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
605+
CODE_SIGN_STYLE = Automatic;
606+
COPY_PHASE_STRIP = NO;
607+
CURRENT_PROJECT_VERSION = 1;
608+
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
609+
DYLIB_COMPATIBILITY_VERSION = 1;
610+
DYLIB_CURRENT_VERSION = 1;
611+
DYLIB_INSTALL_NAME_BASE = "@rpath";
612+
ENABLE_MODULE_VERIFIER = YES;
613+
ENABLE_NS_ASSERTIONS = NO;
614+
ENABLE_USER_SCRIPT_SANDBOXING = YES;
615+
GCC_C_LANGUAGE_STANDARD = gnu17;
616+
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
617+
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
618+
GENERATE_INFOPLIST_FILE = YES;
619+
INFOPLIST_KEY_NSHumanReadableCopyright = "";
620+
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
621+
IPHONEOS_DEPLOYMENT_TARGET = 14.0;
622+
LD_RUNPATH_SEARCH_PATHS = (
623+
"@executable_path/Frameworks",
624+
"@loader_path/Frameworks",
625+
);
626+
"LD_RUNPATH_SEARCH_PATHS[sdk=macosx*]" = (
627+
"@executable_path/../Frameworks",
628+
"@loader_path/Frameworks",
629+
);
630+
LOCALIZATION_PREFERS_STRING_CATALOGS = YES;
631+
MACOSX_DEPLOYMENT_TARGET = 11.0;
632+
MARKETING_VERSION = 1.0;
633+
MODULE_VERIFIER_SUPPORTED_LANGUAGES = "objective-c objective-c++";
634+
MODULE_VERIFIER_SUPPORTED_LANGUAGE_STANDARDS = "gnu17 gnu++20";
635+
MTL_ENABLE_DEBUG_INFO = NO;
636+
MTL_FAST_MATH = YES;
637+
PRODUCT_BUNDLE_IDENTIFIER = com.siteline.TestFramework;
638+
PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)";
639+
SDKROOT = auto;
640+
SKIP_INSTALL = YES;
641+
STRING_CATALOG_GENERATE_SYMBOLS = YES;
642+
SUPPORTED_PLATFORMS = "appletvos appletvsimulator iphoneos iphonesimulator macosx watchos watchsimulator xros xrsimulator";
643+
SUPPORTS_MACCATALYST = YES;
644+
SWIFT_APPROACHABLE_CONCURRENCY = YES;
645+
SWIFT_COMPILATION_MODE = wholemodule;
646+
SWIFT_EMIT_LOC_STRINGS = YES;
647+
SWIFT_INSTALL_MODULE = YES;
648+
SWIFT_INSTALL_OBJC_HEADER = NO;
649+
SWIFT_UPCOMING_FEATURE_MEMBER_IMPORT_VISIBILITY = YES;
650+
SWIFT_VERSION = 5.0;
651+
TARGETED_DEVICE_FAMILY = "1,2,3,4,7";
652+
TVOS_DEPLOYMENT_TARGET = 14.0;
653+
VERSIONING_SYSTEM = "apple-generic";
654+
VERSION_INFO_PREFIX = "";
655+
WATCHOS_DEPLOYMENT_TARGET = 6;
656+
XROS_DEPLOYMENT_TARGET = 1.0;
657+
};
658+
name = Release;
659+
};
444660
D5F0BE4329C0DB9700AD95AB /* Debug */ = {
445661
isa = XCBuildConfiguration;
446662
buildSettings = {
@@ -866,6 +1082,15 @@
8661082
/* End XCBuildConfiguration section */
8671083

8681084
/* Begin XCConfigurationList section */
1085+
D50556512E3A6F2700312263 /* Build configuration list for PBXNativeTarget "TestFramework" */ = {
1086+
isa = XCConfigurationList;
1087+
buildConfigurations = (
1088+
D505564F2E3A6F2700312263 /* Debug */,
1089+
D50556502E3A6F2700312263 /* Release */,
1090+
);
1091+
defaultConfigurationIsVisible = 0;
1092+
defaultConfigurationName = Release;
1093+
};
8691094
D5F0BE4229C0DB9700AD95AB /* Build configuration list for PBXProject "Tests" */ = {
8701095
isa = XCConfigurationList;
8711096
buildConfigurations = (
@@ -896,6 +1121,10 @@
8961121
/* End XCConfigurationList section */
8971122

8981123
/* Begin XCSwiftPackageProductDependency section */
1124+
D50556522E3A6F5A00312263 /* SwiftUIIntrospect */ = {
1125+
isa = XCSwiftPackageProductDependency;
1126+
productName = SwiftUIIntrospect;
1127+
};
8991128
D58CE15529C621B30081BFB0 /* SwiftUIIntrospect */ = {
9001129
isa = XCSwiftPackageProductDependency;
9011130
productName = SwiftUIIntrospect;

0 commit comments

Comments
 (0)