Skip to content

Commit 906beb4

Browse files
Initial Travis-CI support
Ensures that the project builds on: Xcode 7.3 on macOS 10.11 Xcode 8.3 on macOS 10.12 For the following destinations: - Xcode 7.3 - platform=OS X - generic/platform=iOS - generic/platform=watchOS - generic/platform=tvOS - platform=iOS Simulator,name=iPhone 6s,OS=9.3 - Xcode 8.3 - platform=macOS - generic/platform=iOS - generic/platform=watchOS - generic/platform=tvOS - platform=iOS Simulator,name=iPhone 6s,OS=10.3
1 parent 59f3619 commit 906beb4

File tree

4 files changed

+156
-1
lines changed

4 files changed

+156
-1
lines changed

.ci/Gemfile.travis

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
source 'https://rubygems.org'
2+
3+
gem 'xcpretty'
4+
gem 'xcpretty-travis-formatter'

.ci/Makefile

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
# Requirements
2+
# ============
3+
#
4+
# Xcode 7+
5+
6+
XCODEBUILD := set -o pipefail && $(shell command -v xcodebuild)
7+
8+
# Xcode Version Information
9+
XCODEVERSION_FULL := $(word 2, $(shell xcodebuild -version))
10+
XCODEVERSION_MAJOR := $(shell xcodebuild -version 2>&1 | grep Xcode | cut -d' ' -f2 | cut -d'.' -f1)
11+
XCODEVERSION_MINOR := $(shell xcodebuild -version 2>&1 | grep Xcode | cut -d' ' -f2 | cut -d'.' -f2)
12+
13+
# The Xcode Version, containing only the "MAJOR.MINOR" (ex. "8.3" for Xcode 8.3, 8.3.1, etc.)
14+
XCODEVERSION := $(XCODEVERSION_MAJOR).$(XCODEVERSION_MINOR)
15+
16+
# Used to determine if xcpretty is available
17+
XCPRETTY_PATH := $(shell command -v xcpretty 2> /dev/null)
18+
19+
20+
# Targets
21+
# =======
22+
#
23+
# make test_build: build SQLiteLib for a specific destination
24+
25+
default: test_build
26+
27+
28+
# Tests
29+
# =====
30+
31+
# If xcpretty is available, use it for xcodebuild output
32+
XCPRETTY =
33+
ifdef XCPRETTY_PATH
34+
XCPRETTY = | xcpretty -c
35+
36+
# On Travis-CI, use xcpretty-travis-formatter
37+
ifeq ($(TRAVIS),true)
38+
XCPRETTY += -f `xcpretty-travis-formatter`
39+
endif
40+
endif
41+
42+
# Test if SQLiteLib can be built for a specified destination
43+
test_build: clean
44+
ifeq ($(DESTINATION),)
45+
$(error a DESTINATION must be specified (see xcodebuild documentation))
46+
endif
47+
48+
cd .. && \
49+
cp SQLiteLib-USER.xcconfig.example SQLiteLib-USER.xcconfig && \
50+
$(XCODEBUILD) \
51+
-project SQLiteLib.xcodeproj \
52+
-scheme sqlitelib \
53+
-configuration Release \
54+
-destination '$(DESTINATION)' \
55+
clean build \
56+
$(XCPRETTY)
57+
58+
clean:
59+
cd .. && \
60+
rm -f sqlite3.h

.travis.yml

Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
language: objective-c
2+
xcode_project: SQLiteLib.xcodeproj
3+
4+
# Disable the default Travis-CI submodule logic
5+
git:
6+
submodules: false
7+
8+
## Travis-CI doesn’t currently support automatically expanding osx_image
9+
## into the build matrix.
10+
##
11+
## see: https://github.com/travis-ci/travis-ci/issues/7587
12+
##
13+
#
14+
#gemfile: .ci/Gemfile.travis
15+
#
16+
#osx_image:
17+
# - xcode7.3
18+
# - xcode8.3
19+
#
20+
#env:
21+
# - DESTINATION="platform=macOS,arch=x86_64"
22+
# - DESTINATION="platform=macOS,arch=i386"
23+
# - DESTINATION="generic/platform=iOS"
24+
# - DESTINATION="generic/platform=watchOS"
25+
# - DESTINATION="generic/platform=tvOS"
26+
# - DESTINATION="platform=iOS Simulator,name=iPhone 6s,OS=10.3"
27+
28+
matrix:
29+
include:
30+
31+
###################################
32+
### Xcode 7.3 on macOS 10.11
33+
34+
- os: osx
35+
osx_image: xcode7.3
36+
gemfile: .ci/Gemfile.travis
37+
env:
38+
- DESTINATION="platform=OS X"
39+
- os: osx
40+
osx_image: xcode7.3
41+
gemfile: .ci/Gemfile.travis
42+
env:
43+
- DESTINATION="generic/platform=iOS"
44+
- os: osx
45+
osx_image: xcode7.3
46+
gemfile: .ci/Gemfile.travis
47+
env:
48+
- DESTINATION="generic/platform=watchOS"
49+
- os: osx
50+
osx_image: xcode7.3
51+
gemfile: .ci/Gemfile.travis
52+
env:
53+
- DESTINATION="generic/platform=tvOS"
54+
- os: osx
55+
osx_image: xcode7.3
56+
gemfile: .ci/Gemfile.travis
57+
env:
58+
- DESTINATION="platform=iOS Simulator,name=iPhone 6s,OS=9.3"
59+
60+
###################################
61+
### Xcode 8.3 on macOS 10.12
62+
63+
- os: osx
64+
osx_image: xcode8.3
65+
gemfile: .ci/Gemfile.travis
66+
env:
67+
- DESTINATION="platform=macOS"
68+
- os: osx
69+
osx_image: xcode8.3
70+
gemfile: .ci/Gemfile.travis
71+
env:
72+
- DESTINATION="generic/platform=iOS"
73+
- os: osx
74+
osx_image: xcode8.3
75+
gemfile: .ci/Gemfile.travis
76+
env:
77+
- DESTINATION="generic/platform=watchOS"
78+
- os: osx
79+
osx_image: xcode8.3
80+
gemfile: .ci/Gemfile.travis
81+
env:
82+
- DESTINATION="generic/platform=tvOS"
83+
- os: osx
84+
osx_image: xcode8.3
85+
gemfile: .ci/Gemfile.travis
86+
env:
87+
- DESTINATION="platform=iOS Simulator,name=iPhone 6s,OS=10.3"
88+
89+
script:
90+
- cd .ci
91+
- make test_build

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
SQLiteLib `.xcodeproj`
22
==========
3-
![platform: ios | osx | watchos | tvos](https://img.shields.io/badge/platform-ios%20%7C%20osx%20%7C%20watchos%20%7C%20tvos-blue.svg) ![License MIT](https://img.shields.io/badge/license-MIT-lightgrey.svg)
3+
![platform: ios | osx | watchos | tvos](https://img.shields.io/badge/platform-ios%20%7C%20osx%20%7C%20watchos%20%7C%20tvos-blue.svg) ![License MIT](https://img.shields.io/badge/license-MIT-lightgrey.svg) [![Build Status](https://travis-ci.org/swiftlyfalling/SQLiteLib.svg?branch=master)](https://travis-ci.org/swiftlyfalling/SQLiteLib)
44

55
An Xcode project to easily build a custom SQLite static library for use in OSX and iOS frameworks and apps.
66

0 commit comments

Comments
 (0)