Skip to content
This repository was archived by the owner on Mar 19, 2023. It is now read-only.

[WIP] Building on Linux #10

Closed
wants to merge 40 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
8670ae3
Started switch to vapor/sockets
Jun 20, 2017
fa8d94d
Switched to Vapor/Sockets
Jun 20, 2017
a4c2e74
Update travis to fetch dependencies
Jun 20, 2017
b4bdc2a
Remove prefetching option from travis
Jun 20, 2017
39eef2c
Regenerate xcodeproj when compiling on travis
Jun 20, 2017
926f7ee
Updated .gitignore for SPM/Swift
Jun 21, 2017
3e88cdd
Update README to include xcodeproj generation for manual including
Jun 21, 2017
bcabf60
Exclude xcodeproj in git (must be generated)
Jun 21, 2017
b9cd45b
Remove xcodeproj (must be generated)
Jun 21, 2017
80185ff
Presumably fixed tests
Jun 21, 2017
d2a6c10
Use xcode 8.3 image instead of xcode 8 only
Jun 21, 2017
53f62b2
Run Linux tests, make tests look great too
Jun 21, 2017
cf0d481
Trigger build
Jun 21, 2017
573cdf8
Swift SCRAM start
Jun 21, 2017
c17e42a
Assumed wrong hashing function
Jun 21, 2017
7aaf91d
Reverted test login
Jun 21, 2017
f6fff3b
Switched to custom SCRAM implementation!
Jun 23, 2017
98c37cc
Fix tests and move SCRAm tests into seperate Test module
Jun 23, 2017
b8755e8
Swift 3.2 fix
Jun 23, 2017
17db19a
Remove big chunk of unused code and removed String format init
Jun 23, 2017
d9c44a3
Linux fixes
Jun 23, 2017
227d987
Install vapor using brew or apt-get
Jun 23, 2017
5c02289
Typo
Jun 23, 2017
2d6f76f
Add rethinkdb apt repo
Jun 23, 2017
595a708
Add y command to add repo
Jun 23, 2017
9445e9e
Switch rethinkdb install source
Jun 23, 2017
a1c3d3d
Move away fro NSData and use Swift.Data only
Jun 23, 2017
451ac05
Fixes for Linux build
Jun 23, 2017
2906bb9
Add LinuxTests file
Jun 23, 2017
400ad2d
Fix tests
Jun 23, 2017
8d9ed52
Wrong LinuxMain filename :$
Jun 23, 2017
fd9369c
Fixes for Linux (moving from NS classes to Swift classes)
Jun 23, 2017
859f33a
Debuggable server returned error
Jun 23, 2017
12afd77
More linux fixes, because why not
Jun 23, 2017
69f8746
Last linux build fix?
Jun 23, 2017
f9d02da
Change Threading system
Jun 23, 2017
1f7402a
Clean up tests (still not happy with the long test block though)
Jun 23, 2017
d31558f
Add splitted tests to linux test case
Jun 23, 2017
d86fccb
More thread changes
Jun 23, 2017
a2820ec
Import Dispatch for Linux
Jun 23, 2017
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
78 changes: 78 additions & 0 deletions .ci/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
#!/usr/bin/env bash

VERSION="3.1.1"
echo "Swift $VERSION Continuous Integration";

# Determine OS
UNAME=`uname`;
if [[ $UNAME == "Darwin" ]];
then
OS="macos";
else
if [[ $UNAME == "Linux" ]];
then
UBUNTU_RELEASE=`lsb_release -a 2>/dev/null`;
if [[ $UBUNTU_RELEASE == *"15.10"* ]];
then
OS="ubuntu1510";
else
OS="ubuntu1404";
fi
else
echo "Unsupported Operating System: $UNAME";
fi
fi
echo "🖥 Operating System: $OS";

if [[ $OS != "macos" ]];
then
echo "📚 Installing Dependencies"
source /etc/lsb-release && echo "deb http://download.rethinkdb.com/apt $DISTRIB_CODENAME main" | sudo tee /etc/apt/sources.list.d/rethinkdb.list
wget -qO- https://download.rethinkdb.com/apt/pubkey.gpg | sudo apt-key add -
sudo apt-get update
sudo apt-get install -y clang libicu-dev uuid-dev rethinkdb
eval "$(curl -sL https://apt.vapor.sh)"

echo "🐦 Installing Swift";
sudo apt-get install -y swift ctls rethinkdb
else
echo "📚 Installing Dependencies"
brew tap vapor/homebrew-tap
brew update
brew install vapor rethinkdb
fi

echo "🎛️ Starting RethinkDB server"
rethinkdb --daemon

echo "📅 Version: `swift --version`";

echo "🚀 Building";
swift build
if [[ $? != 0 ]];
then
echo "❌ Build failed";
exit 1;
fi

echo "💼 Building Release";
swift build -c release
if [[ $? != 0 ]];
then
echo "❌ Build for release failed";
exit 1;
fi

