Skip to content

Commit 1ddb8f9

Browse files
committed
Add OpenQuartzCore
1 parent 3fdb5a6 commit 1ddb8f9

File tree

8 files changed

+43
-11
lines changed

8 files changed

+43
-11
lines changed

.github/workflows/compatibility_tests.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,6 @@ jobs:
3030
- name: Swift version
3131
run: swift --version
3232
- name: Run tests against Apple's CoreGraphics on macOS via SwiftPM
33-
env:
34-
OPENRENDERBOX_LIBRARY_EVOLUTION: 0
3533
run: |
3634
swift test \
3735
--build-path .build-compatibility-test-debug

.github/workflows/macos.yml

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,20 +29,16 @@ jobs:
2929
- name: Swift version
3030
run: swift --version
3131
- name: Build and run tests in debug mode with coverage
32-
env:
33-
OPENRENDERBOX_LIBRARY_EVOLUTION: 0
3432
run: |
3533
swift test \
3634
-c debug \
3735
--enable-code-coverage \
3836
--build-path .build-test-debug
3937
xcrun llvm-cov show \
4038
-instr-profile=.build-test-debug/debug/codecov/default.profdata \
41-
.build-test-debug/debug/OPENRENDERBOXPackageTests.xctest/Contents/MacOS/OPENRENDERBOXPackageTests \
39+
.build-test-debug/debug/OpenGraphicsPackageTests.xctest/Contents/MacOS/OpenGraphicsPackageTests \
4240
> coverage.txt
4341
- name: Build and run tests in release mode
44-
env:
45-
OPENRENDERBOX_LIBRARY_EVOLUTION: 0
4642
run: |
4743
swift test \
4844
-c release \

.github/workflows/ubuntu.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ jobs:
3232
--build-path .build-test-debug
3333
llvm-cov show \
3434
-instr-profile=.build-test-debug/debug/codecov/default.profdata \
35-
.build-test-debug/debug/OpenRenderBoxPackageTests.xctest \
35+
.build-test-debug/debug/OpenGraphicsPackageTests.xctest \
3636
> coverage.txt
3737
- name: Building and running tests in release mode
3838
run: |

Package.swift

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,10 @@ let package = Package(
4747
.package(url: "https://github.com/apple/swift-numerics", from: "1.0.3"),
4848
],
4949
targets: [
50-
.target(name: "OpenGraphics"),
50+
.target(
51+
name: "OpenGraphics",
52+
swiftSettings: sharedSwiftSettings
53+
),
5154
.target(
5255
name: "OpenGraphicsShims",
5356
dependencies: ["OpenGraphics"],
@@ -64,6 +67,28 @@ let package = Package(
6467
],
6568
swiftSettings: sharedSwiftSettings
6669
),
70+
71+
.target(
72+
name: "OpenQuartzCore",
73+
dependencies: ["OpenGraphics"],
74+
swiftSettings: sharedSwiftSettings
75+
),
76+
.target(
77+
name: "OpenQuartzCoreShims",
78+
dependencies: ["OpenQuartzCore"],
79+
swiftSettings: sharedSwiftSettings,
80+
linkerSettings: [
81+
.linkedFramework("QuartzCore", .when(platforms: .darwinPlatforms)),
82+
]
83+
),
84+
.testTarget(
85+
name: "OpenQuartzCoreShimsTests",
86+
dependencies: [
87+
"OpenQuartzCoreShims",
88+
.product(name: "Numerics", package: "swift-numerics"),
89+
],
90+
swiftSettings: sharedSwiftSettings
91+
),
6792
]
6893
)
6994

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
//
2-
// Shims.swift
2+
// Export.swift
33
// OpenGraphicsShims
44

55
#if OPENGRAPHICS_COREGRAPHICS

Sources/OpenGraphics/CATransform3D.swift renamed to Sources/OpenQuartzCore/CATransform3D.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
// Modified from https://github.com/flowkey/UIKit-cross-platform/blob/7e28dc4c62d20afe03e55bbba660076ec06fd79a/Sources/CATransform3D.swift
77

88
public import Foundation
9+
public import struct OpenGraphics.CGAffineTransform
910

1011
public struct CATransform3D: Sendable {
1112
public init(
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
//
2+
// Export.swift
3+
// OpenQuartzCoreShims
4+
5+
#if OPENGRAPHICS_COREGRAPHICS
6+
@_exported import QuartzCore
7+
#else
8+
@_exported import OpenQuartzCore
9+
@_exported import OpenGraphics // QuartzCore will export CoreGraphics
10+
@_exported import CoreFoundation // CoreGraphics will export CoreFoundation
11+
@_exported import Foundation // For non-Darwin platforms, CG_TYPES is defined on Foundation
12+
#endif

Tests/OpenGraphicsShimsTests/CATransform3DTests.swift renamed to Tests/OpenQuartzCoreShimsTests/CATransform3DTests.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
// OpenGraphicsShimsTests
44

55
import Testing
6-
import OpenGraphicsShims
6+
import OpenQuartzCoreShims
77
import Numerics
88

99
@Suite

0 commit comments

Comments
 (0)