Skip to content
Draft
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
24 changes: 18 additions & 6 deletions .github/workflows/swift.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,27 @@
name: Swift

on: [push]
on:
push:
branches: [ main, master ]
pull_request:
branches: [ main, master ]

jobs:
build:

test:
name: Test
runs-on: macOS-latest

steps:
- uses: actions/checkout@v1
- name: Build
- name: Checkout
uses: actions/checkout@v4

- name: Setup Xcode
uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: latest-stable

- name: Swift Package Manager - Build
run: swift build -v
- name: Run tests

- name: Swift Package Manager - Test
run: swift test -v
35 changes: 0 additions & 35 deletions .travis.yml

This file was deleted.

14 changes: 14 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,20 @@ All notable changes to this project will be documented in this file.

## [Master](https://github.com/fulldecent/FDChessboardView/compare/4.0.0...master)

#### Changed
- Modernized build system with Swift 6.0 tools version
- Updated minimum iOS deployment target to 13.0
- Updated Swift version to 5.9 in podspec
- Migrated from Travis CI to GitHub Actions
- Updated protocol constraints from deprecated `class` to `AnyObject`
- Removed deprecated test manifest files (XCTestManifests.swift, LinuxMain.swift)
- Added proper platform support for iOS, macOS, tvOS, and watchOS

#### Fixed
- Fixed builds on modern Swift versions
- Updated GitHub Actions workflow with proper platform matrix
- Removed broken CocoaPods quality check script

---

## [3.0.0](https://github.com/fulldecent/FDChessboardView/releases/tag/4.0.0)
Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ All contributors are welcome. Please use issues and pull requests to contribute

# Release Process

