Skip to content

Commit

Permalink
Merge pull request #5 from stickytools/swift-4.2
Browse files Browse the repository at this point in the history
Update to swift 4.2 and add CocoaPods support for next release.
  • Loading branch information
tonystone authored Feb 20, 2019
2 parents 347c167 + a635fd5 commit 6abd290
Show file tree
Hide file tree
Showing 9 changed files with 95 additions and 48 deletions.
22 changes: 9 additions & 13 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -18,18 +18,6 @@ Documentation/html/*
*.xcworkspace
build/
DerivedData/

#==============================================================================#
# Idea (Jetbrains)
#
# We ignore all jetbrains project files since it is a generated output of cmake.
#
#==============================================================================#
.idea

#==============================================================================#
# Various settings
#==============================================================================#
*.pbxuser
!default.pbxuser
*.mode1v3
Expand All @@ -40,6 +28,14 @@ DerivedData/
!default.perspectivev3
xcuserdata/

#==============================================================================#
# Idea (Jetbrains)
#
# We ignore all jetbrains project files since it is a generated output of cmake.
#
#==============================================================================#
.idea

#==============================================================================#
# Other
#==============================================================================#
Expand Down Expand Up @@ -135,4 +131,4 @@ cmake-build-debug
#==============================================================================#
# Ruby
#==============================================================================#
Gemfile.lock
Gemfile.lock
25 changes: 16 additions & 9 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ env:
global:
- PROJECT=StickyLocking.xcodeproj
- SCHEME=StickyLocking-Package
- TEST_SDK=iphonesimulator

matrix:
include:
Expand All @@ -23,7 +22,7 @@ matrix:
- BUILD="cmake build"
-
os: osx
osx_image: xcode9.3
osx_image: xcode10
env:
- BUILD="cmake build"
-
Expand All @@ -34,20 +33,28 @@ matrix:
- BUILD="swift build"
-
os: osx
osx_image: xcode9.3
osx_image: xcode10
env:
- BUILD="swift build"
-
os: osx
osx_image: xcode9.3
osx_image: xcode10
env:
- BUILD="pod lint"
-
os: osx
osx_image: xcode9.3
osx_image: xcode10
env:
- BUILD="xcodebuild"
- TEST_DEST="platform=iOS Simulator,OS=11.3,name=iPhone 8"
- TEST_DEST="platform=OS X,arch=x86_64"
- TEST_SDK=macosx
-
os: osx
osx_image: xcode10
env:
- BUILD="xcodebuild"
- TEST_DEST="platform=iOS Simulator,OS=12.0,name=iPhone 8"
- TEST_SDK=iphonesimulator


# don't re-build for tags so that [publish binary] is not re-run
Expand Down Expand Up @@ -82,9 +89,9 @@ before_install:
sudo apt-get update -y
sudo apt-get -y install clang-3.8 lldb-3.8 libicu-dev
wget https://swift.org/builds/swift-4.1-release/ubuntu1404/swift-4.1-RELEASE/swift-4.1-RELEASE-ubuntu14.04.tar.gz
tar xzvf swift-4.1-RELEASE-ubuntu14.04.tar.gz
export PATH=$(pwd)/swift-4.1-RELEASE-ubuntu14.04/usr/bin:$PATH
wget https://swift.org/builds/swift-4.2-release/ubuntu1404/swift-4.2-RELEASE/swift-4.2-RELEASE-ubuntu14.04.tar.gz
tar xzvf swift-4.2-RELEASE-ubuntu14.04.tar.gz
export PATH=$(pwd)/swift-4.2-RELEASE-ubuntu14.04/usr/bin:$PATH
fi
script:
Expand Down
11 changes: 11 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Change Log
All significant changes to this project will be documented in this file.

## [1.0.0-beta.2](https://github.com/stickytools/sticky-locking/tree/1.0.0-beta.2)

#### Added
- Added **CocoaPods** support.

## [1.0.0-beta.1](https://github.com/stickytools/sticky-locking/tree/1.0.0-beta.1)

- Initial beta release of **StickyLocking**, a general purpose embedded hierarchical lock manager used to build highly concurrent applications of all types."
4 changes: 2 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ add_custom_target(build-clean
#
add_custom_target(xcode-project
DEPENDS build-tools generate-source generate-tests
COMMAND swift package generate-xcodeproj --enable-code-coverage
COMMAND swift package generate-xcodeproj --xcconfig-overrides Package.xcconfig --enable-code-coverage
WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}"
SOURCES Package.swift)

Expand All @@ -67,4 +67,4 @@ add_custom_target(documentation
WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}")

add_subdirectory(Sources)
add_subdirectory(Tests)
add_subdirectory(Tests)
4 changes: 2 additions & 2 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
source 'https://rubygems.org'
gem 'cocoapods', '~> 1.5.0'
gem 'xcpretty', '~> 0.2.4'
gem 'cocoapods', '~> 1.6.0'
gem 'xcpretty', '~> 0.2.4'
4 changes: 2 additions & 2 deletions Package.swift
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// swift-tools-version:4.0
// swift-tools-version:4.2
///
/// Package.swift
///
Expand Down Expand Up @@ -32,5 +32,5 @@ let package = Package(
/// Tests
.testTarget(name: "StickyLockingTests", dependencies: ["StickyLocking"], path: "Tests/StickyLockingTests")
],
swiftLanguageVersions: [4]
swiftLanguageVersions: [.v4_2]
)
26 changes: 26 additions & 0 deletions Package.xcconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
///
/// Package.xcconfig
///
/// Copyright 2018 Tony Stone
///
/// Licensed under the Apache License, Version 2.0 (the "License");
/// you may not use this file except in compliance with the License.
/// You may obtain a copy of the License at
///
/// http://www.apache.org/licenses/LICENSE-2.0
///
/// Unless required by applicable law or agreed to in writing, software
/// distributed under the License is distributed on an "AS IS" BASIS,
/// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
/// See the License for the specific language governing permissions and
/// limitations under the License.
///
/// Created by Tony Stone on 6/11/18.
///
CLANG_ENABLE_MODULES = YES
SWIFT_VERSION = "4.2"

IPHONEOS_DEPLOYMENT_TARGET = 8.0
MACOSX_DEPLOYMENT_TARGET = 10.10
WATCHOS_DEPLOYMENT_TARGET = 2.0
TVOS_DEPLOYMENT_TARGET = 9.0
43 changes: 25 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,32 +4,29 @@
<img src="https://img.shields.io/badge/platforms-iOS%20%7C%20macOS%20%7C%20watchOS%20%7C%20tvOS%20%7C%20Linux%20-lightgray.svg?style=flat" alt="Platforms: iOS | macOS | watchOS | tvOS | Linux" />
</a>
<a href="https://github.com/stickytools/sticky-locking/" target="_blank">
<img src="https://img.shields.io/badge/Swift-4.0-orange.svg?style=flat" alt="Swift 4.0">
<img src="https://img.shields.io/badge/Swift-4.2-orange.svg?style=flat" alt="Swift 4.2">
</a>
<a href="https://github.com/stickytools/sticky-locking/" target="_blank">
<img src="https://img.shields.io/cocoapods/v/StickyLocking.svg?style=flat" alt="Pod version">
</a>
<a href="https://travis-ci.org/stickytools/sticky-locking" target="_blank">
  <img src="https://travis-ci.org/stickytools/sticky-locking.svg?branch=master" alt="travis-ci.org" />
</a>
<a href="https://codecov.io/gh/stickytools/sticky-locking" target="_blank">
  <img src="https://codecov.io/gh/stickytools/sticky-locking/branch/master/graph/badge.svg" alt="Codecov" />
</a>
<a href="https://github.com/stickytools/sticky-locking/" target="_blank">
<img src="https://img.shields.io/cocoapods/v/StickyLocking.svg?style=flat" alt="Pod version">
</a>
<a href="https://github.com/stickytools/sticky-locking/" target="_blank">
<img src="https://img.shields.io/cocoapods/dt/StickyLocking.svg?style=flat" alt="Downloads">
</a>

## Overview

**StickyLocking** is a general purpose embedded lock manager which allows for locking any resource hierarchy. Installable Lock modes allow for custimization of the locking system that can meet the needs of almost any locking scenario.

It offers multiple levels of locking for various use cases.
It offers multiple levels of locking for various use cases.

### **Hierarchical Locker**

Sticky Locking provides the `Locker` class which is a high-level locking system designed to facilitate many different
concurrency use cases including simple readers-writer locks which provide shared access for read operations and
exclusive access for write operations to more complex hierarchical locking schemes used to power database file,
Sticky Locking provides the `Locker` class which is a high-level locking system designed to facilitate many different
concurrency use cases including simple readers-writer locks which provide shared access for read operations and
exclusive access for write operations to more complex hierarchical locking schemes used to power database file,
database, page, and row level locking.

The `Locker` is highly configurable to your specific use case using three interconnected constructs.
Expand All @@ -40,23 +37,23 @@ The `Locker` is highly configurable to your specific use case using three interc

Sticky has two built-in sets of these values in the following enums.

`SharedExclusiveLockMode` which is a simple readers-writer system used to provide shared read access and exclusive
`SharedExclusiveLockMode` which is a simple readers-writer system used to provide shared read access and exclusive
write access.

An example use case for this mode may be to protect access to a file or many files which require all readers to be able
to share access to the file and writers to be granted exclusive access forcing readers and writers to wait until the
write operation is complete before they proceed.

`ExtendedLockMode` an extended mode that includes intention and update modes which can be used for advanced database
`ExtendedLockMode` an extended mode that includes intention and update modes which can be used for advanced database
type use cases. This LockMode set was designed to be used by other models in the Sticky Tools suite of libraries.

You are free to define your own LockMode set depending on your use case, from simpler mode structures to more complex,
Sticky Locking will adapt to the mode given.

### **Mutexes & Conditions**

Sticky Locking provides a low-level mutual exclusion lock through the `Mutex` class to protect critical sections of
your code. In addition, wait conditions (`Condition`) are provided to allow for threads to wait for a mutex to
Sticky Locking provides a low-level mutual exclusion lock through the `Mutex` class to protect critical sections of
your code. In addition, wait conditions (`Condition`) are provided to allow for threads to wait for a mutex to
become available.

The mutual exclusion lock is provided through the `Mutex` class while wait conditions can be created with the
Expand All @@ -78,20 +75,30 @@ You can find the latest sources and binaries on [github](https://github.com/stic
- Push to the branch: `git push origin my-new-feature`
- Submit a pull request :-)

## Installation
## Installation

### Swift Package Manager

**StickyLocking** supports dependency management via Swift Package Manager on All Apple OS variants as well as Linux.

Please see [Swift Package Manager](https://swift.org/package-manager/#conceptual-overview) for further information.

### CocoaPods

StickyLocking is available through [CocoaPods](http://cocoapods.org). To install it, simply add the following line to your Podfile:

```ruby
pod "StickyLocking"
```

## Minimum Requirements

Build Environment

| Platform | Swift | Swift Build | Xcode |
|:--------:|:-----:|:----------:|:------:|
| Linux | 4.0 | &#x2714; | &#x2718; |
| OSX | 4.0 | &#x2714; | Xcode 9.0 |
| Linux | 4.2 | &#x2714; | &#x2718; |
| OSX | 4.2 | &#x2714; | Xcode 10.0 |

Minimum Runtime Version

Expand Down
4 changes: 2 additions & 2 deletions StickyLocking.podspec
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

Pod::Spec.new do |s|
s.name = "StickyLocking"
s.version = "1.0.0-beta.1"
s.version = "1.0.0-beta.2"
s.summary = "A general purpose embedded hierarchical lock manager used to build highly concurrent applications of all types."

s.homepage = "https://github.com/stickytools/sticky-locking"
Expand All @@ -19,4 +19,4 @@ Pod::Spec.new do |s|
s.requires_arc = true

s.source_files = 'Sources/StickyLocking/**/*.swift'
end
end

0 comments on commit 6abd290

Please sign in to comment.