diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f791862..71f1aff 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -22,8 +22,11 @@ jobs: config: ['debug', 'release'] runs-on: macos-13 steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Select Xcode ${{ matrix.xcode }} run: sudo xcode-select -s /Applications/Xcode_${{ matrix.xcode }}.app - name: Run ${{ matrix.config }} tests run: swift test -c ${{ matrix.config }} + - name: Run compatibility tests + run: make test-compatibility + if: ${{ matrix.config == 'debug' }} diff --git a/Example/Compatibility/App.swift b/Example/Compatibility/App.swift new file mode 100644 index 0000000..1d67e2a --- /dev/null +++ b/Example/Compatibility/App.swift @@ -0,0 +1,9 @@ +import SwiftUI + +@main +struct CompatibilityApp: App { + var body: some Scene { + WindowGroup { + } + } +} diff --git a/Example/Compatibility/Assets.xcassets/AccentColor.colorset/Contents.json b/Example/Compatibility/Assets.xcassets/AccentColor.colorset/Contents.json new file mode 100644 index 0000000..eb87897 --- /dev/null +++ b/Example/Compatibility/Assets.xcassets/AccentColor.colorset/Contents.json @@ -0,0 +1,11 @@ +{ + "colors" : [ + { + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Example/Compatibility/Assets.xcassets/AppIcon.appiconset/Contents.json b/Example/Compatibility/Assets.xcassets/AppIcon.appiconset/Contents.json new file mode 100644 index 0000000..13613e3 --- /dev/null +++ b/Example/Compatibility/Assets.xcassets/AppIcon.appiconset/Contents.json @@ -0,0 +1,13 @@ +{ + "images" : [ + { + "idiom" : "universal", + "platform" : "ios", + "size" : "1024x1024" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Example/Compatibility/Assets.xcassets/Contents.json b/Example/Compatibility/Assets.xcassets/Contents.json new file mode 100644 index 0000000..73c0059 --- /dev/null +++ b/Example/Compatibility/Assets.xcassets/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Example/Compatibility/Compatibility.swift b/Example/Compatibility/Compatibility.swift new file mode 100644 index 0000000..474ccab --- /dev/null +++ b/Example/Compatibility/Compatibility.swift @@ -0,0 +1,8 @@ +import Perception +import SwiftUI + +@Observable class Model {} + +func testUnqualifiedBindable() { + @Bindable var model = Model() +} diff --git a/Example/Compatibility/Preview Content/Preview Assets.xcassets/Contents.json b/Example/Compatibility/Preview Content/Preview Assets.xcassets/Contents.json new file mode 100644 index 0000000..73c0059 --- /dev/null +++ b/Example/Compatibility/Preview Content/Preview Assets.xcassets/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Example/Example.xcodeproj/project.pbxproj b/Example/Example.xcodeproj/project.pbxproj index 2635566..dca335e 100644 --- a/Example/Example.xcodeproj/project.pbxproj +++ b/Example/Example.xcodeproj/project.pbxproj @@ -11,6 +11,11 @@ CA114E932AE1FC29004844BE /* ContentView.swift in Sources */ = {isa = PBXBuildFile; fileRef = CA114E922AE1FC29004844BE /* ContentView.swift */; }; CA114E952AE1FC2A004844BE /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = CA114E942AE1FC2A004844BE /* Assets.xcassets */; }; CA114EBE2AE1FCD7004844BE /* Perception in Frameworks */ = {isa = PBXBuildFile; productRef = CA114EBD2AE1FCD7004844BE /* Perception */; }; + DC40DDAC2C0F98DF00B70F53 /* App.swift in Sources */ = {isa = PBXBuildFile; fileRef = DC40DDAB2C0F98DF00B70F53 /* App.swift */; }; + DC40DDAE2C0F98DF00B70F53 /* Compatibility.swift in Sources */ = {isa = PBXBuildFile; fileRef = DC40DDAD2C0F98DF00B70F53 /* Compatibility.swift */; }; + DC40DDB02C0F98E100B70F53 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = DC40DDAF2C0F98E100B70F53 /* Assets.xcassets */; }; + DC40DDB32C0F98E100B70F53 /* Preview Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = DC40DDB22C0F98E100B70F53 /* Preview Assets.xcassets */; }; + DC40DDD42C0F991D00B70F53 /* Perception in Frameworks */ = {isa = PBXBuildFile; productRef = DC40DDD32C0F991D00B70F53 /* Perception */; }; /* End PBXBuildFile section */ /* Begin PBXFileReference section */ @@ -20,6 +25,11 @@ CA114E942AE1FC2A004844BE /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; CA114EBA2AE1FC71004844BE /* swift-perception */ = {isa = PBXFileReference; lastKnownFileType = wrapper; name = "swift-perception"; path = ..; sourceTree = ""; }; CA114EBB2AE1FCCE004844BE /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist; path = Info.plist; sourceTree = ""; }; + DC40DDA92C0F98DF00B70F53 /* Compatibility.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Compatibility.app; sourceTree = BUILT_PRODUCTS_DIR; }; + DC40DDAB2C0F98DF00B70F53 /* App.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = App.swift; sourceTree = ""; }; + DC40DDAD2C0F98DF00B70F53 /* Compatibility.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Compatibility.swift; sourceTree = ""; }; + DC40DDAF2C0F98E100B70F53 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; + DC40DDB22C0F98E100B70F53 /* Preview Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = "Preview Assets.xcassets"; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -31,6 +41,14 @@ ); runOnlyForDeploymentPostprocessing = 0; }; + DC40DDA62C0F98DF00B70F53 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + DC40DDD42C0F991D00B70F53 /* Perception in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ @@ -39,6 +57,7 @@ children = ( CA114EBA2AE1FC71004844BE /* swift-perception */, CA114E8F2AE1FC29004844BE /* Example */, + DC40DDAA2C0F98DF00B70F53 /* Compatibility */, CA114E8E2AE1FC29004844BE /* Products */, CA114EBC2AE1FCD7004844BE /* Frameworks */, ); @@ -48,6 +67,7 @@ isa = PBXGroup; children = ( CA114E8D2AE1FC29004844BE /* Example.app */, + DC40DDA92C0F98DF00B70F53 /* Compatibility.app */, ); name = Products; sourceTree = ""; @@ -70,6 +90,25 @@ name = Frameworks; sourceTree = ""; }; + DC40DDAA2C0F98DF00B70F53 /* Compatibility */ = { + isa = PBXGroup; + children = ( + DC40DDAB2C0F98DF00B70F53 /* App.swift */, + DC40DDAD2C0F98DF00B70F53 /* Compatibility.swift */, + DC40DDAF2C0F98E100B70F53 /* Assets.xcassets */, + DC40DDB12C0F98E100B70F53 /* Preview Content */, + ); + path = Compatibility; + sourceTree = ""; + }; + DC40DDB12C0F98E100B70F53 /* Preview Content */ = { + isa = PBXGroup; + children = ( + DC40DDB22C0F98E100B70F53 /* Preview Assets.xcassets */, + ); + path = "Preview Content"; + sourceTree = ""; + }; /* End PBXGroup section */ /* Begin PBXNativeTarget section */ @@ -93,6 +132,26 @@ productReference = CA114E8D2AE1FC29004844BE /* Example.app */; productType = "com.apple.product-type.application"; }; + DC40DDA82C0F98DF00B70F53 /* Compatibility */ = { + isa = PBXNativeTarget; + buildConfigurationList = DC40DDD02C0F98E100B70F53 /* Build configuration list for PBXNativeTarget "Compatibility" */; + buildPhases = ( + DC40DDA52C0F98DF00B70F53 /* Sources */, + DC40DDA62C0F98DF00B70F53 /* Frameworks */, + DC40DDA72C0F98DF00B70F53 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = Compatibility; + packageProductDependencies = ( + DC40DDD32C0F991D00B70F53 /* Perception */, + ); + productName = Compatibility; + productReference = DC40DDA92C0F98DF00B70F53 /* Compatibility.app */; + productType = "com.apple.product-type.application"; + }; /* End PBXNativeTarget section */ /* Begin PBXProject section */ @@ -106,6 +165,9 @@ CA114E8C2AE1FC29004844BE = { CreatedOnToolsVersion = 15.0; }; + DC40DDA82C0F98DF00B70F53 = { + CreatedOnToolsVersion = 15.4; + }; }; }; buildConfigurationList = CA114E882AE1FC29004844BE /* Build configuration list for PBXProject "Example" */; @@ -122,6 +184,7 @@ projectRoot = ""; targets = ( CA114E8C2AE1FC29004844BE /* Example */, + DC40DDA82C0F98DF00B70F53 /* Compatibility */, ); }; /* End PBXProject section */ @@ -135,6 +198,15 @@ ); runOnlyForDeploymentPostprocessing = 0; }; + DC40DDA72C0F98DF00B70F53 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + DC40DDB32C0F98E100B70F53 /* Preview Assets.xcassets in Resources */, + DC40DDB02C0F98E100B70F53 /* Assets.xcassets in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; /* End PBXResourcesBuildPhase section */ /* Begin PBXSourcesBuildPhase section */ @@ -147,6 +219,15 @@ ); runOnlyForDeploymentPostprocessing = 0; }; + DC40DDA52C0F98DF00B70F53 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + DC40DDAE2C0F98DF00B70F53 /* Compatibility.swift in Sources */, + DC40DDAC2C0F98DF00B70F53 /* App.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; /* End PBXSourcesBuildPhase section */ /* Begin XCBuildConfiguration section */ @@ -327,6 +408,64 @@ }; name = Release; }; + DC40DDCA2C0F98E100B70F53 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; + CODE_SIGN_STYLE = Automatic; + CURRENT_PROJECT_VERSION = 1; + DEVELOPMENT_ASSET_PATHS = "\"Compatibility/Preview Content\""; + ENABLE_PREVIEWS = YES; + GENERATE_INFOPLIST_FILE = YES; + INFOPLIST_KEY_UIApplicationSceneManifest_Generation = YES; + INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES; + INFOPLIST_KEY_UILaunchScreen_Generation = YES; + INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; + INFOPLIST_KEY_UISupportedInterfaceOrientations_iPhone = "UIInterfaceOrientationPortrait UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; + IPHONEOS_DEPLOYMENT_TARGET = 17.0; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); + MARKETING_VERSION = 1.0; + PRODUCT_BUNDLE_IDENTIFIER = co.pointfree.Compatibility; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_EMIT_LOC_STRINGS = YES; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Debug; + }; + DC40DDCB2C0F98E100B70F53 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; + CODE_SIGN_STYLE = Automatic; + CURRENT_PROJECT_VERSION = 1; + DEVELOPMENT_ASSET_PATHS = "\"Compatibility/Preview Content\""; + ENABLE_PREVIEWS = YES; + GENERATE_INFOPLIST_FILE = YES; + INFOPLIST_KEY_UIApplicationSceneManifest_Generation = YES; + INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES; + INFOPLIST_KEY_UILaunchScreen_Generation = YES; + INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; + INFOPLIST_KEY_UISupportedInterfaceOrientations_iPhone = "UIInterfaceOrientationPortrait UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; + IPHONEOS_DEPLOYMENT_TARGET = 17.0; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); + MARKETING_VERSION = 1.0; + PRODUCT_BUNDLE_IDENTIFIER = co.pointfree.Compatibility; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_EMIT_LOC_STRINGS = YES; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Release; + }; /* End XCBuildConfiguration section */ /* Begin XCConfigurationList section */ @@ -348,6 +487,15 @@ defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; + DC40DDD02C0F98E100B70F53 /* Build configuration list for PBXNativeTarget "Compatibility" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + DC40DDCA2C0F98E100B70F53 /* Debug */, + DC40DDCB2C0F98E100B70F53 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; /* End XCConfigurationList section */ /* Begin XCSwiftPackageProductDependency section */ @@ -355,6 +503,10 @@ isa = XCSwiftPackageProductDependency; productName = Perception; }; + DC40DDD32C0F991D00B70F53 /* Perception */ = { + isa = XCSwiftPackageProductDependency; + productName = Perception; + }; /* End XCSwiftPackageProductDependency section */ }; rootObject = CA114E852AE1FC28004844BE /* Project object */; diff --git a/Example/Example.xcodeproj/xcshareddata/xcschemes/Example.xcscheme b/Example/Example.xcodeproj/xcshareddata/xcschemes/Example.xcscheme index a7fc0da..1629b3a 100644 --- a/Example/Example.xcodeproj/xcshareddata/xcschemes/Example.xcscheme +++ b/Example/Example.xcodeproj/xcshareddata/xcschemes/Example.xcscheme @@ -56,12 +56,23 @@ parallelizable = "YES"> + + + +