diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml new file mode 100644 index 0000000..83e3ffb --- /dev/null +++ b/.github/FUNDING.yml @@ -0,0 +1 @@ +github: [mattmassicotte] diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..cb369bc --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,35 @@ +name: CI + +on: + push: + branches: + - main + paths-ignore: + - 'README.md' + - 'CODE_OF_CONDUCT.md' + - '.editorconfig' + - '.spi.yml' + pull_request: + branches: + - main + +env: + DEVELOPER_DIR: /Applications/Xcode_15.2.app/Contents/Developer + +jobs: + test: + name: Test + runs-on: macOS-13 + strategy: + matrix: + destination: + - "platform=macOS" + - "platform=macOS,variant=Mac Catalyst" + - "platform=iOS Simulator,name=iPhone 11" + - "platform=tvOS Simulator,name=Apple TV" + - "platform=visionOS Simulator,name=Apple Vision Pro" + + steps: + - uses: actions/checkout@v4 + - name: Test platform ${{ matrix.destination }} + run: set -o pipefail && xcodebuild -scheme Textbook -destination "${{ matrix.destination }}" test | xcbeautify diff --git a/Package.swift b/Package.swift new file mode 100644 index 0000000..40b8e7e --- /dev/null +++ b/Package.swift @@ -0,0 +1,30 @@ +// swift-tools-version: 5.8 + +import PackageDescription + +let package = Package( + name: "Textbook", + platforms: [ + .macOS(.v10_15), + .macCatalyst(.v13), + .iOS(.v13), + .tvOS(.v13), + ], + products: [ + .library(name: "Textbook", targets: ["Textbook"]), + ], + targets: [ + .target(name: "Textbook"), + .testTarget(name: "TextbookTests", dependencies: ["Textbook"]), + ] +) + +let swiftSettings: [SwiftSetting] = [ + .enableExperimentalFeature("StrictConcurrency"), +] + +for target in package.targets { + var settings = target.swiftSettings ?? [] + settings.append(contentsOf: swiftSettings) + target.swiftSettings = settings +} diff --git a/Sources/Textbook/Platform.swift b/Sources/Textbook/Platform.swift new file mode 100644 index 0000000..121dd10 --- /dev/null +++ b/Sources/Textbook/Platform.swift @@ -0,0 +1,12 @@ +import SwiftUI + +#if os(macOS) && !targetEnvironment(macCatalyst) +import AppKit + +typealias NSUITextView = NSTextView + +#elseif os(iOS) || os(tvOS) || os(visionOS) +import UIKit + +typealias NSUITextView = UITextView +#endif diff --git a/Sources/Textbook/Textbook.swift b/Sources/Textbook/Textbook.swift new file mode 100644 index 0000000..08b22b8 --- /dev/null +++ b/Sources/Textbook/Textbook.swift @@ -0,0 +1,2 @@ +// The Swift Programming Language +// https://docs.swift.org/swift-book diff --git a/Tests/TextbookTests/TextbookTests.swift b/Tests/TextbookTests/TextbookTests.swift new file mode 100644 index 0000000..9036480 --- /dev/null +++ b/Tests/TextbookTests/TextbookTests.swift @@ -0,0 +1,12 @@ +import XCTest +@testable import Textbook + +final class TextbookTests: XCTestCase { + func testExample() throws { + // XCTest Documentation + // https://developer.apple.com/documentation/xctest + + // Defining Test Cases and Test Methods + // https://developer.apple.com/documentation/xctest/defining_test_cases_and_test_methods + } +}