Skip to content

Commit

Permalink
Merge pull request #2 from PerfectlySoft/develop
Browse files Browse the repository at this point in the history
upgrade to Swift 4.2
  • Loading branch information
RockfordWei authored Mar 12, 2019
2 parents 26d0211 + a8c7938 commit 5f761f8
Show file tree
Hide file tree
Showing 8 changed files with 43 additions and 40 deletions.
32 changes: 21 additions & 11 deletions Package.swift
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// swift-tools-version:4.2
//
// Package.swift
// Perfect-Mosquitto
Expand All @@ -18,17 +19,26 @@
//
import PackageDescription

#if os(Linux)
let package = Package(
name: "PerfectMosquitto",
dependencies: [
.Package(url: "https://github.com/PerfectlySoft/Perfect-libMosquitto.git", majorVersion: 1),
.Package(url: "https://github.com/PerfectlySoft/Perfect-LinuxBridge.git", majorVersion: 3)
name: "PerfectMosquitto",
products: [
.library(name: "PerfectMosquitto", targets: ["PerfectMosquitto"]),
],
dependencies: [
],
targets: [
.systemLibrary(name: "cmosquitto",
pkgConfig: "mosquitto",
providers:[
.brew(["mosquitto"]),
.apt(["libmosquitto-dev"])
]
),
.target(name: "PerfectMosquitto", dependencies: [
"cmosquitto",
]),
.testTarget(name: "PerfectMosquittoTests", dependencies: [
"PerfectMosquitto",
]),
]
)
#else
let package = Package(
name: "PerfectMosquitto",
dependencies: [.Package(url: "https://github.com/PerfectlySoft/Perfect-libMosquitto.git", majorVersion: 1)]
)
#endif
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@

<p align="center">
<a href="https://developer.apple.com/swift/" target="_blank">
<img src="https://img.shields.io/badge/Swift-3.0-orange.svg?style=flat" alt="Swift 3.0">
<img src="https://img.shields.io/badge/Swift-4.2-orange.svg?style=flat" alt="Swift 4.2">
</a>
<a href="https://developer.apple.com/swift/" target="_blank">
<img src="https://img.shields.io/badge/Platforms-OS%20X%20%7C%20Linux%20-lightgray.svg?style=flat" alt="Platforms OS X | Linux">
Expand All @@ -43,7 +43,7 @@ This project provides a Swift class wrapper of `mosquitto` client library which

This package builds with Swift Package Manager and is part of the [Perfect](https://github.com/PerfectlySoft/Perfect) project, however, it can work independently as a Server Side Swift component.

Ensure you have installed and activated the latest Swift 3.0 tool chain.
Ensure you have installed and activated the latest Swift tool chain.

## OS X Notes

Expand Down
13 changes: 2 additions & 11 deletions README.zh_CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@

<p align="center">
<a href="https://developer.apple.com/swift/" target="_blank">
<img src="https://img.shields.io/badge/Swift-3.0-orange.svg?style=flat" alt="Swift 3.0">
<img src="https://img.shields.io/badge/Swift-4.2-orange.svg?style=flat" alt="Swift 4.2">
</a>
<a href="https://developer.apple.com/swift/" target="_blank">
<img src="https://img.shields.io/badge/Platforms-OS%20X%20%7C%20Linux%20-lightgray.svg?style=flat" alt="Platforms OS X | Linux">
Expand All @@ -47,7 +47,7 @@

该软件使用SPM进行编译和测试,本软件也是[Perfect](https://github.com/PerfectlySoft/Perfect)项目的一部分,可以作为服务器组件独立运行。

请确保您已经安装并激活了最新版本的 Swift 3.0 tool chain 工具链。
请确保您已经安装并激活了最新版本的 Swift tool chain 工具链。

## OS X 编译说明

Expand Down Expand Up @@ -255,14 +255,5 @@ API|参数|说明
- 解释错误信息(英语)`static func Explain(_ fault: Exception) -> String`



### 问题报告、内容贡献和客户支持

我们目前正在过渡到使用JIRA来处理所有源代码资源合并申请、修复漏洞以及其它有关问题。因此,GitHub 的“issues”问题报告功能已经被禁用了。

如果您发现了问题,或者希望为改进本文提供意见和建议,[请在这里指出](http://jira.perfect.org:8080/servicedesk/customer/portal/1).

在您开始之前,请参阅[目前待解决的问题清单](http://jira.perfect.org:8080/projects/ISS/issues).

## 更多信息
关于本项目更多内容,请参考[perfect.org](http://perfect.org).
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,7 @@
//===----------------------------------------------------------------------===//
//
#if os(Linux)
import SwiftGlibc
import LinuxBridge

var errno: Int32 {
return linux_errno()
}//end errno

import Glibc
#else
import Darwin
#endif
Expand Down
8 changes: 8 additions & 0 deletions Sources/cmosquitto/cmosquitto.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#ifndef __PERFECT_LIB_MOSQUITTO__
#define __PERFECT_LIB_MOSQUITTO__
#ifdef __APPLE__
#include "/usr/local/include/mosquitto.h"
#else
#include "/usr/include/mosquitto.h"
#endif
#endif
5 changes: 5 additions & 0 deletions Sources/cmosquitto/module.modulemap
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
module cmosquitto [system] {
header "cmosquitto.h"
link "mosquitto"
export *
}
8 changes: 4 additions & 4 deletions Tests/PerfectMosquittoTests/PerfectMosquittoTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ class PerfectMosquittoTests: XCTestCase {
XCTFail("\(testID) disconnect() fault: \(err)")
}//end do
}

/*
func testPW() {

let testID = "01-unpwd-set"
Expand Down Expand Up @@ -301,7 +301,7 @@ class PerfectMosquittoTests: XCTestCase {
XCTFail("\(testID) disconnect() fault: \(err)")
}//end do
}

*/
static var allTests : [(String, (PerfectMosquittoTests) -> () throws -> Void)] {
Mosquitto.OpenLibrary()

Expand All @@ -311,8 +311,8 @@ class PerfectMosquittoTests: XCTestCase {
("testUnsubscription", testUnsubscription),
("testMessaging", testMessaging),
("testThreadMessaging", testThreadMessaging),
("testPW", testPW),
("testWill", testWill)
//("testPW", testPW),
//("testWill", testWill)
]
}
}
5 changes: 0 additions & 5 deletions linux.sh

This file was deleted.

0 comments on commit 5f761f8

Please sign in to comment.