Skip to content
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
14 changes: 7 additions & 7 deletions .github/workflows/compatibility_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@ jobs:
xcode-version: "16.4" # Swift 6.1.2
runs-on: ${{ matrix.os }}
env:
OPENBOX_WERROR: 1
OPENBOX_RENDERBOX: 1
OPENBOX_COMPATIBILITY_TEST: 1
OPENBOX_USE_LOCAL_DEPS: 1
OPENBOX_TARGET_RELEASE: 2024
OPENRENDERBOX_WERROR: 1
OPENRENDERBOX_RENDERBOX: 1
OPENRENDERBOX_COMPATIBILITY_TEST: 1
OPENRENDERBOX_USE_LOCAL_DEPS: 1
OPENRENDERBOX_TARGET_RELEASE: 2024
DARWIN_PRIVATE_FRAMEWORKS_TARGET_RELEASE: 2024
GH_TOKEN: ${{ github.token }}
steps:
Expand All @@ -37,14 +37,14 @@ jobs:
run: swift --version
- name: Run tests against Apple's RENDERBOX on macOS via SwiftPM
env:
OPENBOX_LIBRARY_EVOLUTION: 0
OPENRENDERBOX_LIBRARY_EVOLUTION: 0
run: |
swift test \
--build-path .build-compatibility-test-debug
- name: Run tests against Apple's RENDERBOX on macOS via Xcode
run: |
xcodebuild test \
-scheme OpenBox-Package \
-scheme OpenRenderBox-Package \
-sdk macosx \
-destination "platform=macOS" \
-skipPackagePluginValidation \
Expand Down
14 changes: 7 additions & 7 deletions .github/workflows/ios.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@ jobs:
ios-simulator-name: "iPhone 16 Pro"
runs-on: ${{ matrix.os }}
env:
OPENBOX_WERROR: 1
OPENBOX_RENDERBOX: 0
OPENBOX_COMPATIBILITY_TEST: 0
OPENBOX_USE_LOCAL_DEPS: 1
OPENBOX_TARGET_RELEASE: 2024
OPENRENDERBOX_WERROR: 1
OPENRENDERBOX_RENDERBOX: 0
OPENRENDERBOX_COMPATIBILITY_TEST: 0
OPENRENDERBOX_USE_LOCAL_DEPS: 1
OPENRENDERBOX_TARGET_RELEASE: 2024
DARWIN_PRIVATE_FRAMEWORKS_TARGET_RELEASE: 2024
GH_TOKEN: ${{ github.token }}
steps:
Expand All @@ -41,7 +41,7 @@ jobs:
- name: Build in debug mode on iOS
run: |
xcodebuild build \
-scheme OpenBox-Package \
-scheme OpenRenderBox-Package \
-configuration Debug \
-destination "platform=iOS Simulator,OS=${{ matrix.ios-version }},name=${{ matrix.ios-simulator-name }}" \
-derivedDataPath .build-debug \
Expand All @@ -51,7 +51,7 @@ jobs:
- name: Build and run tests in debug mode with coverage on iOS Simulator
run: |
xcodebuild test \
-scheme OpenBox-Package \
-scheme OpenRenderBox-Package \
-configuration Debug \
-destination "platform=iOS Simulator,OS=${{ matrix.ios-version }},name=${{ matrix.ios-simulator-name }}" \
-enableCodeCoverage=YES \
Expand Down
16 changes: 8 additions & 8 deletions .github/workflows/macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@ jobs:
xcode-version: [16.4] # Swift 6.1.2
runs-on: ${{ matrix.os }}
env:
OPENBOX_WERROR: 1
OPENBOX_RENDERBOX: 0
OPENBOX_COMPATIBILITY_TEST: 0
OPENBOX_USE_LOCAL_DEPS: 1
OPENBOX_TARGET_RELEASE: 2024
OPENRENDERBOX_WERROR: 1
OPENRENDERBOX_RENDERBOX: 0
OPENRENDERBOX_COMPATIBILITY_TEST: 0
OPENRENDERBOX_USE_LOCAL_DEPS: 1
OPENRENDERBOX_TARGET_RELEASE: 2024
DARWIN_PRIVATE_FRAMEWORKS_TARGET_RELEASE: 2024
GH_TOKEN: ${{ github.token }}
steps:
Expand All @@ -36,19 +36,19 @@ jobs:
run: swift --version
- name: Build and run tests in debug mode with coverage
env:
OPENBOX_LIBRARY_EVOLUTION: 0
OPENRENDERBOX_LIBRARY_EVOLUTION: 0
run: |
swift test \
-c debug \
--enable-code-coverage \
--build-path .build-test-debug
xcrun llvm-cov show \
-instr-profile=.build-test-debug/debug/codecov/default.profdata \
.build-test-debug/debug/OPENBOXPackageTests.xctest/Contents/MacOS/OPENBOXPackageTests \
.build-test-debug/debug/OpenRenderBoxPackageTests.xctest/Contents/MacOS/OpenRenderBoxPackageTests \
> coverage.txt
- name: Build and run tests in release mode
env:
OPENBOX_LIBRARY_EVOLUTION: 0
OPENRENDERBOX_LIBRARY_EVOLUTION: 0
run: |
swift test \
-c release \
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/ubuntu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ jobs:
swift_version: ["6.1.2"]
runs-on: ubuntu-22.04
env:
OPENBOX_WERROR: 1
OPENBOX_RENDERBOX: 0
OPENBOX_COMPATIBILITY_TEST: 0
OPENRENDERBOX_WERROR: 1
OPENRENDERBOX_RENDERBOX: 0
OPENRENDERBOX_COMPATIBILITY_TEST: 0
container: swift:${{ matrix.swift_version }}-jammy
steps:
- uses: actions/checkout@v4
Expand All @@ -36,7 +36,7 @@ jobs:
--build-path .build-test-debug
llvm-cov show \
-instr-profile=.build-test-debug/debug/codecov/default.profdata \
.build-test-debug/debug/OpenBoxPackageTests.xctest \
.build-test-debug/debug/OpenRenderBoxPackageTests.xctest \
> coverage.txt
- name: Building and running tests in release mode
run: |
Expand Down
2 changes: 1 addition & 1 deletion .spi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ version: 1
builder:
configs:
- swift_version: 6.0
documentation_targets: [OpenBox]
documentation_targets: [OpenRenderBox]
42 changes: 21 additions & 21 deletions Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@ let isSPIBuild = envEnable("SPI_BUILD")
// MARK: - Env and Config

