diff --git a/.gitignore b/.gitignore index 074eef3..7dea39e 100644 --- a/.gitignore +++ b/.gitignore @@ -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 @@ -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 #==============================================================================# @@ -135,4 +131,4 @@ cmake-build-debug #==============================================================================# # Ruby #==============================================================================# -Gemfile.lock \ No newline at end of file +Gemfile.lock diff --git a/.travis.yml b/.travis.yml index a2073a8..3262a23 100644 --- a/.travis.yml +++ b/.travis.yml @@ -11,7 +11,6 @@ env: global: - PROJECT=StickyLocking.xcodeproj - SCHEME=StickyLocking-Package - - TEST_SDK=iphonesimulator matrix: include: @@ -23,7 +22,7 @@ matrix: - BUILD="cmake build" - os: osx - osx_image: xcode9.3 + osx_image: xcode10 env: - BUILD="cmake build" - @@ -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 @@ -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: diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..30158b3 --- /dev/null +++ b/CHANGELOG.md @@ -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." diff --git a/CMakeLists.txt b/CMakeLists.txt index c293a7f..c35feff 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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) @@ -67,4 +67,4 @@ add_custom_target(documentation WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}") add_subdirectory(Sources) -add_subdirectory(Tests) \ No newline at end of file +add_subdirectory(Tests) diff --git a/Gemfile b/Gemfile index d84b262..932e307 100644 --- a/Gemfile +++ b/Gemfile @@ -1,3 +1,3 @@ source 'https://rubygems.org' -gem 'cocoapods', '~> 1.5.0' -gem 'xcpretty', '~> 0.2.4' \ No newline at end of file +gem 'cocoapods', '~> 1.6.0' +gem 'xcpretty', '~> 0.2.4' diff --git a/Package.swift b/Package.swift index 9f60a17..44738d3 100644 --- a/Package.swift +++ b/Package.swift @@ -1,4 +1,4 @@ -// swift-tools-version:4.0 +// swift-tools-version:4.2 /// /// Package.swift /// @@ -32,5 +32,5 @@ let package = Package( /// Tests .testTarget(name: "StickyLockingTests", dependencies: ["StickyLocking"], path: "Tests/StickyLockingTests") ], - swiftLanguageVersions: [4] + swiftLanguageVersions: [.v4_2] ) diff --git a/Package.xcconfig b/Package.xcconfig new file mode 100644 index 0000000..a67f4d1 --- /dev/null +++ b/Package.xcconfig @@ -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 diff --git a/README.md b/README.md index bb4161c..c957ee1 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,10 @@ Platforms: iOS | macOS | watchOS | tvOS | Linux - Swift 4.0 + Swift 4.2 + + + Pod version   travis-ci.org @@ -12,24 +15,18 @@   Codecov - - Pod version - - - Downloads - ## 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. @@ -40,14 +37,14 @@ 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, @@ -55,8 +52,8 @@ 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 @@ -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 | ✔ | ✘ | -| OSX | 4.0 | ✔ | Xcode 9.0 | +| Linux | 4.2 | ✔ | ✘ | +| OSX | 4.2 | ✔ | Xcode 10.0 | Minimum Runtime Version diff --git a/StickyLocking.podspec b/StickyLocking.podspec index 224f8f4..957e162 100644 --- a/StickyLocking.podspec +++ b/StickyLocking.podspec @@ -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" @@ -19,4 +19,4 @@ Pod::Spec.new do |s| s.requires_arc = true s.source_files = 'Sources/StickyLocking/**/*.swift' -end \ No newline at end of file +end