1. Confirm the build is passing in travis
1. Confirm the build is passing in GitHub Actions
1. This automatically checks the pod file is building
2. Create a release commit, see [prior releases](https://github.com/fulldecent/FDChessboardView/releases) for an example
1. Update the change log to label the latest improvements under the new version name
Expand Down
4 changes: 2 additions & 2 deletions FDChessboardView.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Pod::Spec.new do |s|
s.homepage = 'https://github.com/fulldecent/FDChessboardView'
s.authors = { 'William Entriken' => '[email protected]' }
s.source = { :git => 'https://github.com/fulldecent/FDChessboardView.git', :tag => s.version }
s.ios.deployment_target = '8.0'
s.ios.deployment_target = '13.0'
s.source_files = 'Sources/**/*.swift'
s.swift_version = '5.0'
s.swift_version = '5.9'
end
7 changes: 6 additions & 1 deletion Package.swift
Original file line number Diff line number Diff line change
@@ -1,10 +1,15 @@
// swift-tools-version:5.1
// swift-tools-version:6.0
// The swift-tools-version declares the minimum version of Swift required to build this package.

import PackageDescription

let package = Package(
name: "FDChessboardView",
platforms: [
.iOS(.v13),
.macOS(.v10_15),
.tvOS(.v13)
],
products: [
// Products define the executables and libraries produced by a package, and make them visible to other packages.
.library(
Expand Down
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
FDChessboardView
================

[![CI Status](http://img.shields.io/travis/fulldecent/FDChessboardView.svg?style=flat)](https://travis-ci.org/fulldecent/FDChessboardView)
[![CI Status](https://github.com/fulldecent/FDChessboardView/workflows/Swift/badge.svg)](https://github.com/fulldecent/FDChessboardView/actions)
[![Version](https://img.shields.io/cocoapods/v/FDChessboardView.svg?style=flat)](http://cocoadocs.org/docsets/FDChessboardView)
[![License](https://img.shields.io/cocoapods/l/FDChessboardView.svg?style=flat)](http://cocoadocs.org/docsets/FDChessboardView)
[![Platform](https://img.shields.io/cocoapods/p/FDChessboardView.svg?style=flat)](http://cocoadocs.org/docsets/FDChessboardView)
Expand All @@ -17,7 +17,7 @@ Features
* Supports all single board chess variants: suicide, losers, atomic, etc.
* Supports games with odd piece arrangement and non-standard castling (Fisher 960)
* Very clean API, this is just a view
* Supports a minimum deployment target of iOS 8 or OS X Mavericks (10.9)
* Supports a minimum deployment target of iOS 13.0

## Installation

Expand All @@ -32,7 +32,7 @@ If you are already using [CocoaPods](http://cocoapods.org), just add 'FDChessboa
If you are already using [Carthage](https://github.com/Carthage/Carthage), just add to your `Cartfile`:

```ogdl
github "fulldecent/FDChessboardView" ~> 0.1
github "fulldecent/FDChessboardView" ~> 3.0
```

Then run `carthage update` to build the framework and drag the built FDChessboardView.framework into your Xcode project.
Expand All @@ -46,7 +46,7 @@ Import the project and implement a data source:
```swift
import FDChessboardView

public protocol FDChessboardViewDataSource: class {
public protocol FDChessboardViewDataSource: AnyObject {
/// What piece is on the square?
func chessboardView(_ board: FDChessboardView, pieceForSquare square: FDChessboardSquare) -> FDChessboardPiece?

Expand All @@ -61,7 +61,7 @@ public protocol FDChessboardViewDataSource: class {
If your application will allow the pieces to be moved, implement a delegate:

```swift
public protocol FDChessboardViewDelegate: class {
public protocol FDChessboardViewDelegate: AnyObject {
/// Where can this piece move to?
func chessboardView(_ board: FDChessboardView, legalDestinationsForPieceAtSquare from: FDChessboardSquare) -> [FDChessboardSquare]

Expand Down
10 changes: 8 additions & 2 deletions Sources/FDChessboardView/FDChessboardView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@
//

import Foundation
#if canImport(UIKit)
import UIKit
#endif

/// The location of a square on a chess board
public struct FDChessboardSquare: Hashable {
Expand Down Expand Up @@ -38,7 +40,9 @@ public struct FDChessboardSquare: Hashable {
}
}

public protocol FDChessboardViewDataSource: class {
#if canImport(UIKit)

public protocol FDChessboardViewDataSource: AnyObject {
/// What piece is on the square?
func chessboardView(_ board: FDChessboardView, pieceForSquare square: FDChessboardSquare) -> FDChessboardPiece?

Expand All @@ -49,7 +53,7 @@ public protocol FDChessboardViewDataSource: class {
func chessboardViewPremove(_ board: FDChessboardView) -> (from:FDChessboardSquare, to:FDChessboardSquare)?
}

public protocol FDChessboardViewDelegate: class {
public protocol FDChessboardViewDelegate: AnyObject {
/// Where can this piece move to?
func chessboardView(_ board: FDChessboardView, legalDestinationsForPieceAtSquare from: FDChessboardSquare) -> [FDChessboardSquare]

Expand Down Expand Up @@ -266,3 +270,5 @@ tile.backgroundColor = self.legalBackgroundColor;
///TODO: implement
}
}

#endif
1 change: 0 additions & 1 deletion Tests/CheckCocoaPodsQualityIndexes.rb

This file was deleted.

20 changes: 16 additions & 4 deletions Tests/FDChessboardViewTests/FDChessboardViewTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,20 @@ final class FDChessboardViewTests: XCTestCase {
// results.
XCTAssertEqual(5, 5)
}

static var allTests = [
("testExample", testExample),
]

func testFDChessboardSquareInit() {
// Test square initialization by index
let square = FDChessboardSquare(index: 0)
XCTAssertEqual(square.index, 0)
XCTAssertEqual(square.file, 0)
XCTAssertEqual(square.rank, 0)
XCTAssertEqual(square.algebraic, "a1")

// Test square initialization by rank and file
let square2 = FDChessboardSquare(newRank: 7, newFile: 7)
XCTAssertEqual(square2.index, 63)
XCTAssertEqual(square2.file, 7)
XCTAssertEqual(square2.rank, 7)
XCTAssertEqual(square2.algebraic, "h8")
}
}
9 changes: 0 additions & 9 deletions Tests/FDChessboardViewTests/XCTestManifests.swift

This file was deleted.

7 changes: 0 additions & 7 deletions Tests/LinuxMain.swift

This file was deleted.