let isXcodeEnv = Context.environment["__CFBundleIdentifier"] == "com.apple.dt.Xcode"
let development = envEnable("OPENBOX_DEVELOPMENT")
let development = envEnable("OPENRENDERBOX_DEVELOPMENT")

let releaseVersion = Context.environment["OPENBOX_TARGET_RELEASE"].flatMap { Int($0) } ?? 2024
let releaseVersion = Context.environment["OPENRENDERBOX_TARGET_RELEASE"].flatMap { Int($0) } ?? 2024

let swiftBinPath = Context.environment["_"] ?? "/usr/bin/swift"
let swiftBinURL = URL(fileURLWithPath: swiftBinPath)
Expand All @@ -54,37 +54,37 @@ var sharedSwiftSettings: [SwiftSetting] = [
.swiftLanguageMode(.v5),
]

// MARK: - [env] OPENBOX_LIBRARY_EVOLUTION
// MARK: - [env] OPENRENDERBOX_LIBRARY_EVOLUTION

let libraryEvolutionCondition = envEnable("OPENBOX_LIBRARY_EVOLUTION", default: buildForDarwinPlatform)
let libraryEvolutionCondition = envEnable("OPENRENDERBOX_LIBRARY_EVOLUTION", default: buildForDarwinPlatform)

if libraryEvolutionCondition {
// NOTE: -enable-library-evolution will cause module verify failure for `swift build`.
// Either set OPENBOX_LIBRARY_EVOLUTION=0 or add `-Xswiftc -no-verify-emitted-module-interface` after `swift build`
// Either set OPENRENDERBOX_LIBRARY_EVOLUTION=0 or add `-Xswiftc -no-verify-emitted-module-interface` after `swift build`
sharedSwiftSettings.append(.unsafeFlags(["-enable-library-evolution", "-no-verify-emitted-module-interface"]))
}

// MARK: - Targets

