All Projects → brightdigit → SwiftVer

brightdigit / SwiftVer

Licence: MIT License
Easily Manage Versioning in MacOS, iOS, watchOS, and tvOS projects.

Programming Languages

swift
15916 projects
shell
77523 projects
ruby
36898 projects - #4 most used programming language
Makefile
30231 projects
python
139335 projects - #7 most used programming language
c
50402 projects - #5 most used programming language
objective c
16641 projects - #2 most used programming language

Projects that are alternatives of or similar to SwiftVer

L10n Swift
Localization of the application with ability to change language "on the fly" and support for plural form in any language.
Stars: ✭ 177 (+669.57%)
Mutual labels:  tvos, watchos, carthage, plist
Sqift
Powerful Swift wrapper for SQLite
Stars: ✭ 119 (+417.39%)
Mutual labels:  tvos, watchos, carthage
Columbus
A feature-rich country picker for iOS, tvOS and watchOS.
Stars: ✭ 23 (+0%)
Mutual labels:  tvos, watchos, carthage
Color
Color utilities for macOS, iOS, tvOS, and watchOS
Stars: ✭ 145 (+530.43%)
Mutual labels:  tvos, watchos, carthage
Mechanica
A cross-platform library of Swift utils to ease your iOS | macOS | watchOS | tvOS and Linux development.
Stars: ✭ 27 (+17.39%)
Mutual labels:  tvos, watchos, carthage
Swifterswift
A handy collection of more than 500 native Swift extensions to boost your productivity.
Stars: ✭ 10,706 (+46447.83%)
Mutual labels:  tvos, watchos, carthage
Ducttape
📦 KeyPath dynamicMemberLookup based syntax sugar for Swift.
Stars: ✭ 138 (+500%)
Mutual labels:  tvos, watchos, carthage
Swiftyattributes
A Swifty API for attributed strings
Stars: ✭ 1,303 (+5565.22%)
Mutual labels:  tvos, watchos, carthage
BlockiesSwift
Unique blocky identicons generator for Swift
Stars: ✭ 53 (+130.43%)
Mutual labels:  tvos, watchos, carthage
Cocoalumberjack
A fast & simple, yet powerful & flexible logging framework for Mac and iOS
Stars: ✭ 12,584 (+54613.04%)
Mutual labels:  tvos, watchos, carthage
TermiNetwork
🌏 A zero-dependency networking solution for building modern and secure iOS, watchOS, macOS and tvOS applications.
Stars: ✭ 80 (+247.83%)
Mutual labels:  tvos, watchos, carthage
Iso8601
ISO8601 date parser and writer
Stars: ✭ 213 (+826.09%)
Mutual labels:  tvos, watchos, carthage
Sdwebimagewebpcoder
A WebP coder plugin for SDWebImage, use libwebp
Stars: ✭ 101 (+339.13%)
Mutual labels:  tvos, watchos, carthage
Diff
Simple diff library in pure Swift
Stars: ✭ 110 (+378.26%)
Mutual labels:  tvos, watchos, carthage
Mixpanel
Unofficial Swift Mixpanel client
Stars: ✭ 93 (+304.35%)
Mutual labels:  tvos, watchos, carthage
Contentful.swift
A delightful Swift interface to Contentful's content delivery API.
Stars: ✭ 132 (+473.91%)
Mutual labels:  tvos, watchos, carthage
Swiftlinkpreview
It makes a preview from an URL, grabbing all the information such as title, relevant texts and images.
Stars: ✭ 1,216 (+5186.96%)
Mutual labels:  tvos, watchos, carthage
Commoncrypto
CommonCrypto Swift module
Stars: ✭ 87 (+278.26%)
Mutual labels:  tvos, watchos, carthage
Cdmarkdownkit
An extensive Swift framework providing simple and customizable markdown parsing.
Stars: ✭ 158 (+586.96%)
Mutual labels:  tvos, watchos, carthage
Cache
Swift caching library
Stars: ✭ 210 (+813.04%)
Mutual labels:  tvos, watchos, carthage

header

SwiftVer

SwiftPM Twitter GitHub GitHub issues Beerpay Analytics

macOS ubuntu Travis (.com) Codecov CodeFactor Grade codebeat badge Code Climate maintainability Code Climate technical debt Code Climate issues

Version License Platform Cocoapods doc percentage Carthage compatible Reviewed by Hound

Manage versioning in MacOS, iOS, watchOS, and tvOS projects by parsing your bundle and revision metadata from your VCS repository.

screenshoot

Contents

Requirements

  • XCode 8.0
  • macOS 10.10+, iOS 8.1+, watchOS 2.0+

Installation

CocoaPods

CocoaPods is a dependency manager for Cocoa projects. You can install it with the following command:

$ gem install cocoapods

To integrate SwiftVer into your Xcode project using CocoaPods, specify it in your Podfile:

use_frameworks!

pod 'SwiftVer'

Then, run the following command:

$ pod install

Carthage

Carthage is a decentralized dependency manager that builds your dependencies and provides you with binary frameworks.

You can install Carthage with Homebrew using the following command:

$ brew update
$ brew install carthage

To integrate SwiftVer into your Xcode project using Carthage, specify it in your Cartfile:

github "brightdigit/SwiftVer" ~> 2.0.0

Run carthage update to build the framework and drag the built SwiftVer.framework into your Xcode project.

Usage

Parsing the Version from a Bundle

The Version bundle initializer takes in a bundle and failable. If your Bundle does to contain a valid version string in the format of major.minor or major.minor.patch, the initializer will fail.

guard let version = Version(bundle: Bundle.main) else {
	// invalid version format
}

Valid

xcode screenshot version 1.0.1

Valid

xcode screenshot version 1.0

Invalid

xcode screenshot version 1

Integrating Version Control Info with Autorevision

You can revision metadata from your VCS repository using Autorevision.

  1. Add the bash script from Autorevision.

  2. Add a Run Script build phase to your project.

"${SRCROOT}/autorevision.sh" -t <format> >${SRCROOT}/framework/autorevision.<format>
  1. Include the output in your bundle.

  2. Parse the output and call the VersionControlInfo initializer.

public struct VersionControlInfo {  
	public init(type: String,
              baseName: String,
              uuid: Hash?,
              number: Int,
              date: String,
              branch: String,
              tag: String?,
              tick: Int?,
              extra: String?,
              hash: String,

              isWorkingCopyModified: Bool)
}

Using a StageBuildDictionary to parse Stage

In version 2.0.0, you can parse the stage based on a StageBuildDictionary. The StageBuildDictionary is a plist which maps the Semantic Versions to Stages and their minimum build number.

Plist where the Build Number Resets at Each Semantic Version (iOS)

intra build stage dictionary plist screenshot

Plist where the Build Number does not Reset at Each Semantic Version (Sparkle-compatible macOS)

global build stage dictionary plist screenshot

To create the dictionary pass it to the following method:

public enum Stage {
  public static func dictionary(fromPlistAtURL url: URL) -> StageBuildDictionaryProtocol?
}

Documentation

Documentation Here

Author

Leo G Dion, BrightDigit, LLC

License

SwiftVer is available under the MIT license. See the LICENSE file for more info.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].