Skip to content

Add Linux to the Build Matrix #13

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

Merged
merged 2 commits into from
Jan 15, 2017
Merged
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
49 changes: 41 additions & 8 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,41 @@
os: osx
language: objective-c
osx_image: xcode8
before_install:
- cp ./cllvm.pc /usr/local/lib/pkgconfig/cllvm.pc
- brew install llvm
script:
- swift build
env:
global:
- LC_CTYPE=en_US.UTF-8
matrix:
include:
- os: osx
language: objective-c
osx_image: xcode8
before_install:
- cp ./cllvm.pc /usr/local/lib/pkgconfig/cllvm.pc
- brew install llvm
script:
- swift build
- os: linux
language: generic
sudo: required
dist: trusty
env:
- LLVM_API_VERSION=3.9
before_install:
# Set the package config path so we can see cllvm
- export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig:"${PKG_CONFIG_PATH}"
# Pull clang and llvm
- wget -O - http://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add -
- sudo apt-add-repository "deb http://apt.llvm.org/trusty/ llvm-toolchain-trusty-3.9 main"
- sudo apt-get update
- sudo apt-get install llvm-${LLVM_API_VERSION}
# Work around pre-installed clang
- sudo rm -rf /usr/local/clang-*/bin/llvm-config
- ls -l /usr/bin/llvm-config*
- sudo rm -f /usr/bin/llvm-config
- sudo ln -s /usr/bin/llvm-config-${LLVM_API_VERSION} /usr/bin/llvm-config
# Grab Swift
- wget -q -O - https://swift.org/keys/all-keys.asc | gpg --import -
- wget https://swift.org/builds/swift-3.0.2-release/ubuntu1404/swift-3.0.2-RELEASE/swift-3.0.2-RELEASE-ubuntu14.04.tar.gz
- tar xzf swift-3.0.2-RELEASE-ubuntu14.04.tar.gz
- export PATH=${PWD}/swift-3.0.2-RELEASE-ubuntu14.04/usr/bin:"${PATH}"
# Move the package config file into place
- sudo ./swift-3.0.2-RELEASE-ubuntu14.04/usr/bin/swift utils/make-pkgconfig.swift
script:
- swift build
9 changes: 9 additions & 0 deletions utils/make-pkgconfig.swift
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
#!/usr/bin/env swift
import Foundation

#if os(Linux)
typealias Process = Task
#endif

/// Runs the specified program at the provided path.
/// - parameter path: The full path of the executable you
/// wish to run.
Expand Down Expand Up @@ -103,6 +107,11 @@ func makeFile() throws {
do {
try makeFile()
} catch {
#if os(Linux)
// FIXME: Printing the thrown error that here crashes on Linux.
print("Unexpected error occured while writing the config file. Check permissions and try again.")
#else
print("error: \(error)")
#endif
exit(-1)
}