let openBoxTarget = Target.target(
name: "OpenBox",
name: "OpenRenderBox",
cSettings: sharedCSettings,
cxxSettings: sharedCxxSettings
)
let openBoxShimsTarget = Target.target(
name: "OpenBoxShims",
name: "OpenRenderBoxShims",
swiftSettings: sharedSwiftSettings
)
let openBoxTestTarget = Target.testTarget(
name: "OpenBoxTests",
name: "OpenRenderBoxTests",
dependencies: [
"OpenBox",
"OpenRenderBox",
],
exclude: ["README.md"],
swiftSettings: sharedSwiftSettings
)
let openBoxCompatibilityTestTarget = Target.testTarget(
name: "OpenBoxCompatibilityTests",
name: "OpenRenderBoxCompatibilityTests",
dependencies: [
.product(name: "RealModule", package: "swift-numerics"),
],
Expand All @@ -95,7 +95,7 @@ let openBoxCompatibilityTestTarget = Target.testTarget(
// MARK: - Package

let libraryType: Product.Library.LibraryType?
switch Context.environment["OPENBOX_LIBRARY_TYPE"] {
switch Context.environment["OPENRENDERBOX_LIBRARY_TYPE"] {
case "dynamic":
libraryType = .dynamic
case "static":
Expand All @@ -105,10 +105,10 @@ default:
}

let package = Package(
name: "OpenBox",
name: "OpenRenderBox",
products: [
.library(name: "OpenBox", type: libraryType, targets: ["OpenBox"]),
.library(name: "OpenBoxShims", type: libraryType, targets: ["OpenBoxShims"]),
.library(name: "OpenRenderBox", type: libraryType, targets: ["OpenRenderBox"]),
.library(name: "OpenRenderBoxShims", type: libraryType, targets: ["OpenRenderBoxShims"]),
],
dependencies: [
.package(url: "https://github.com/apple/swift-numerics", from: "1.0.2"),
Expand All @@ -123,9 +123,9 @@ let package = Package(
cxxLanguageStandard: .cxx20
)

let useLocalDeps = envEnable("OPENBOX_USE_LOCAL_DEPS")
let useLocalDeps = envEnable("OPENRENDERBOX_USE_LOCAL_DEPS")

let renderBoxCondtion = envEnable("OPENBOX_RENDERBOX", default: buildForDarwinPlatform && !isSPIBuild )
let renderBoxCondtion = envEnable("OPENRENDERBOX_RENDERBOX", default: buildForDarwinPlatform && !isSPIBuild )

if renderBoxCondtion {
let privateFrameworkRepo: Package.Dependency
Expand All @@ -136,7 +136,7 @@ if renderBoxCondtion {
}
package.dependencies.append(privateFrameworkRepo)
var swiftSettings: [SwiftSetting] = (openBoxShimsTarget.swiftSettings ?? [])
swiftSettings.append(.define("OPENBOX_RENDERBOX"))
swiftSettings.append(.define("OPENRENDERBOX_RENDERBOX"))
openBoxShimsTarget.swiftSettings = swiftSettings
openBoxShimsTarget.dependencies.append(
.product(name: "RenderBox", package: "DarwinPrivateFrameworks")
Expand All @@ -149,20 +149,20 @@ if renderBoxCondtion {
default: nil
}
} else {
openBoxShimsTarget.dependencies.append("OpenBox")
openBoxShimsTarget.dependencies.append("OpenRenderBox")
}

let compatibilityTestCondition = envEnable("OPENBOX_COMPATIBILITY_TEST")
let compatibilityTestCondition = envEnable("OPENRENDERBOX_COMPATIBILITY_TEST")
if compatibilityTestCondition && renderBoxCondtion {
openBoxCompatibilityTestTarget.dependencies.append(
.product(name: "RenderBox", package: "DarwinPrivateFrameworks")
)

var swiftSettings: [SwiftSetting] = (openBoxCompatibilityTestTarget.swiftSettings ?? [])
swiftSettings.append(.define("OPENBOX_COMPATIBILITY_TEST"))
swiftSettings.append(.define("OPENRENDERBOX_COMPATIBILITY_TEST"))
openBoxCompatibilityTestTarget.swiftSettings = swiftSettings
} else {
openBoxCompatibilityTestTarget.dependencies.append("OpenBox")
openBoxCompatibilityTestTarget.dependencies.append("OpenRenderBox")
}

extension [Platform] {
Expand Down
18 changes: 9 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# OpenBox
# OpenRenderBox

[![](https://img.shields.io/endpoint?url=https%3A%2F%2Fswiftpackageindex.com%2Fapi%2Fpackages%2FOpenSwiftUIProject%2FOpenBox%2Fbadge%3Ftype%3Dswift-versions)](https://swiftpackageindex.com/OpenSwiftUIProject/OpenBox)
[![](https://img.shields.io/endpoint?url=https%3A%2F%2Fswiftpackageindex.com%2Fapi%2Fpackages%2FOpenSwiftUIProject%2FOpenRenderBox%2Fbadge%3Ftype%3Dswift-versions)](https://swiftpackageindex.com/OpenSwiftUIProject/OpenRenderBox)

[![](https://img.shields.io/endpoint?url=https%3A%2F%2Fswiftpackageindex.com%2Fapi%2Fpackages%2FOpenSwiftUIProject%2FOpenBox%2Fbadge%3Ftype%3Dplatforms)](https://swiftpackageindex.com/OpenSwiftUIProject/OpenBox)
[![](https://img.shields.io/endpoint?url=https%3A%2F%2Fswiftpackageindex.com%2Fapi%2Fpackages%2FOpenSwiftUIProject%2FOpenRenderBox%2Fbadge%3Ftype%3Dplatforms)](https://swiftpackageindex.com/OpenSwiftUIProject/OpenRenderBox)

[![codecov](https://codecov.io/github/OpenSwiftUIProject/OpenBox/graph/badge.svg?token=1MC561FQUR)](https://codecov.io/github/OpenSwiftUIProject/OpenBox)
[![codecov](https://codecov.io/github/OpenSwiftUIProject/OpenRenderBox/graph/badge.svg?token=1MC561FQUR)](https://codecov.io/github/OpenSwiftUIProject/OpenRenderBox)

OpenBox is an open source implementation of Apple's Private framework - RenderBox.
OpenRenderBox is an open source implementation of Apple's Private framework - RenderBox.

RenderBox is a high performance rendering engine written in C++.

Expand All @@ -26,10 +26,10 @@ The current suggested toolchain to build the project is Swift 6.1.2 / Xcode 16.4

| **CI Status** |
|---|
|[![Compatibility tests](https://github.com/OpenSwiftUIProject/OpenBox/actions/workflows/compatibility_tests.yml/badge.svg)](https://github.com/OpenSwiftUIProject/OpenBox/actions/workflows/compatibility_tests.yml)|
|[![macOS](https://github.com/OpenSwiftUIProject/OpenBox/actions/workflows/macos.yml/badge.svg)](https://github.com/OpenSwiftUIProject/OpenBox/actions/workflows/macos.yml)|
|[![iOS](https://github.com/OpenSwiftUIProject/OpenBox/actions/workflows/ios.yml/badge.svg)](https://github.com/OpenSwiftUIProject/OpenBox/actions/workflows/ios.yml)|
|[![Ubuntu](https://github.com/OpenSwiftUIProject/OpenBox/actions/workflows/ubuntu.yml/badge.svg)](https://github.com/OpenSwiftUIProject/OpenBox/actions/workflows/ubuntu.yml)|
|[![Compatibility tests](https://github.com/OpenSwiftUIProject/OpenRenderBox/actions/workflows/compatibility_tests.yml/badge.svg)](https://github.com/OpenSwiftUIProject/OpenRenderBox/actions/workflows/compatibility_tests.yml)|
|[![macOS](https://github.com/OpenSwiftUIProject/OpenRenderBox/actions/workflows/macos.yml/badge.svg)](https://github.com/OpenSwiftUIProject/OpenRenderBox/actions/workflows/macos.yml)|
|[![iOS](https://github.com/OpenSwiftUIProject/OpenRenderBox/actions/workflows/ios.yml/badge.svg)](https://github.com/OpenSwiftUIProject/OpenRenderBox/actions/workflows/ios.yml)|
|[![Ubuntu](https://github.com/OpenSwiftUIProject/OpenRenderBox/actions/workflows/ubuntu.yml/badge.svg)](https://github.com/OpenSwiftUIProject/OpenRenderBox/actions/workflows/ubuntu.yml)|

## License

Expand Down
4 changes: 2 additions & 2 deletions Scripts/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ filepath() {
[[ $1 = /* ]] && echo "$1" || echo "$PWD/${1#./}"
}

OPENBOX_ROOT="$(dirname $(dirname $(filepath $0)))"
OPENRENDERBOX_ROOT="$(dirname $(dirname $(filepath $0)))"

cd $OPENBOX_ROOT
cd $OPENRENDERBOX_ROOT

swift build
4 changes: 2 additions & 2 deletions Scripts/build_swiftinterface.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ filepath() {
[[ $1 = /* ]] && echo "$1" || echo "$PWD/${1#./}"
}

OPENBOX_ROOT="$(dirname $(dirname $(filepath $0)))"
OPENRENDERBOX_ROOT="$(dirname $(dirname $(filepath $0)))"

cd $OPENBOX_ROOT
cd $OPENRENDERBOX_ROOT

swift build -Xswiftc -emit-module-interface -Xswiftc -enable-library-evolution -Xswiftc -no-verify-emitted-module-interface
16 changes: 0 additions & 16 deletions Sources/OpenBox/Path/OBPath.cpp

This file was deleted.

54 changes: 0 additions & 54 deletions Sources/OpenBox/Path/OBPathStorage.cpp

This file was deleted.

Loading