Skip to content

Commit

Permalink
Upgrading to Swift 4.0
Browse files Browse the repository at this point in the history
  • Loading branch information
RockfordWei committed Sep 29, 2017
1 parent 5248200 commit 2dc91d4
Show file tree
Hide file tree
Showing 6 changed files with 63 additions and 22 deletions.
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
.DS_Store
/.build
/.build*
/Packages
/*.xcodeproj
/*.pins
/*.resolved
20 changes: 19 additions & 1 deletion Package.swift
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// swift-tools-version:4.0
// The swift-tools-version declares the minimum version of Swift required to build this package.

//
// Package.swift
// Perfect-RegEx
Expand All @@ -20,5 +23,20 @@
import PackageDescription

let package = Package(
name: "Regex"
name: "Regex",
products: [
.library(
name: "Regex",
targets: ["Regex"]),
],
dependencies: [
],
targets: [
.target(
name: "Regex",
dependencies: []),
.testTarget(
name: "RegexTests",
dependencies: ["Regex"]),
]
)
21 changes: 11 additions & 10 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.0-orange.svg?style=flat" alt="Swift 4.0">
</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 @@ -45,21 +45,14 @@ This project provides a light weight / simple regular expression extension for S

This package builds with Swift Package Manager and is part of the [Perfect](https://github.com/PerfectlySoft/Perfect) project. It was written to be stand-alone and so does not require PerfectLib or any other components.

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

## Issues

We are transitioning to using JIRA for all bugs and support related issues, therefore the GitHub issues has been disabled.

If you find a mistake, bug, or any other helpful suggestion you'd like to make on the docs please head over to [http://jira.perfect.org:8080/servicedesk/customer/portal/1](http://jira.perfect.org:8080/servicedesk/customer/portal/1) and raise it.

A comprehensive list of open issues can be found at [http://jira.perfect.org:8080/projects/ISS/issues](http://jira.perfect.org:8080/projects/ISS/issues)

## Building
Add this project as a dependency in your Package.swift file.

``` swift
.Package(url:"https://github.com/PerfectSideRepos/Perfect-RegEx.git", majorVersion: 1)
.Package(url:"https://github.com/PerfectSideRepos/Perfect-RegEx.git", majorVersion: 3)
```

Then please add the following line to the beginning part of swift sources:
Expand Down Expand Up @@ -97,5 +90,13 @@ extension String {

`[(rangeBegin: Int, rangeEnd: Int, extraction: String)]` - a tuple array, each element is the range begin / end mark, with the extraction value; if nothing found or error happened, the result set will be empty.

## Issues

We are transitioning to using JIRA for all bugs and support related issues, therefore the GitHub issues has been disabled.

If you find a mistake, bug, or any other helpful suggestion you'd like to make on the docs please head over to [http://jira.perfect.org:8080/servicedesk/customer/portal/1](http://jira.perfect.org:8080/servicedesk/customer/portal/1) and raise it.

A comprehensive list of open issues can be found at [http://jira.perfect.org:8080/projects/ISS/issues](http://jira.perfect.org:8080/projects/ISS/issues)

## Further Information
For more information on the Perfect project, please visit [perfect.org](http://perfect.org).
27 changes: 17 additions & 10 deletions README.zh_CN.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# 字符串正则表达式扩展 [English](README.md)
# 字符串正则表达式扩展

<p align="center">
<a href="http://perfect.org/get-involved.html" target="_blank">
Expand All @@ -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.0-orange.svg?style=flat" alt="Swift 4.0">
</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,26 +47,26 @@

该软件使用SPM进行编译和测试,本软件也是[Perfect](https://github.com/PerfectlySoft/Perfect)项目的一部分。本软件包可独立使用,因此使用时可以脱离PerfectLib等其他组件。

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

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

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

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

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

## 编译

请在您的Package.swift 文件中增加如下依存关系:

``` swift
.Package(url:"https://github.com/PerfectSideRepos/Perfect-RegEx.git", majorVersion: 1)

.Package(url:"https://github.com/PerfectSideRepos/Perfect-RegEx.git", majorVersion: 3)

```

然后在源代码开头部分引用函数库:

``` swift

import Regex

```

## 快速上手
Expand Down Expand Up @@ -99,6 +99,13 @@ extension String {

`[(rangeBegin: Int, rangeEnd: Int, extraction: 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).
File renamed without changes.
13 changes: 13 additions & 0 deletions test.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
echo "-------------- OS X / Xcode ----------------"
rm -rf .build
rm -rf Package.pins
rm -rf Package.resolved
swift build
swift build -c release
swift test
echo "-------------- LINUX SWIFT 4.0 ----------------"
rm -rf .build_linux
rm -rf Package.resolved
docker pull rockywei/swift:4.0
docker run -it -v $PWD:/home rockywei/swift:4.0 /bin/bash -c "cd /home;swift build --build-path=.build_linux; swift build -c release --build-path=.build_linux;swift test --build-path=.build_linux"

0 comments on commit 2dc91d4

Please sign in to comment.