Skip to content

Project config. Travis cofig #5

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 11 commits into
base: master
Choose a base branch
from
Open
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
21 changes: 9 additions & 12 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,23 +4,21 @@ env:
matrix:
include:
- script:
- xcodebuild test -project $MODULE_NAME.xcodeproj -scheme $MODULE_NAME
- xcodebuild clean test -project $MODULE_NAME.xcodeproj -scheme $MODULE_NAME | xcpretty --color && exit ${PIPESTATUS[0]}
os: osx
osx_image: xcode7.3
osx_image: xcode8.1
language: objective-c
before_install:
- brew update
- brew outdated carthage || brew upgrade carthage
- brew install libuv
# - brew outdated xctool || brew upgrade xctool
before_script:
# bootstrap the dependencies for the project
# you can remove if you don't have dependencies
- carthage bootstrap --platform mac
before_deploy:
- carthage build --no-skip-current
- carthage archive $MODULE_NAME
#- pod trunk push CrossroadRegex.podspec
deploy:
provider: releases
api_key:
Expand All @@ -31,26 +29,25 @@ matrix:
repo: reactive-swift/UV
tags: true
- script:
- ./build test
- swift build && swift test
sudo: required
dist: trusty
language: generic
before_install:
# install original swift distribution
- wget -q -O - https://swift.org/keys/all-keys.asc | gpg --import -
- cd ..
- export SWIFT_VERSION="swift-DEVELOPMENT-SNAPSHOT-2016-03-24-a"
- wget https://swift.org/builds/development/ubuntu1404/$SWIFT_VERSION/$SWIFT_VERSION-ubuntu14.04.tar.gz
- tar xzf $SWIFT_VERSION-ubuntu14.04.tar.gz
- export PATH="${PWD}/${SWIFT_VERSION}-ubuntu14.04/usr/bin:${PATH}"
- export SWIFT_VERSION="swift-3.0.1-release"
- SWIFT_VERSION_UPPER=`echo $SWIFT_VERSION | perl -n -e'/^(.*?)-([\.\d]*?)-(.*)$/; $code = uc $3; print "$1-$2-${code}"'`
- wget https://swift.org/builds/$SWIFT_VERSION/ubuntu1404/$SWIFT_VERSION_UPPER/$SWIFT_VERSION_UPPER-ubuntu14.04.tar.gz
- tar xzf $SWIFT_VERSION_UPPER-ubuntu14.04.tar.gz
- export PATH="${PWD}/${SWIFT_VERSION_UPPER}-ubuntu14.04/usr/bin:${PATH}"
- export LD_LIBRARY_PATH="${PWD}/${SWIFT_VERSION_UPPER}-ubuntu14.04/usr/lib/swift/linux/:$LD_LIBRARY_PATH"
# libuv v1
- sudo add-apt-repository ppa:swiftexpress/swiftexpress --yes
- sudo apt-get update
- sudo apt-get install libuv1-dev
# get back home
- cd $MODULE_NAME
# get crossroad build script
- wget https://raw.githubusercontent.com/crossroadlabs/utils/master/build
- chmod +x build
notifications:
email: false
4 changes: 2 additions & 2 deletions Cartfile
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
github "reactive-swift/CUV"
github "crossroadlabs/Boilerplate" "master"
github "reactive-swift/CUV" ~> 1.0
github "crossroadlabs/Boilerplate" ~> 1.0
3 changes: 1 addition & 2 deletions Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,8 @@ import PackageDescription

let package = Package(
name: "UV",
targets: [Target(name: "UV")],
dependencies: [
.Package(url: "https://github.com/reactive-swift/CUV.git", majorVersion: 0, minor: 1),
.Package(url: "https://github.com/crossroadlabs/Boilerplate.git", majorVersion: 0, minor: 2)
.Package(url: "https://github.com/crossroadlabs/Boilerplate.git", Version(1, 0, 0, prereleaseIdentifiers: ["alpha", "2"])),
]
)
9 changes: 3 additions & 6 deletions UV/Async.swift → Sources/UV/Async.swift
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public typealias uv_async_p = UnsafeMutablePointer<uv_async_t>

public typealias AsyncCallback = (Async) -> Void

open class Async : Handle<uv_async_p> {
public class Async : Handle<uv_async_p> {
fileprivate let callback:AsyncCallback

public init(loop:Loop, callback:@escaping AsyncCallback) throws {
Expand All @@ -33,18 +33,15 @@ open class Async : Handle<uv_async_p> {

/// uv_async_send
/// the only thread safe function in this lib
open func send() {
public func send() {
if !handle.isNil {
uv_async_send(handle.portable)
}
}
}

private func _async_cb(_ handle:uv_async_p?) {
private func async_cb(handle:uv_async_p?) {
let async:Async = Async.from(handle:handle)
async.callback(async)
}

private func async_cb(handle:uv_async_p?) {
return _async_cb(handle)
}
14 changes: 7 additions & 7 deletions UV/Error.swift → Sources/UV/Error.swift
Original file line number Diff line number Diff line change
Expand Up @@ -18,26 +18,26 @@ import CUV
import Boilerplate

//TODO: make enum
public enum Error : Swift.Error {
public enum UVError : Error {
case withCode(code:Int32)
case handleClosed
}

extension Error : ErrorWithCodeType {
extension UVError : ErrorWithCodeType {
public init(code:Int32) {
self = .withCode(code: code)
}

public static func isError(_ code:Int32) -> Bool {
return code < 0
}
public static func error(code:Int32) -> Error? {
return isError(code) ? Error(code: code) : nil

public static func error(code:Int32) -> UVError? {
return isError(code) ? UVError(code: code) : nil
}
}

public extension Error {
public extension UVError {
public var name:String {
get {
switch self {
Expand All @@ -50,7 +50,7 @@ public extension Error {
}
}

extension Error : CustomStringConvertible {
extension UVError : CustomStringConvertible {
public var description: String {
get {
switch self {
Expand Down
Loading