Skip to content

Commit

Permalink
add linux support
Browse files Browse the repository at this point in the history
  • Loading branch information
yonaskolb committed Jun 2, 2018
1 parent ed7fb99 commit e4949a9
Show file tree
Hide file tree
Showing 5 changed files with 40 additions and 3 deletions.
17 changes: 15 additions & 2 deletions .circleci/config.yml
@@ -1,9 +1,22 @@
version: 2
jobs:
build:
macOS_swift_4.1:
macos:
xcode: "9.2.0"
xcode: "9.3.0"
steps:
- checkout
- run: swift build
- run: swift test
linux_swift_4.1:
docker:
- image: norionomura/swift:41
steps:
- checkout
- run: swift build
- run: swift test
workflows:
version: 2
workflow:
jobs:
- macOS_swift_4.1
- linux_swift_4.1
1 change: 1 addition & 0 deletions README.md
@@ -1,6 +1,7 @@
# Beak 🐦

[![SPM](https://img.shields.io/badge/Swift_PM-compatible-brightgreen.svg?style=for-the-badge)](https://swift.org/package-manager)
![Linux](https://img.shields.io/badge/Platforms-macOS_Linux-blue.svg?style=for-the-badge)
[![Git Version](https://img.shields.io/github/release/yonaskolb/Beak.svg?style=for-the-badge)](https://github.com/yonaskolb/Beak/releases)
[![Build Status](https://img.shields.io/circleci/project/github/yonaskolb/Beak.svg?style=for-the-badge)](https://circleci.com/gh/yonaskolb/Beak)
[![license](https://img.shields.io/github/license/yonaskolb/Beak.svg?style=for-the-badge)](https://github.com/yonaskolb/Beak/blob/master/LICENSE)
Expand Down
2 changes: 1 addition & 1 deletion Sources/BeakCore/SourceKit.swift
Expand Up @@ -83,7 +83,7 @@ enum Substring {
}

func extract(from source: [String: SourceKitRepresentable], contents: String) -> String? {
let substring = range(for: source).flatMap { contents.substringWithByteRange(start: Int($0.offset), length: Int($0.length)) }
let substring = range(for: source).flatMap { contents.substring(start: Int($0.offset), length: Int($0.length)) }
return substring?.isEmpty == true ? nil : substring?.trimmingCharacters(in: .whitespacesAndNewlines)
}
}
15 changes: 15 additions & 0 deletions Tests/BeakTests/XCTestManifests.swift
@@ -0,0 +1,15 @@
import XCTest

extension BeakTests {
static let __allTests = [
("testBeak", testBeak),
]
}

#if !os(macOS)
public func __allTests() -> [XCTestCaseEntry] {
return [
testCase(BeakTests.__allTests),
]
}
#endif
8 changes: 8 additions & 0 deletions Tests/LinuxMain.swift
@@ -0,0 +1,8 @@
import XCTest

import BeakTests

var tests = [XCTestCaseEntry]()
tests += BeakTests.__allTests()

XCTMain(tests)

0 comments on commit e4949a9

Please sign in to comment.