echo "🔎 Testing";

swift test
if [[ $? != 0 ]];
then
echo "❌ Tests failed";
exit 1;
fi

echo "🛑 Stopping RethinkDB";
killall rethinkdb

echo "✅ Done"
72 changes: 68 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,69 @@
.DS_Store
/.build
/Packages
Rethink.xcodeproj/project.xcworkspace/xcuserdata
Rethink.xcodeproj/xcuserdata
# Xcode
#
# gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore

## Build generated
build/
DerivedData/

## Various settings
*.pbxuser
!default.pbxuser
*.mode1v3
!default.mode1v3
*.mode2v3
!default.mode2v3
*.perspectivev3
!default.perspectivev3
xcuserdata/
*.xcodeproj

## Other
*.moved-aside
*.xccheckout
*.xcscmblueprint

## Obj-C/Swift specific
*.hmap
*.ipa
*.dSYM.zip
*.dSYM

## Playgrounds
timeline.xctimeline
playground.xcworkspace

# Swift Package Manager
#
# Add this line if you want to avoid checking in source code from Swift Package Manager dependencies.
# Packages/
# Package.pins
.build/

# CocoaPods
#
# We recommend against adding the Pods directory to your .gitignore. However
# you should judge for yourself, the pros and cons are mentioned at:
# https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control
#
# Pods/

# Carthage
#
# Add this line if you want to avoid checking in source code from Carthage dependencies.
# Carthage/Checkouts

Carthage/Build

# fastlane
#
# It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the
# screenshots whenever they are needed.
# For more information about the recommended setup visit:
# https://docs.fastlane.tools/best-practices/source-control/#source-control

fastlane/report.xml
fastlane/Preview.html
fastlane/screenshots
fastlane/test_output
26 changes: 8 additions & 18 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,22 +1,12 @@
language: objective-c
os:
- linux
- osx

branches:
only:
- master
language: generic

xcode_project: Rethink.xcodeproj
xcode_scheme: Rethink
osx_image: xcode8
sudo: required
dist: trusty

before_install:
- brew install rethinkdb
osx_image: xcode8.3

before_script:
- rethinkdb --daemon
- sleep 10

script:
- xcodebuild clean build test -project Rethink.xcodeproj -scheme Rethink CODE_SIGNING_REQUIRED=NO CODE_SIGN_IDENTITY=""

after_script:
- killall rethinkdb
script: ./.ci/build.sh
54 changes: 54 additions & 0 deletions Package.pins
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
{
"autoPin": true,
"pins": [
{
"package": "BCrypt",
"reason": null,
"repositoryURL": "https://github.com/vapor/bcrypt.git",
"version": "1.0.0"
},
{
"package": "Bits",
"reason": null,
"repositoryURL": "https://github.com/vapor/bits.git",
"version": "1.0.0"
},
{
"package": "CTLS",
"reason": null,
"repositoryURL": "https://github.com/vapor/ctls.git",
"version": "1.0.0"
},
{
"package": "Core",
"reason": null,
"repositoryURL": "https://github.com/vapor/core.git",
"version": "2.0.2"
},
{
"package": "Crypto",
"reason": null,
"repositoryURL": "https://github.com/vapor/crypto.git",
"version": "2.0.0"
},
{
"package": "Debugging",
"reason": null,
"repositoryURL": "https://github.com/vapor/debugging.git",
"version": "1.0.0"
},
{
"package": "Random",
"reason": null,
"repositoryURL": "https://github.com/vapor/random.git",
"version": "1.0.0"
},
{
"package": "Sockets",
"reason": null,
"repositoryURL": "https://github.com/vapor/sockets.git",
"version": "2.0.1"
}
],
"version": 1
}
10 changes: 7 additions & 3 deletions Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,12 @@ import PackageDescription
let package = Package(
name: "Rethink",
targets: [
Target(name: "Rethink", dependencies: ["GCDAsyncSocket", "SCRAM"]),
Target(name: "GCDAsyncSocket"),
Target(name: "Rethink", dependencies: ["SCRAM"]),
Target(name: "SCRAM")
]
],
dependencies: [
.Package(url: "https://github.com/vapor/sockets.git", majorVersion: 2),
.Package(url: "https://github.com/vapor/crypto.git", majorVersion: 2),
.Package(url: "https://github.com/vapor/bcrypt.git", majorVersion: 1),
]
)
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,12 @@ HEADER_SEARCH_PATHS = $(inherited) "$(SRCROOT)/Packages/**"
```

#### Manual
To use the driver in an Xcode project, generate an Xcode project file using SPM:
```
swift package generate-xcodeproj
```

Drag Rethink.xcodeproj into your own project, then add Rethink or Rethink iOS as dependency (build targets) and link to it.
Drag the generated Rethink.xcodeproj into your own project, then add Rethink or Rethink iOS as dependency (build targets) and link to it.
You should then be able to simply 'import Rethink' from Swift code.

### License
Expand Down
Loading