├── script ├── script_hooks │ ├── .gitkeep │ ├── schemes │ └── destinations ├── clean ├── carthage ├── common │ ├── sort │ ├── install_tailor │ ├── install_carthage │ ├── install_swiftlint │ ├── check_xcode_version │ ├── homebrew │ ├── configure_carthage_cache │ ├── tailor │ ├── swiftlint │ └── carthage ├── configure_carthage_cache ├── update ├── git_hooks │ └── pre-push ├── buildtime ├── build ├── test ├── cibuild └── bootstrap ├── .gitignore ├── tests └── carthage │ ├── Cartfile │ ├── Gemfile │ ├── Cartfile.private │ ├── Cartfile.resolved │ ├── Gemfile.lock │ ├── iOSScriptsCarthageTests │ ├── iOSScriptsCarthageTests-Bridging-Header.h │ ├── GreeterTests.swift │ └── Info.plist │ ├── iOSScriptsCarthage.xcodeproj │ ├── project.xcworkspace │ │ └── contents.xcworkspacedata │ ├── xcshareddata │ │ └── xcschemes │ │ │ └── ScriptsCarthage-iOS.xcscheme │ └── project.pbxproj │ ├── .gitignore │ ├── iOSScriptsCarthage │ ├── Greeter.swift │ ├── iOSScriptsCarthage.h │ └── Info.plist │ └── script │ └── .env ├── cibuild ├── .travis.yml ├── install ├── LICENSE └── README.md /script/script_hooks/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | .env 3 | .installrc 4 | -------------------------------------------------------------------------------- /tests/carthage/Cartfile: -------------------------------------------------------------------------------- 1 | github "antitypical/Result" "master" 2 | -------------------------------------------------------------------------------- /tests/carthage/Gemfile: -------------------------------------------------------------------------------- 1 | source 'https://rubygems.org' 2 | 3 | gem 'xcpretty' 4 | -------------------------------------------------------------------------------- /tests/carthage/Cartfile.private: -------------------------------------------------------------------------------- 1 | github "Quick/Nimble" ~> 4.0.1 2 | github "Quick/Quick" ~> 0.9.2 3 | -------------------------------------------------------------------------------- /script/clean: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -e 4 | 5 | source script/.env 6 | 7 | rm -frd ~/Library/Developer/Xcode/DerivedData/"$PROJECT_NAME-*" 8 | -------------------------------------------------------------------------------- /script/carthage: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -e 4 | 5 | source script/.env 6 | source script/common/carthage 7 | 8 | check_carthage_version 9 | call_carthage $@ 10 | -------------------------------------------------------------------------------- /tests/carthage/Cartfile.resolved: -------------------------------------------------------------------------------- 1 | github "Quick/Nimble" "v4.0.1" 2 | github "Quick/Quick" "v0.9.2" 3 | github "antitypical/Result" "8b7a2ddb098fdae7e2c50b60b2d5cc22d91b0da5" 4 | -------------------------------------------------------------------------------- /tests/carthage/Gemfile.lock: -------------------------------------------------------------------------------- 1 | GEM 2 | remote: https://rubygems.org/ 3 | specs: 4 | xcpretty (0.1.12) 5 | 6 | PLATFORMS 7 | ruby 8 | 9 | DEPENDENCIES 10 | xcpretty 11 | -------------------------------------------------------------------------------- /script/common/sort: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | 3 | puts STDIN.readlines 4 | .map { |l| l.split("\t") } 5 | .sort { |a,b| b.first.to_f <=> a.first.to_f } 6 | .map { |line| line.join("\t") } 7 | -------------------------------------------------------------------------------- /tests/carthage/iOSScriptsCarthageTests/iOSScriptsCarthageTests-Bridging-Header.h: -------------------------------------------------------------------------------- 1 | // 2 | // Use this file to import your target's public headers that you would like to expose to Swift. 3 | // 4 | 5 | -------------------------------------------------------------------------------- /script/script_hooks/schemes: -------------------------------------------------------------------------------- 1 | schemes () 2 | { 3 | if [ -z "$SCHEME" ] 4 | then 5 | xcodebuild -list | awk '{if(found) print} /Schemes/{found=1}' | awk '{$1=$1};1' 6 | else 7 | echo $SCHEME 8 | fi 9 | } 10 | -------------------------------------------------------------------------------- /script/common/install_tailor: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | source script/common/tailor 3 | 4 | if [ -z $REQUIRED_TAILOR_VERSION ] 5 | then 6 | echo "Enter the version of Tailor you want to install:" 7 | read REQUIRED_TAILOR_VERSION 8 | fi 9 | force_install_tailor 10 | -------------------------------------------------------------------------------- /script/common/install_carthage: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | source script/common/carthage 3 | 4 | if [ -z $REQUIRED_CARTHAGE_VERSION ] 5 | then 6 | echo "Enter the version of Carthage you want to install:" 7 | read REQUIRED_CARTHAGE_VERSION 8 | fi 9 | check_carthage_version 10 | -------------------------------------------------------------------------------- /tests/carthage/iOSScriptsCarthage.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /script/common/install_swiftlint: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | source script/common/swiftlint 3 | 4 | if [ -z $REQUIRED_SWIFTLINT_VERSION ] 5 | then 6 | echo "Enter the version of SwiftLint you want to install:" 7 | read REQUIRED_SWIFTLINT_VERSION 8 | fi 9 | force_install_swiftlint 10 | -------------------------------------------------------------------------------- /script/configure_carthage_cache: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | if [ ! -f .carthage_cache.yml ] 4 | then 5 | echo "" 6 | echo " → Generating .carthage_cache.yml file" 7 | echo "" 8 | bundle exec carthage_cache config 9 | fi 10 | 11 | echo "" 12 | echo " → Configuring .travis.yml" 13 | echo "" 14 | script/common/configure_carthage_cache $1 15 | -------------------------------------------------------------------------------- /tests/carthage/.gitignore: -------------------------------------------------------------------------------- 1 | # OS X 2 | .DS_Store 3 | 4 | # Xcode 5 | build/ 6 | *.pbxuser 7 | !default.pbxuser 8 | *.mode1v3 9 | !default.mode1v3 10 | *.mode2v3 11 | !default.mode2v3 12 | *.perspectivev3 13 | !default.perspectivev3 14 | xcuserdata 15 | *.xccheckout 16 | profile 17 | *.moved-aside 18 | DerivedData 19 | *.hmap 20 | *.ipa 21 | 22 | # Bundler 23 | .bundle 24 | 25 | Carthage/ 26 | !.env 27 | script/ 28 | -------------------------------------------------------------------------------- /script/update: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -e 4 | 5 | source script/.env 6 | source script/common/carthage 7 | 8 | if [ -f Cartfile.resolved ] && type carthage > /dev/null 9 | then 10 | check_carthage_version 11 | DISABLE_CARTHAGE_CACHE_INSTALL=1 call_carthage "update" 12 | elif [ -f Podfile ] 13 | then 14 | if type bundle > /dev/null && bundle show pod > /dev/null 15 | then 16 | bundle exec pod update 17 | else 18 | pod update 19 | fi 20 | fi 21 | -------------------------------------------------------------------------------- /cibuild: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -e 4 | 5 | ./install ./tests/carthage 6 | 7 | echo "------------------------------------------------------" 8 | echo "----- Testing scripts for Carthage based project -----" 9 | echo "------------------------------------------------------" 10 | cd tests/carthage 11 | 12 | echo "" 13 | echo "----- Running script/cibuild -----" 14 | echo "" 15 | VERBOSE=1 script/cibuild 16 | 17 | echo "" 18 | echo "----- Running script/build -----" 19 | echo "" 20 | VERBOSE=1 script/build 21 | -------------------------------------------------------------------------------- /tests/carthage/iOSScriptsCarthage/Greeter.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Greeter.swift 3 | // iOSScriptsCarthage 4 | // 5 | // Created by Guido Marucci Blas on 9/17/15. 6 | // Copyright (c) 2015 guidomb. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | 11 | public struct Greeter { 12 | 13 | let name: String 14 | 15 | public init(name: String) { 16 | self.name = name 17 | } 18 | 19 | public func greet() -> String { 20 | return "Hello \(name)" 21 | } 22 | 23 | } -------------------------------------------------------------------------------- /tests/carthage/script/.env: -------------------------------------------------------------------------------- 1 | REQUIRED_XCODE_VERSION=7.3.1 2 | REQUIRED_CARTHAGE_VERSION=0.16.2 3 | CARTHAGE_NO_USE_BINARIES=${CARTHAGE_NO_USE_BINARIES:-"true"} 4 | CARTHAGE_BUILD_PLATFORM=${CARTHAGE_BUILD_PLATFORM:-"iOS"} 5 | PROJECT_NAME=iOSScriptsCarthage 6 | XCODE_WORKSPACE= 7 | XCODE_PROJECT=iOSScriptsCarthage.xcodeproj 8 | IOS_DESTINATION_VERSION=${IOS_DESTINATION_VERSION:-"latest"} 9 | IOS_DESTINATION_SIMULATOR_NAME=${IOS_DESTINATION_SIMULATOR_NAME:-"iPhone 6"} 10 | OSX_DESTINATION_ARCH=${OSX_DESTINATION_ARCH:-""} 11 | -------------------------------------------------------------------------------- /tests/carthage/iOSScriptsCarthage/iOSScriptsCarthage.h: -------------------------------------------------------------------------------- 1 | // 2 | // iOSScriptsCarthage.h 3 | // iOSScriptsCarthage 4 | // 5 | // Created by Guido Marucci Blas on 9/17/15. 6 | // Copyright (c) 2015 guidomb. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | //! Project version number for iOSScriptsCarthage. 12 | FOUNDATION_EXPORT double iOSScriptsCarthageVersionNumber; 13 | 14 | //! Project version string for iOSScriptsCarthage. 15 | FOUNDATION_EXPORT const unsigned char iOSScriptsCarthageVersionString[]; 16 | 17 | // In this header, you should import all the public headers of your framework using statements like #import 18 | 19 | 20 | -------------------------------------------------------------------------------- /script/script_hooks/destinations: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | IOS_DESTINATION="'platform=iOS Simulator,name=$IOS_DESTINATION_SIMULATOR_NAME,OS=$IOS_DESTINATION_VERSION'" 4 | 5 | if [ -z "$OSX_DESTINATION_ARCH" ] 6 | then 7 | OSX_DESTINATION="'platform=OS X'" 8 | else 9 | OSX_DESTINATION="'platform=OS X,arch=$OSX_DESTINATION_ARCH'" 10 | fi 11 | 12 | scheme_destination () 13 | { 14 | shopt -s nocasematch 15 | 16 | case "$1" in 17 | *iOS) 18 | destination=$IOS_DESTINATION 19 | ;; 20 | *OSX) 21 | destination=$OSX_DESTINATION 22 | ;; 23 | *macOS) 24 | destination=$OSX_DESTINATION 25 | ;; 26 | *tvOS) 27 | destination="'platform=tvOS Simulator,name=Apple TV 1080p'" 28 | ;; 29 | *) 30 | destination=$IOS_DESTINATION 31 | ;; 32 | esac 33 | 34 | echo $destination 35 | } -------------------------------------------------------------------------------- /tests/carthage/iOSScriptsCarthageTests/GreeterTests.swift: -------------------------------------------------------------------------------- 1 | // 2 | // iOSScriptsCarthageTests.swift 3 | // iOSScriptsCarthage 4 | // 5 | // Created by Guido Marucci Blas on 9/17/15. 6 | // Copyright (c) 2015 guidomb. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | import Quick 11 | import Nimble 12 | import ScriptsCarthage 13 | 14 | class GreeterSpec: QuickSpec { 15 | 16 | override func spec() { 17 | 18 | var greeter: Greeter! 19 | 20 | beforeEach { 21 | greeter = Greeter(name: "Guido Marucci Blas") 22 | } 23 | 24 | describe("#greet") { 25 | 26 | it("greets the given name") { 27 | expect(greeter.greet()).to(equal("Hello Guido Marucci Blas")) 28 | } 29 | 30 | } 31 | 32 | } 33 | 34 | } -------------------------------------------------------------------------------- /tests/carthage/iOSScriptsCarthageTests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | BNDL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | 24 | 25 | -------------------------------------------------------------------------------- /script/common/check_xcode_version: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | 3 | required_xcode_version = ARGV.first 4 | if required_xcode_version.nil? || required_xcode_version.empty? 5 | printf "\033[1;31mEnv variable REQUIRED_XCODE_VERSION is not defined." 6 | printf "\033[0m\n" 7 | exit 1 8 | end 9 | 10 | installed_xcode_version = `xcodebuild -version` 11 | .split("\n") 12 | .first 13 | .match(/Xcode ((\d+\.)?\d+\.\d+)/)[1] 14 | 15 | # Drop patch number 16 | installed_xcode_version = installed_xcode_version[0..-3] if installed_xcode_version.scan(/\./).length == 2 17 | required_xcode_version = required_xcode_version[0..-3] if required_xcode_version.scan(/\./).length == 2 18 | 19 | if installed_xcode_version < required_xcode_version 20 | printf "\033[1;31mError: xcodebuild version '#{installed_xcode_version}' is not equal to '#{required_xcode_version}'" 21 | printf "\033[0m\n" 22 | exit 1 23 | end 24 | -------------------------------------------------------------------------------- /script/git_hooks/pre-push: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # An example hook script to verify what is about to be pushed. Called by "git 4 | # push" after it has checked the remote status, but before anything has been 5 | # pushed. If this script exits with a non-zero status nothing will be pushed. 6 | # 7 | # This hook is called with the following parameters: 8 | # 9 | # $1 -- Name of the remote to which the push is being done 10 | # $2 -- URL to which the push is being done 11 | # 12 | # If pushing without using a named remote those arguments will be equal. 13 | # 14 | # Information about the commits which are being pushed is supplied as lines to 15 | # the standard input in the form: 16 | # 17 | # 18 | # 19 | # This sample shows how to prevent push of commits where the log message starts 20 | # with "WIP" (work in progress). 21 | 22 | set -e 23 | 24 | remote="$1" 25 | url="$2" 26 | 27 | script/test 28 | -------------------------------------------------------------------------------- /tests/carthage/iOSScriptsCarthage/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | $(CURRENT_PROJECT_VERSION) 23 | NSPrincipalClass 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /script/buildtime: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -e 4 | 5 | source script/.env 6 | source script/script_hooks/schemes 7 | source script/script_hooks/destinations 8 | 9 | run_build () 10 | { 11 | build_command="xcodebuild -scheme $1" 12 | 13 | if [ -z "$XCODE_WORKSPACE" ] 14 | then 15 | build_command="$build_command -project $XCODE_PROJECT" 16 | else 17 | build_command="$build_command -workspace $XCODE_WORKSPACE" 18 | fi 19 | 20 | destination=$(scheme_destination $1) 21 | build_command="$build_command -destination $destination clean build test -configuration Debug" 22 | build_command="$build_command OTHER_SWIFT_FLAGS='-Xfrontend -debug-time-function-bodies' | grep '[0-9]*[0-9][0-9].[0-9]ms'" 23 | build_command="$build_command | script/common/sort" 24 | 25 | echo "" 26 | echo " → Running build with time details for scheme '$1'" 27 | echo "" 28 | if [ ! -z "$VERBOSE" ] 29 | then 30 | echo $build_command 31 | fi 32 | eval $build_command 33 | } 34 | 35 | current_schemes=$(schemes) 36 | if [ -z "$current_schemes" ] 37 | then 38 | echo "" 39 | echo "ERROR: There are no schemes. Probably you forgot to share your schemes" 40 | exit 1 41 | fi 42 | 43 | for scheme in $current_schemes 44 | do 45 | run_build $scheme 46 | done 47 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: objective-c 2 | osx_image: xcode7.3 3 | rvm: 4 | - 2.0.0 5 | script: FORCE_CARTHAGE_VERSION=true "./cibuild" 6 | branches: 7 | only: 8 | - master 9 | env: 10 | global: 11 | - secure: XVrcYVmFvu/1w99imX3iYpjKKnMxm7wk3Z1tBS4M0+oTEcKTSVhQCZgBOE/kkGSofIwEGU/SM9NiGNQ++nRp/OTIlIZm3NUiP+Tp3cW8JeyZVmv8SbWhnRWmQavXHZ9G1SjurPEQfsL/lhjAJ6oTaoxHBrNIfuhK9vFpAKEZJcKXi2pEW3iVmPWzJM7JKoJ6qgMq0pVmGyUxErziwZoA6RZqP1+svcFpCQpR48NM32IskCkhv2WRkaJs3VFWsC1M8/K1kDRx2dVapo2Kwpp1T4jkbQliVhQy93KOl0cOORAgzm+2CtXQhjOg2hSnOwpV409QDkUS7gJUgo9vrTmWY4vw3YXw0lu2jldvpI3zzScCXUgO65g3kc4vNcPx9F+mxuQZA/1lVbr4Hk1Mp/BR/fQ6EZu1lZnsHyYFZ5L4kWq+JsQ5CMEGWe5poTb43uyECmRrePEbrxJxsGvE+iTvAV8TNKR8rIpOy1xLNM1q/OJ4kWpb6U+ijVZk5KMJ3nMID/VIsRFRMnRsvn8pvFSjCa+0tQ3yU1pwfQ75Lal6LPIS28+fALGri5pFu2O2lnkNCao5vcLlzcKKeWY07Qn+GaoSr0Mz8e+lunIjtLsXw6d/I41W65/WFY47rQpepwLO/BLW7MBySQWaEsu7BBd1ImKFR7PJCxQNzy/hv5hr0Is= 12 | - secure: hbnmX3SuG3HWegmb7XZ0Ps7OFENPBgadRcMageN9NXdwZpnktduBeaoDGWVAJ2lXCQRICzxihHN45GJcqiqsgXFSoY2oeHREkfqxWzd5aQIDLebFxJoKD1bMBMDpguJiz5UHB2DlwBzgh5rO5bI4bVAG4qzLO5BAbU1Pf2aJMrOc80gkCJuisNVVOnaaBSluUUvyxfdFFmt3pf+kxbHwCERMp/Z882v1bsqmmDm08Mzjdgbvq4bmrr46nVJn8c6Q/zeK52qvQc+hCSBt+mFjJxekoZDIGnuFOKkAsXMG9UI8+oDxJGB0FINs/mnezIU0EdlX4DI9BlOSvjLaRfDfTejOXUWOIUHvKMGfgG7FuShsUyUyXxQnSFFN8ZX/dMKHYtvXCgBxfN1PHsvgVwdr2SdWOefWv0YtF2NgtxC5aq8vV9B3xWE0S0OiJ3jEBOBa+5nWl7DwD5bsrv0ZSL236OIK0Nc6AlBElqwDLAHoTMoQhi8VNc2JKe3AWmJsSEFFgQrOU3DA9MnUIHUKz6GHSn+PTGwOeXmMCcATVa79ZLLt+GInmtFt5OR2ikUu+qG9a7SFs0/G9WhAI9cotTXyF36kQqacHT+mLFfmKpWovzoA5ZmCcVDSf5OI3fYNrQZg9YYNjtHgbErTE3f5MLrg2p9SnLk6fxX1aoWwpu6VhWQ= 13 | -------------------------------------------------------------------------------- /script/common/homebrew: -------------------------------------------------------------------------------- 1 | install_homebrew () 2 | { 3 | if [ -z $GITHUB_ACCESS_TOKEN ] 4 | then 5 | export HOMEBREW_GITHUB_API_TOKEN=$GITHUB_ACCESS_TOKEN 6 | fi 7 | 8 | if type brew > /dev/null 9 | then 10 | echo " ✔ brew is already installed" 11 | 12 | if [ -z "$SKIP_BREW_FORMULAS_UPDATE" ] 13 | then 14 | echo "" 15 | echo " → Updating homebrew formulas" 16 | brew update > /dev/null || brew update > /dev/null 17 | echo " ✔ formulas updated" 18 | fi 19 | else 20 | command -v ruby >/dev/null 2>&1 || { echo >&2 "Error: Some ruby of version is required to install homebrew. Aborting"; exit 1; } 21 | ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" 22 | fi 23 | } 24 | 25 | # param $1 formula name 26 | # param $2 [optional] tap path 27 | brew_install () 28 | { 29 | formula_version=`brew list --versions $1` 30 | if [ -z "$formula_version" ] 31 | then 32 | if [ -z $2 ] 33 | then 34 | formula_name=$1 35 | else 36 | formula_name="$2/$1" 37 | fi 38 | echo "" 39 | echo " → Installing brew formula $formula_name" 40 | brew install -v $formula_name > /dev/null 2>&1 41 | 42 | # Extract version 43 | regexp="^.*([0-9]\.[0-9]\.[0-9]).*$" 44 | installed_version="" 45 | eval "output=\"$(brew info $1)\"" 46 | if [[ $output =~ $regexp ]] 47 | then 48 | installed_version=${BASH_REMATCH[1]} 49 | fi 50 | 51 | echo " ✔ $formula_name $installed_version has been installed" 52 | else 53 | echo " ✔ $1 is already installed" 54 | fi 55 | } 56 | -------------------------------------------------------------------------------- /script/common/configure_carthage_cache: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | require 'yaml' 3 | 4 | def encrypt(key, value) 5 | `bundle exec travis encrypt #{key}=#{value} --add env.global` 6 | unless $?.success? 7 | STDERR.puts "Unable to encrypt '#{key}'" 8 | exit 1 9 | end 10 | end 11 | 12 | unless File.exist?(".carthage_cache.yml") 13 | STDERR.puts ".carthage_cache.yml file does not exist" 14 | exit 1 15 | end 16 | 17 | `bundle exec travis whoami` 18 | unless $?.success? 19 | github_access_token = ARGV[0] 20 | unless github_access_token 21 | STDERR.puts "You need to provide your personal GitHub access token in order to be able to login into TravisCI." 22 | exit 1 23 | end 24 | 25 | puts "Loging into TravisCI pro account ..." 26 | `bundle exec travis login --pro --github-token #{github_access_token}` 27 | unless $?.success? 28 | STDERR.puts "Unable to login into TravisCI pro account." 29 | exit 1 30 | end 31 | 32 | puts "Loging into TravisCI org account ..." 33 | `bundle exec travis login --org --github-token #{github_access_token}` 34 | unless $?.success? 35 | STDERR.puts "Unable to login into TravisCI org account." 36 | exit 1 37 | end 38 | end 39 | 40 | config = YAML.load(File.read(".carthage_cache.yml")) 41 | puts "Adding carthage_cache config encrypted env variables to .travis.yml ..." 42 | encrypt("AWS_REGION", config[:aws_s3_client_options][:region]) 43 | encrypt("AWS_ACCESS_KEY_ID", config[:aws_s3_client_options][:access_key_id]) 44 | encrypt("AWS_SECRET_ACCESS_KEY", config[:aws_s3_client_options][:secret_access_key]) 45 | encrypt("CARTHAGE_CACHE_BUCKET_NAME", config[:bucket_name]) 46 | puts ".travis.yml successfully updated!" 47 | -------------------------------------------------------------------------------- /script/build: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -e 4 | 5 | source script/.env 6 | source script/common/carthage 7 | 8 | build_using_carthage () 9 | { 10 | check_carthage_version 11 | carthage_cmd="carthage build --no-skip-current --platform $CARTHAGE_BUILD_PLATFORM" 12 | if [ "$USE_SSH" == "true" ] 13 | then 14 | carthage_cmd="$carthage_cmd --use-ssh" 15 | fi 16 | if [ ! -z "$VERBOSE" ] 17 | then 18 | echo $carthage_cmd 19 | fi 20 | eval $carthage_cmd 21 | } 22 | 23 | build_using_xcodebuild () 24 | { 25 | build_command="set -o pipefail && xcodebuild -scheme $1" 26 | if [ -z "$XCODE_WORKSPACE" ] 27 | then 28 | build_command="$build_command -project $XCODE_PROJECT" 29 | else 30 | build_command="$build_command -workspace $XCODE_WORKSPACE" 31 | fi 32 | build_command="$build_command -sdk iphonesimulator build -configuration Debug" 33 | 34 | if type bundle > /dev/null && bundle show xcpretty > /dev/null 35 | then 36 | build_command="$build_command | xcpretty -c" 37 | fi 38 | 39 | echo "" 40 | echo " → Building scheme '$1'" 41 | echo "" 42 | if [ ! -z "$VERBOSE" ] 43 | then 44 | echo $build_command 45 | fi 46 | eval $build_command 47 | } 48 | 49 | if [ -z "$DISABLE_XCODE_CHECK" ] 50 | then 51 | script/common/check_xcode_version $REQUIRED_XCODE_VERSION 52 | fi 53 | 54 | if [ ! -f $XCODE_WORKSPACE ] && [ -f Cartfile.resolved ] && type carthage > /dev/null 55 | then 56 | build_using_carthage 57 | else 58 | source script/.env 59 | source script/script_hooks/schemes 60 | 61 | current_schemes=$(schemes) 62 | if [ -z "$current_schemes" ] 63 | then 64 | echo "" 65 | echo "ERROR: There are no schemes. Probably you forgot to share your schemes" 66 | exit 1 67 | fi 68 | 69 | for scheme in $current_schemes 70 | do 71 | build_using_xcodebuild $scheme 72 | done 73 | fi 74 | -------------------------------------------------------------------------------- /script/common/tailor: -------------------------------------------------------------------------------- 1 | force_install_tailor () 2 | { 3 | echo "" 4 | echo " → Installing tailor '$REQUIRED_TAILOR_VERSION'" 5 | echo "" 6 | wget https://github.com/sleekbyte/tailor/releases/download/v$REQUIRED_TAILOR_VERSION/tailor-$REQUIRED_TAILOR_VERSION.tar -O /tmp/tailor.tar > /dev/null 7 | tar -xvf /tmp/tailor.tar 8 | mv tailor-$REQUIRED_TAILOR_VERSION/ tailor/ 9 | export PATH=$PATH:$PWD/tailor/bin/ 10 | echo " ✔ tailor '$REQUIRED_TAILOR_VERSION' successfully installed" 11 | echo "" 12 | } 13 | 14 | uninstall_tailor () 15 | { 16 | echo "" 17 | echo " → Uninstalling tailor" 18 | echo "" 19 | local tailor_installed_version=`tailor version` 20 | if type brew > /dev/null && [ ! -z "$(brew list --versions tailor)" ] 21 | then 22 | brew uninstall tailor > /dev/null 23 | else 24 | sudo rm /tmp/tailor 25 | fi 26 | echo " ✔ tailor '$tailor_installed_version' successfully uninstalled" 27 | } 28 | 29 | check_tailor_version () 30 | { 31 | local tailor_installed_version=`tailor version` 32 | 33 | local patch_number=`echo $REQUIRED_TAILOR_VERSION | cut -d "." -f 3` 34 | if [ -z $patch_number ] 35 | then 36 | COMPARE_TAILOR_VERSION="$REQUIRED_TAILOR_VERSION.0" 37 | else 38 | COMPARE_TAILOR_VERSION="$REQUIRED_TAILOR_VERSION" 39 | fi 40 | 41 | local patch_number=`echo $tailor_installed_version | cut -d "." -f 3` 42 | if [ -z $patch_number ] 43 | then 44 | COMPARE_TAILOR_VERSION="$tailor_installed_version.0" 45 | fi 46 | 47 | if [ "$tailor_installed_version" != "$COMPARE_TAILOR_VERSION" ] 48 | then 49 | printf "\033[1;31mError: tailor version '$tailor_installed_version' is not equal to '$COMPARE_TAILOR_VERSION'" 50 | printf "\033[0m" 51 | if [ ! -z "$NO_TAILOR_UPDATE" ] 52 | then 53 | exit 1 54 | else 55 | if [ ! -z "$FORCE_TAILOR_VERSION" ] 56 | then 57 | uninstall_tailor 58 | force_install_tailor 59 | else 60 | echo "" 61 | echo "" 62 | echo "Would you like to update tailor to version '$REQUIRED_TAILOR_VERSION'? [N/y]" 63 | read update_tailor 64 | if [ "$update_tailor" == "y" ] 65 | then 66 | uninstall_tailor 67 | force_install_tailor 68 | else 69 | exit 1 70 | fi 71 | fi 72 | fi 73 | fi 74 | } 75 | -------------------------------------------------------------------------------- /script/common/swiftlint: -------------------------------------------------------------------------------- 1 | force_install_swiftlint () 2 | { 3 | echo "" 4 | echo " → Installing swiftlint '$REQUIRED_SWIFTLINT_VERSION'" 5 | echo "" 6 | curl -s -L -O https://github.com/realm/SwiftLint/releases/download/$REQUIRED_SWIFTLINT_VERSION/SwiftLint.pkg > /dev/null 7 | sudo installer -pkg SwiftLint.pkg -target / > /dev/null 8 | rm SwiftLint.pkg 9 | echo " ✔ swiftlint '$REQUIRED_SWIFTLINT_VERSION' successfully installed" 10 | echo "" 11 | } 12 | 13 | uninstall_swiftlint () 14 | { 15 | echo "" 16 | echo " → Uninstalling swiftlint" 17 | echo "" 18 | local swiftlint_installed_version=`swiftlint version` 19 | if type brew > /dev/null && [ ! -z "$(brew list --versions swiftlint)" ] 20 | then 21 | brew uninstall swiftlint > /dev/null 22 | else 23 | sudo rm -frd /Library/Frameworks/SwiftLintFramework.framework 24 | sudo rm /usr/local/bin/swiftlint 25 | fi 26 | echo " ✔ swiftlint '$swiftlint_installed_version' successfully uninstalled" 27 | } 28 | 29 | check_swiftlint_version () 30 | { 31 | local swiftlint_installed_version=`swiftlint version` 32 | 33 | local patch_number=`echo $REQUIRED_SWIFTLINT_VERSION | cut -d "." -f 3` 34 | if [ -z $patch_number ] 35 | then 36 | COMPARE_SWIFTLINT_VERSION="$REQUIRED_SWIFTLINT_VERSION.0" 37 | else 38 | COMPARE_SWIFTLINT_VERSION="$REQUIRED_SWIFTLINT_VERSION" 39 | fi 40 | 41 | local patch_number=`echo $swiftlint_installed_version | cut -d "." -f 3` 42 | if [ -z $patch_number ] 43 | then 44 | COMPARE_SWIFTLINT_VERSION="$swiftlint_installed_version.0" 45 | fi 46 | 47 | if [ "$swiftlint_installed_version" != "$COMPARE_SWIFTLINT_VERSION" ] 48 | then 49 | printf "\033[1;31mError: swiftlint version '$swiftlint_installed_version' is not equal to '$COMPARE_SWIFTLINT_VERSION'" 50 | printf "\033[0m" 51 | if [ ! -z "$NO_SWIFTLINT_UPDATE" ] 52 | then 53 | exit 1 54 | else 55 | if [ ! -z "$FORCE_SWIFTLINT_VERSION" ] 56 | then 57 | uninstall_swiftlint 58 | force_install_swiftlint 59 | else 60 | echo "" 61 | echo "" 62 | echo "Would you like to update swiftlint to version '$REQUIRED_SWIFTLINT_VERSION'? [N/y]" 63 | read update_swiftlint 64 | if [ "$update_swiftlint" == "y" ] 65 | then 66 | uninstall_swiftlint 67 | force_install_swiftlint 68 | else 69 | exit 1 70 | fi 71 | fi 72 | fi 73 | fi 74 | } 75 | -------------------------------------------------------------------------------- /script/test: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -e 4 | 5 | source script/.env 6 | source script/script_hooks/schemes 7 | source script/script_hooks/destinations 8 | source script/common/carthage 9 | source script/common/swiftlint 10 | 11 | run_tests () 12 | { 13 | test_command="set -o pipefail && xcodebuild -scheme $1" 14 | 15 | if [ -z "$XCODE_WORKSPACE" ] 16 | then 17 | test_command="$test_command -project $XCODE_PROJECT" 18 | else 19 | test_command="$test_command -workspace $XCODE_WORKSPACE" 20 | fi 21 | 22 | destination=$(scheme_destination $1) 23 | test_command="$test_command -destination $destination clean test -configuration Debug" 24 | if type bundle > /dev/null && bundle show xcpretty > /dev/null 25 | then 26 | test_command="$test_command | bundle exec xcpretty -c" 27 | if type bundle > /dev/null && bundle show xcpretty-travis-formatter > /dev/null && [ "$TRAVIS" == "true" ] 28 | then 29 | formatter_class=`bundle exec xcpretty-travis-formatter` 30 | test_command="$test_command -f '$formatter_class'" 31 | fi 32 | fi 33 | 34 | test_command="open -b com.apple.iphonesimulator && $test_command" 35 | echo "" 36 | echo " → Running tests for scheme '$1'" 37 | echo "" 38 | if [ ! -z "$VERBOSE" ] 39 | then 40 | echo $test_command 41 | fi 42 | eval $test_command 43 | } 44 | 45 | if [ -z "$DISABLE_XCODE_CHECK" ] 46 | then 47 | script/common/check_xcode_version $REQUIRED_XCODE_VERSION 48 | fi 49 | 50 | if [ -f Cartfile.resolved ] 51 | then 52 | check_carthage_version 53 | fi 54 | 55 | if [ -f .swiftlint.yml ] && [ -z $DISABLE_SWIFTLINT ] 56 | then 57 | echo "" 58 | echo " → Running swiftlint" 59 | echo "" 60 | check_swiftlint_version 61 | if [ ! -z "$RUNNING_ON_CI" ] && type bundle > /dev/null && bundle show linterbot > /dev/null && [ "$PULL_REQUEST" != "false" ] 62 | then 63 | echo "" 64 | echo " → Running linterbot" 65 | echo "" 66 | # || true avoid a the script to fail if the linter 67 | # does not returns successfully, which could happen 68 | # in case of severe lint errors 69 | swiftlint lint --reporter json > .swiftlint-report.json || true 70 | bundle exec linterbot $REPO_SLUG $PULL_REQUEST --trace < .swiftlint-report.json 71 | else 72 | swiftlint 73 | fi 74 | fi 75 | 76 | current_schemes=$(schemes) 77 | if [ -z "$current_schemes" ] 78 | then 79 | echo "" 80 | echo "ERROR: There are no schemes. Probably you forgot to share your schemes" 81 | exit 1 82 | fi 83 | 84 | if [ -f fastlane/Scanfile ] || [ -f Scanfile ] 85 | then 86 | bundle exec scan 87 | else 88 | for scheme in $current_schemes 89 | do 90 | run_tests $scheme 91 | done 92 | fi 93 | 94 | if [ -f "$PROJECT_NAME.podspec" ] && [ "$LINT_PODSPEC" == "yes" ] 95 | then 96 | echo "" 97 | echo " → Linting $PROJECT_NAME.podspec" 98 | echo "" 99 | if type bundle > /dev/null && bundle show pod > /dev/null 100 | then 101 | bundle exec pod lib lint $LINT_PODSPEC_PARAMETERS 102 | elif type pod > /dev/null 103 | then 104 | pod lib lint $LINT_PODSPEC_PARAMETERS 105 | fi 106 | fi 107 | 108 | if [ -z "$RUNNING_ON_CI" ] && [ -f .slather.yml ] 109 | then 110 | slather_command="bundle exec slather coverage -s" 111 | if [ ! -z "$VERBOSE" ] 112 | then 113 | slather_command="$slather_command --verbose" 114 | fi 115 | eval $slather_command 116 | fi 117 | -------------------------------------------------------------------------------- /script/cibuild: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | export SCRIPT_DIR=$(dirname "$0") 4 | 5 | ## 6 | ## Configuration Variables 7 | ## 8 | 9 | # The name of the keychain to create for iOS code signing. 10 | KEYCHAIN=ios-build.keychain 11 | 12 | ## 13 | ## Build Process 14 | ## 15 | check_if_pr_only_adds_markdown_files() 16 | { 17 | if [ "$PULL_REQUEST" == "false" ] 18 | then 19 | echo "false" 20 | else 21 | echo `curl -v -H "Authorization: token $GITHUB_ACCESS_TOKEN" "https://api.github.com/repos/$REPO_SLUG/pulls/$PULL_REQUEST/files" | ruby -e "require 'json'; puts JSON.parse(STDIN.read).all? { |file| file['filename'].end_with?('.md') }"` 22 | fi 23 | } 24 | 25 | main () 26 | { 27 | if [ "$(check_if_pr_only_adds_markdown_files)" == "true" ] 28 | then 29 | echo "Skipping build because this pull request only adds / modifies markdown files." 30 | exit 0 31 | fi 32 | 33 | if [ -f Cartfile.resolved ] && [ -f "$SCRIPT_DIR/certificates/cibot.p12" ] 34 | then 35 | echo "" 36 | echo "####### Importing Developer Certificates #######" 37 | echo "" 38 | import_certs 39 | fi 40 | 41 | echo "" 42 | echo "####### Bootstrap Phase #######" 43 | echo "" 44 | RUNNING_ON_CI=1 DISABLE_CARTHAGE_CACHE_CONFIG=true script/bootstrap 45 | local status=$? 46 | 47 | if [ $status -eq 0 ] 48 | then 49 | echo "" 50 | echo "" 51 | echo "####### Build & Test Phase #######" 52 | echo "" 53 | set -o pipefail && RUNNING_ON_CI=1 script/test 2>&1 | tee /tmp/build.test-output.txt 54 | status=$? 55 | if [ ! $status -eq 0 ] 56 | then 57 | log_file_path=`cat /tmp/build.test-output.txt | tail -n 100 | perl -l -ne '/(\/var\/folders.*\/com\.apple\.dt\.XCTest-status.*)\)/ && print $1'` 58 | if [ ! -z "$log_file_path" ] 59 | then 60 | echo "" 61 | echo " → The tests have failed. Printing output of log file '$log_file_path'." 62 | cat $log_file_path 63 | echo "" 64 | fi 65 | fi 66 | fi 67 | 68 | if [ -f Cartfile.resolved ] && [ -f "$SCRIPT_DIR/certificates/cibot.p12" ] 69 | then 70 | delete_keychain 71 | fi 72 | exit $status 73 | } 74 | 75 | import_certs () 76 | { 77 | # If this environment variable is missing, we must not be running on Travis. 78 | if [ -z "$KEY_PASSWORD" ] 79 | then 80 | return 0 81 | fi 82 | 83 | echo " → Setting up code signing..." 84 | local password=cibuild 85 | 86 | # Create a temporary keychain for code signing. 87 | security create-keychain -p "$password" "$KEYCHAIN" 88 | security default-keychain -s "$KEYCHAIN" 89 | security unlock-keychain -p "$password" "$KEYCHAIN" 90 | security set-keychain-settings -t 3600 -l "$KEYCHAIN" 91 | 92 | # Download the certificate for the Apple Worldwide Developer Relations 93 | # Certificate Authority. 94 | local certpath="$SCRIPT_DIR/apple_wwdr.cer" 95 | curl -s 'https://developer.apple.com/certificationauthority/AppleWWDRCA.cer' > "$certpath" 96 | security import "$certpath" -k "$KEYCHAIN" -T /usr/bin/codesign 97 | 98 | # Import our development certificate. 99 | security import "$SCRIPT_DIR/certificates/cibot.p12" -k "$KEYCHAIN" -P "$KEY_PASSWORD" -T /usr/bin/codesign 100 | } 101 | 102 | delete_keychain () 103 | { 104 | if [ -z "$KEY_PASSWORD" ] 105 | then 106 | return 0 107 | fi 108 | 109 | echo " → Removing temporary keychain" 110 | security delete-keychain "$KEYCHAIN" 111 | echo " ✔ Temporary keychain successfully removed." 112 | } 113 | 114 | export -f import_certs 115 | export -f delete_keychain 116 | 117 | main 118 | -------------------------------------------------------------------------------- /tests/carthage/iOSScriptsCarthage.xcodeproj/xcshareddata/xcschemes/ScriptsCarthage-iOS.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 29 | 35 | 36 | 37 | 38 | 39 | 44 | 45 | 47 | 53 | 54 | 55 | 56 | 57 | 63 | 64 | 65 | 66 | 67 | 68 | 78 | 79 | 85 | 86 | 87 | 88 | 89 | 90 | 96 | 97 | 103 | 104 | 105 | 106 | 108 | 109 | 112 | 113 | 114 | -------------------------------------------------------------------------------- /script/bootstrap: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -e 4 | 5 | if [ -f script/script_hooks/bootstrap ] && [ -z $DISABLE_BOOTSTRAP_HOOKS ] 6 | then 7 | source script/script_hooks/bootstrap 8 | fi 9 | 10 | print_gem_install_cmd () 11 | { 12 | regexp="gem ['\"]([a-zA-Z0-9_-]+)['\"](,.*)?" 13 | gems="" 14 | while read -r line 15 | do 16 | if [[ $line =~ $regexp ]] 17 | then 18 | gems="$gems ${BASH_REMATCH[1]}" 19 | fi 20 | done < Gemfile 21 | 22 | echo "" 23 | echo " $> 'sudo gem install$gems'" 24 | echo "" 25 | } 26 | 27 | bundle_install () 28 | { 29 | echo "" 30 | echo " → Installing gems" 31 | echo "" 32 | if type bundle > /dev/null 33 | then 34 | bundle install 35 | else 36 | # TODO ask user if he/she wants the script to try to install 37 | # rbenv, ruby and bundler. 38 | printf "\033[1;33m⚠ WARNING: Ruby gems in Gemfile could not be installed because 'bundler' is not available.\n" \ 39 | "You should install rbenv or rvm and bundler" \ 40 | "or try to install the gems globally by running the following command:" 41 | print_gem_install_cmd 42 | printf "\033[0m" 43 | exit 1 44 | fi 45 | } 46 | 47 | install_git_hooks () 48 | { 49 | if [ ! -z "$INSTALL_GITHOOKS" ] 50 | then 51 | echo "" 52 | echo " → Installing git hooks" 53 | echo "" 54 | for hook in script/git_hooks/* 55 | do 56 | cp $hook .git/hooks 57 | echo " ✔ $hook successfully installed" 58 | done 59 | echo "" 60 | fi 61 | } 62 | 63 | bootstrap_carthage () 64 | { 65 | echo "" 66 | echo " → Bootstrapping Carthage" 67 | echo "" 68 | call_carthage "bootstrap" 69 | } 70 | 71 | bootstrap_cocoapods () 72 | { 73 | echo "" 74 | echo " → Bootstrapping Cocoapods" 75 | echo "" 76 | if type bundle > /dev/null && bundle show pod > /dev/null 77 | then 78 | bundle exec pod install 79 | else 80 | pod install 81 | fi 82 | } 83 | 84 | echo_submodule_name () 85 | { 86 | echo " ✔ $name successfully initialized" 87 | } 88 | 89 | init_submodules () 90 | { 91 | echo "" 92 | echo " → Initializing submodules ..." 93 | echo "" 94 | git submodule update --quiet --init --recursive > /dev/null 95 | git submodule foreach --quiet echo_submodule_name 96 | } 97 | 98 | before_install_hooks () 99 | { 100 | if [ -f script/script_hooks/bootstrap ] && [ -z $DISABLE_BOOTSTRAP_HOOKS ] && type bootstrap_before_install_hooks > /dev/null 101 | then 102 | echo "" 103 | echo " → Running hooks before dependencies install" 104 | echo "" 105 | bootstrap_before_install_hooks 106 | fi 107 | } 108 | 109 | after_install_hooks () 110 | { 111 | if [ -f script/script_hooks/bootstrap ] && [ -z $DISABLE_BOOTSTRAP_HOOKS ] && type bootstrap_after_install_hooks > /dev/null 112 | then 113 | echo "" 114 | echo " → Running hooks after dependencies install" 115 | echo "" 116 | bootstrap_after_install_hooks 117 | fi 118 | } 119 | 120 | install_carthage () 121 | { 122 | source script/common/carthage 123 | 124 | if type carthage > /dev/null 125 | then 126 | echo "" 127 | echo " → Checking installed version of carthage" 128 | echo "" 129 | check_carthage_version 130 | else 131 | force_install_carthage 132 | fi 133 | 134 | if [ -z "$DISABLE_CARTHAGE_CACHE_CONFIG" ] && type bundle > /dev/null && bundle show carthage_cache > /dev/null && [ ! -f .carthage_cache.yml ] 135 | then 136 | bundle exec carthage_cache config 137 | fi 138 | } 139 | 140 | install_swiftlint () 141 | { 142 | source script/common/swiftlint 143 | 144 | if type swiftlint > /dev/null 145 | then 146 | echo "" 147 | echo " → Checking installed version of swiftlint" 148 | echo "" 149 | check_swiftlint_version 150 | else 151 | force_install_swiftlint 152 | fi 153 | } 154 | 155 | install_tailor () 156 | { 157 | source script/common/tailor 158 | 159 | if type tailor > /dev/null 160 | then 161 | echo "" 162 | echo " → Checking installed version of tailor" 163 | echo "" 164 | check_tailor_version 165 | else 166 | force_install_tailor 167 | fi 168 | } 169 | 170 | main () 171 | { 172 | source script/.env 173 | 174 | echo "" 175 | echo " Bootstrapping $PROJECT_NAME" 176 | echo "" 177 | 178 | if [ -z "$DISABLE_XCODE_CHECK" ] 179 | then 180 | script/common/check_xcode_version $REQUIRED_XCODE_VERSION 181 | fi 182 | 183 | install_git_hooks 184 | 185 | before_install_hooks 186 | 187 | if [ -f Gemfile ] 188 | then 189 | bundle_install 190 | fi 191 | 192 | if [ -f Cartfile.resolved ] 193 | then 194 | install_carthage 195 | bootstrap_carthage 196 | fi 197 | 198 | if [ -f .swiftlint.yml ] 199 | then 200 | install_swiftlint 201 | fi 202 | 203 | if [ -f .tailor.yml ] 204 | then 205 | install_tailor 206 | fi 207 | 208 | if [ -f Podfile ] 209 | then 210 | bootstrap_cocoapods 211 | fi 212 | 213 | if [ -f .gitmodules ] 214 | then 215 | init_submodules 216 | fi 217 | 218 | after_install_hooks 219 | 220 | open_file_name="" 221 | if [ -z "$XCODE_WORKSPACE" ] 222 | then 223 | open_file_name=$XCODE_PROJECT 224 | else 225 | open_file_name=$XCODE_WORKSPACE 226 | fi 227 | 228 | echo "" 229 | echo " $PROJECT_NAME successfully bootstrapped" 230 | echo "" 231 | echo " Usefull scripts:" 232 | echo "" 233 | echo " * 'script/test' to run tests." 234 | echo " * 'script/build' to build the project." 235 | echo " * 'script/update' to update project's dependencies." 236 | echo "" 237 | echo " You can start hacking by executing:" 238 | echo "" 239 | echo " open $open_file_name" 240 | echo "" 241 | } 242 | 243 | export -f init_submodules 244 | export -f echo_submodule_name 245 | 246 | main 247 | -------------------------------------------------------------------------------- /script/common/carthage: -------------------------------------------------------------------------------- 1 | check_carthage_version_exists () 2 | { 3 | echo "" 4 | echo " → Checking carthage version '$REQUIRED_CARTHAGE_VERSION'" 5 | echo "" 6 | curl -s --head https://github.com/Carthage/Carthage/releases/download/$REQUIRED_CARTHAGE_VERSION/Carthage.pkg | head -n 1 | grep "HTTP/1.[01] [23].." > /dev/null 7 | # on success (page exists), $? will be 0; 8 | # on failure (page does not exist or is unreachable), $? will be 1 9 | if [ "$?" -eq 0 ] 10 | then 11 | return 0 12 | else 13 | return 1 14 | fi 15 | } 16 | 17 | force_install_carthage () 18 | { 19 | echo "" 20 | echo " → Installing carthage '$REQUIRED_CARTHAGE_VERSION'" 21 | echo "" 22 | curl -s -L -O https://github.com/Carthage/Carthage/releases/download/$REQUIRED_CARTHAGE_VERSION/Carthage.pkg > /dev/null 23 | sudo installer -pkg Carthage.pkg -target / > /dev/null 24 | rm Carthage.pkg 25 | echo " ✔ carthage '$REQUIRED_CARTHAGE_VERSION' successfully installed" 26 | echo "" 27 | } 28 | 29 | uninstall_carthage () 30 | { 31 | echo "" 32 | echo " → Uninstalling carthage" 33 | echo "" 34 | local carthage_installed_version=`carthage version` 35 | carthage_installed_version=${carthage_installed_version##*$'\n'} 36 | if type brew > /dev/null && [ ! -z "$(brew list --versions carthage)" ] 37 | then 38 | brew uninstall carthage > /dev/null 39 | else 40 | sudo rm -frd /Library/Frameworks/CarthageKit.framework 41 | sudo rm /usr/local/bin/carthage 42 | fi 43 | echo " ✔ carthage '$carthage_installed_version' successfully uninstalled" 44 | } 45 | 46 | check_carthage_version () 47 | { 48 | if ! check_carthage_version_exists 49 | then 50 | printf "\033[1;31mError: carthage version '$REQUIRED_CARTHAGE_VERSION' does not exist." 51 | printf "\033[0m" 52 | echo "" 53 | exit 54 | fi 55 | 56 | local carthage_installed_version=`carthage version` 57 | carthage_installed_version=${carthage_installed_version##*$'\n'} 58 | 59 | local patch_number=`echo $REQUIRED_CARTHAGE_VERSION | cut -d "." -f 3` 60 | if [ -z $patch_number ] 61 | then 62 | COMPARE_CARTHAGE_VERSION="$REQUIRED_CARTHAGE_VERSION.0" 63 | else 64 | COMPARE_CARTHAGE_VERSION="$REQUIRED_CARTHAGE_VERSION" 65 | fi 66 | 67 | local patch_number=`echo $carthage_installed_version | cut -d "." -f 3` 68 | if [ -z $patch_number ] 69 | then 70 | carthage_installed_version="$carthage_installed_version.0" 71 | fi 72 | 73 | if [ "$carthage_installed_version" == ".0" ] 74 | then 75 | if [ ! -z "$NO_CARTHAGE_UPDATE" ] 76 | then 77 | exit 1 78 | else 79 | if [ ! -z "$FORCE_CARTHAGE_VERSION" ] 80 | then 81 | force_install_carthage 82 | else 83 | echo "" 84 | echo "" 85 | echo "Would you like to update carthage to version '$REQUIRED_CARTHAGE_VERSION'? [N/y]" 86 | read update_carthage 87 | if [ "$update_carthage" == "y" ] 88 | then 89 | force_install_carthage 90 | else 91 | exit 1 92 | fi 93 | fi 94 | fi 95 | else 96 | if [ "$carthage_installed_version" != "$COMPARE_CARTHAGE_VERSION" ] 97 | then 98 | printf "\033[1;31mError: carthage version '$carthage_installed_version' is not equal to '$COMPARE_CARTHAGE_VERSION'" 99 | printf "\033[0m" 100 | if [ ! -z "$NO_CARTHAGE_UPDATE" ] 101 | then 102 | exit 1 103 | else 104 | if [ ! -z "$FORCE_CARTHAGE_VERSION" ] 105 | then 106 | uninstall_carthage 107 | force_install_carthage 108 | else 109 | echo "" 110 | echo "" 111 | echo "Would you like to update carthage to version '$REQUIRED_CARTHAGE_VERSION'? [N/y]" 112 | read update_carthage 113 | if [ "$update_carthage" == "y" ] 114 | then 115 | uninstall_carthage 116 | force_install_carthage 117 | else 118 | exit 1 119 | fi 120 | fi 121 | fi 122 | else 123 | echo "Carthage version '$REQUIRED_CARTHAGE_VERSION' is already installed." 124 | fi 125 | fi 126 | } 127 | 128 | call_carthage() 129 | { 130 | carthage_cmd="carthage $1 --platform $CARTHAGE_BUILD_PLATFORM" 131 | 132 | if [ "$USE_SSH" == "true" ] 133 | then 134 | carthage_cmd="$carthage_cmd --use-ssh" 135 | fi 136 | 137 | if [ "$USE_SUBMODULES" == "true" ] 138 | then 139 | carthage_cmd="$carthage_cmd --use-submodules --no-build" 140 | fi 141 | 142 | if [ "$CARTHAGE_NO_USE_BINARIES" == "true" ] 143 | then 144 | carthage_cmd="$carthage_cmd --no-use-binaries" 145 | fi 146 | 147 | # Wraps cartahge command with carthage_cache command 148 | if [ -z $DISABLE_CARTHAGE_CACHE ] && type bundle > /dev/null && bundle show carthage_cache > /dev/null && ([ ! -z $DISABLE_CARTHAGE_CACHE_CONFIG ] || [ -f .carthage_cache.yml ]) 149 | then 150 | 151 | # Builds basic carthage cache command invocation 152 | carthage_cache_cmd="bundle exec carthage_cache --verbose" 153 | if [ ! -z $CARTHAGE_CACHE_BUCKET_NAME ] 154 | then 155 | carthage_cache_cmd="$carthage_cache_cmd -b $CARTHAGE_CACHE_BUCKET_NAME" 156 | fi 157 | 158 | # Adds carthage cache install command if not disabled 159 | if [ -z $DISABLE_CARTHAGE_CACHE_INSTALL ] && [ $1 != "update" ] 160 | then 161 | carthage_cmd="($carthage_cache_cmd install || $carthage_cmd)" 162 | fi 163 | 164 | # Adds carthage cache publish command if not disabled 165 | if [ -z $DISABLE_CARTHAGE_CACHE_PUBLISH ] 166 | then 167 | carthage_cmd="$carthage_cmd && $carthage_cache_cmd publish -p" 168 | if [ -f ".carthage_cache_prune_white_list.yml" ] 169 | then 170 | carthage_cmd="$carthage_cmd -w .carthage_cache_prune_white_list.yml" 171 | fi 172 | fi 173 | fi 174 | 175 | carthage_cmd="time $carthage_cmd" 176 | if [ ! -z "$VERBOSE" ] 177 | then 178 | echo $carthage_cmd 179 | fi 180 | 181 | if [ -z $DRY_RUN ] 182 | then 183 | eval $carthage_cmd 184 | else 185 | echo "" 186 | echo "WARN: Command was not executed because DRY_RUN enviromental was present." 187 | echo "" 188 | fi 189 | } 190 | -------------------------------------------------------------------------------- /install: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # $1 - Path to iOS project 4 | 5 | set -e 6 | 7 | DEFAULT_CARTHAGE_VERSION="0.16.2" 8 | DEFAULT_SWIFTLINT_VERSION="0.9.2" 9 | DEFAULT_XCODE_VERSION="7.3" 10 | 11 | generate_env_file () 12 | { 13 | echo "" 14 | echo "Do you want to generate .env file? [N/y]" 15 | read generate_env_file 16 | 17 | if [ "$generate_env_file" == "y" ] 18 | then 19 | while [ -z "$project_name" ] 20 | do 21 | echo "" 22 | echo "Enter the project name:" 23 | read project_name 24 | done 25 | 26 | echo "" 27 | echo "Enter 'project' or 'workspace' depending on what you use [project]:" 28 | read xcode_file 29 | if [ "$xcode_file" == "workspace" ] 30 | then 31 | echo "" 32 | echo "Enter the xcode workspace file name [$project_name.xcworkspace]:" 33 | read xcode_workspace_file 34 | if [ -z "$xcode_workspace_file" ] 35 | then 36 | xcode_workspace_file="$project_name.xcworkspace" 37 | fi 38 | else 39 | echo "" 40 | echo "Enter the xcode project file name [$project_name.xcodeproj]:" 41 | read xcode_project_file 42 | if [ -z "$xcode_project_file" ] 43 | then 44 | xcode_project_file="$project_name.xcodeproj" 45 | fi 46 | fi 47 | 48 | echo "" 49 | echo "What version of Xcode should we use? [$DEFAULT_XCODE_VERSION]" 50 | read required_xcode_version 51 | 52 | echo "" 53 | echo "Do you want to install githooks when bootstrapping the project? [Y/n]" 54 | read install_githooks 55 | if [ "$install_githooks" != "n" ] 56 | then 57 | install_githooks="y" 58 | fi 59 | 60 | if [ -f $1/.swiftlint.yml ] 61 | then 62 | echo "" 63 | echo "What version of swiftlint should we use? [$DEFAULT_SWIFTLINT_VERSION]" 64 | read required_swiftlint_version 65 | fi 66 | 67 | if [ -f $1/Cartfile ] || [ -f $1/Cartfile.private ] 68 | then 69 | echo "" 70 | echo "What version of Carthage should we use? [$DEFAULT_CARTHAGE_VERSION]" 71 | read required_carthage_version 72 | 73 | echo "" 74 | echo "Do you want to use ssh to checkout dependencies with Carthage? [N/y]" 75 | read use_ssh 76 | 77 | echo "" 78 | echo "Do you want to use submodules when checking out dependencies with Carthage? [N/y]" 79 | read use_submodules 80 | 81 | echo "" 82 | echo "What platforms should Carthage build? Enter as a comma separated list [iOS]" 83 | read carthage_platforms 84 | fi 85 | 86 | echo "" 87 | echo "Do you want to define iOS destination value for xcodebuild? [N/y]:" 88 | read override_ios_destination 89 | if [ "$override_ios_destination" == "y" ] 90 | then 91 | echo "" 92 | echo "iOS version [latest]:" 93 | read ios_destination_version 94 | 95 | echo "" 96 | echo "iOS simulator name [iPhone 6]:" 97 | read ios_destination_simulator_name 98 | fi 99 | 100 | echo "" 101 | echo "Do you want to define OS X destination value for xcodebuild? [N/y]:" 102 | read override_osx_destination 103 | if [ "$override_osx_destination" == "y" ] 104 | then 105 | echo "" 106 | echo "OSX arch [current]?:" 107 | read osx_destination_arch 108 | fi 109 | 110 | if [ -z "$required_carthage_version" ] 111 | then 112 | required_carthage_version="$DEFAULT_CARTHAGE_VERSION" 113 | fi 114 | 115 | ios_destination_version=${ios_destination_version:-"latest"} 116 | ios_destination_simulator_name=${ios_destination_simulator_name:-"iPhone 6"} 117 | carthage_platforms=${carthage_platforms:-"iOS"} 118 | echo " 119 | REQUIRED_XCODE_VERSION=$required_xcode_version 120 | REQUIRED_SWIFTLINT_VERSION=$required_swiftlint_version 121 | REQUIRED_CARTHAGE_VERSION=$required_carthage_version 122 | CARTHAGE_BUILD_PLATFORM=\${CARTHAGE_BUILD_PLATFORM:-\"$carthage_platforms\"} 123 | CARTHAGE_NO_USE_BINARIES=\${CARTHAGE_NO_USE_BINARIES:-\"false\"} 124 | LINT_PODSPEC=\${LINT_PODSPEC:-\"yes\"} 125 | PROJECT_NAME=$project_name 126 | XCODE_WORKSPACE=$xcode_workspace_file 127 | XCODE_PROJECT=$xcode_project_file 128 | IOS_DESTINATION_VERSION=\${IOS_DESTINATION_VERSION:-\"$ios_destination_version\"} 129 | IOS_DESTINATION_SIMULATOR_NAME=\${IOS_DESTINATION_SIMULATOR_NAME:-\"$ios_destination_simulator_name\"} 130 | OSX_DESTINATION_ARCH=\${OSX_DESTINATION_ARCH:-\"$osx_destination_arch\"}" > "$1/script/.env" 131 | 132 | if [ "$use_ssh" == "y" ] 133 | then 134 | echo "USE_SSH=true" >> "$1/script/.env" 135 | fi 136 | if [ "$use_submodules" == "y" ] 137 | then 138 | echo "USE_SUBMODULES=true" >> "$1/script/.env" 139 | fi 140 | if [ "$install_githooks" == "y" ] 141 | then 142 | echo "INSTALL_GITHOOKS=true" >> "$1/script/.env" 143 | fi 144 | 145 | echo " → '$1/script/.env' successfully generated" 146 | echo "" 147 | cat "$1/script/.env" 148 | echo "" 149 | 150 | echo "Do you want to bootstrap the project? [Y/n]:" 151 | read bootstrap_project 152 | if [ "$bootstrap_project" != "n" ] 153 | then 154 | (cd $1 && script/bootstrap) 155 | fi 156 | else 157 | echo " → Skipping generation of .env file" 158 | echo "" 159 | fi 160 | } 161 | 162 | commit_changes () 163 | { 164 | echo " → Committing changes in '$1'" 165 | echo "" 166 | local current_directory=`pwd` 167 | cd $1 168 | git add . 169 | git commit -m "Updates build scripts." > /dev/null 170 | cd $current_directory 171 | echo " ✔ Changes successfully commited" 172 | echo "" 173 | } 174 | 175 | install_scripts() 176 | { 177 | # Need to check if the working directory is clean before Installing 178 | # script. We use '|| echo false' to avoid the script to fail in case 179 | # the path where the scripts are going to be installed is not under 180 | # git version control 181 | local can_commit_changes="$(cd $1; git status --porcelain || echo false)" 182 | 183 | echo "" 184 | echo " → Installing scripts into '$1/script'" 185 | cp -r script $1 186 | echo "" 187 | echo " ✔ Scripts successfully installed" 188 | echo "" 189 | 190 | if [ ! -f "$1/script/.env" ] 191 | then 192 | generate_env_file $1 193 | fi 194 | 195 | if [ -z "$can_commit_changes" ] 196 | then 197 | if [ ! -z "$(cd $1; git status --porcelain || echo '')" ] 198 | then 199 | commit_changes $1 200 | else 201 | echo "Skipping commit for '$1'. Scripts were already up-to-date." 202 | fi 203 | else 204 | echo "Cannot commit updated scripts for '$1'. Working directory is not clean." 205 | fi 206 | } 207 | 208 | if [ -z "$1" ] && [ -f .installrc ] 209 | then 210 | while read path 211 | do 212 | if [ -f "$path/script/.env" ] 213 | then 214 | install_scripts $path 215 | else 216 | echo "Skipping installation for '$path'. First time installation must be done separatelly." 217 | echo "Run the following:" 218 | echo " ./install $path" 219 | echo "" 220 | fi 221 | done < .installrc 222 | elif [ -z "$1" ] 223 | then 224 | echo "You need to supply a path where to install the scripts or a '.installrc' file." 225 | exit 1 226 | else 227 | install_scripts $1 228 | fi 229 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Apache License 2 | Version 2.0, January 2004 3 | http://www.apache.org/licenses/ 4 | 5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 6 | 7 | 1. Definitions. 8 | 9 | "License" shall mean the terms and conditions for use, reproduction, 10 | and distribution as defined by Sections 1 through 9 of this document. 11 | 12 | "Licensor" shall mean the copyright owner or entity authorized by 13 | the copyright owner that is granting the License. 14 | 15 | "Legal Entity" shall mean the union of the acting entity and all 16 | other entities that control, are controlled by, or are under common 17 | control with that entity. For the purposes of this definition, 18 | "control" means (i) the power, direct or indirect, to cause the 19 | direction or management of such entity, whether by contract or 20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 21 | outstanding shares, or (iii) beneficial ownership of such entity. 22 | 23 | "You" (or "Your") shall mean an individual or Legal Entity 24 | exercising permissions granted by this License. 25 | 26 | "Source" form shall mean the preferred form for making modifications, 27 | including but not limited to software source code, documentation 28 | source, and configuration files. 29 | 30 | "Object" form shall mean any form resulting from mechanical 31 | transformation or translation of a Source form, including but 32 | not limited to compiled object code, generated documentation, 33 | and conversions to other media types. 34 | 35 | "Work" shall mean the work of authorship, whether in Source or 36 | Object form, made available under the License, as indicated by a 37 | copyright notice that is included in or attached to the work 38 | (an example is provided in the Appendix below). 39 | 40 | "Derivative Works" shall mean any work, whether in Source or Object 41 | form, that is based on (or derived from) the Work and for which the 42 | editorial revisions, annotations, elaborations, or other modifications 43 | represent, as a whole, an original work of authorship. For the purposes 44 | of this License, Derivative Works shall not include works that remain 45 | separable from, or merely link (or bind by name) to the interfaces of, 46 | the Work and Derivative Works thereof. 47 | 48 | "Contribution" shall mean any work of authorship, including 49 | the original version of the Work and any modifications or additions 50 | to that Work or Derivative Works thereof, that is intentionally 51 | submitted to Licensor for inclusion in the Work by the copyright owner 52 | or by an individual or Legal Entity authorized to submit on behalf of 53 | the copyright owner. For the purposes of this definition, "submitted" 54 | means any form of electronic, verbal, or written communication sent 55 | to the Licensor or its representatives, including but not limited to 56 | communication on electronic mailing lists, source code control systems, 57 | and issue tracking systems that are managed by, or on behalf of, the 58 | Licensor for the purpose of discussing and improving the Work, but 59 | excluding communication that is conspicuously marked or otherwise 60 | designated in writing by the copyright owner as "Not a Contribution." 61 | 62 | "Contributor" shall mean Licensor and any individual or Legal Entity 63 | on behalf of whom a Contribution has been received by Licensor and 64 | subsequently incorporated within the Work. 65 | 66 | 2. Grant of Copyright License. Subject to the terms and conditions of 67 | this License, each Contributor hereby grants to You a perpetual, 68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 69 | copyright license to reproduce, prepare Derivative Works of, 70 | publicly display, publicly perform, sublicense, and distribute the 71 | Work and such Derivative Works in Source or Object form. 72 | 73 | 3. Grant of Patent License. Subject to the terms and conditions of 74 | this License, each Contributor hereby grants to You a perpetual, 75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 76 | (except as stated in this section) patent license to make, have made, 77 | use, offer to sell, sell, import, and otherwise transfer the Work, 78 | where such license applies only to those patent claims licensable 79 | by such Contributor that are necessarily infringed by their 80 | Contribution(s) alone or by combination of their Contribution(s) 81 | with the Work to which such Contribution(s) was submitted. If You 82 | institute patent litigation against any entity (including a 83 | cross-claim or counterclaim in a lawsuit) alleging that the Work 84 | or a Contribution incorporated within the Work constitutes direct 85 | or contributory patent infringement, then any patent licenses 86 | granted to You under this License for that Work shall terminate 87 | as of the date such litigation is filed. 88 | 89 | 4. Redistribution. You may reproduce and distribute copies of the 90 | Work or Derivative Works thereof in any medium, with or without 91 | modifications, and in Source or Object form, provided that You 92 | meet the following conditions: 93 | 94 | (a) You must give any other recipients of the Work or 95 | Derivative Works a copy of this License; and 96 | 97 | (b) You must cause any modified files to carry prominent notices 98 | stating that You changed the files; and 99 | 100 | (c) You must retain, in the Source form of any Derivative Works 101 | that You distribute, all copyright, patent, trademark, and 102 | attribution notices from the Source form of the Work, 103 | excluding those notices that do not pertain to any part of 104 | the Derivative Works; and 105 | 106 | (d) If the Work includes a "NOTICE" text file as part of its 107 | distribution, then any Derivative Works that You distribute must 108 | include a readable copy of the attribution notices contained 109 | within such NOTICE file, excluding those notices that do not 110 | pertain to any part of the Derivative Works, in at least one 111 | of the following places: within a NOTICE text file distributed 112 | as part of the Derivative Works; within the Source form or 113 | documentation, if provided along with the Derivative Works; or, 114 | within a display generated by the Derivative Works, if and 115 | wherever such third-party notices normally appear. The contents 116 | of the NOTICE file are for informational purposes only and 117 | do not modify the License. You may add Your own attribution 118 | notices within Derivative Works that You distribute, alongside 119 | or as an addendum to the NOTICE text from the Work, provided 120 | that such additional attribution notices cannot be construed 121 | as modifying the License. 122 | 123 | You may add Your own copyright statement to Your modifications and 124 | may provide additional or different license terms and conditions 125 | for use, reproduction, or distribution of Your modifications, or 126 | for any such Derivative Works as a whole, provided Your use, 127 | reproduction, and distribution of the Work otherwise complies with 128 | the conditions stated in this License. 129 | 130 | 5. Submission of Contributions. Unless You explicitly state otherwise, 131 | any Contribution intentionally submitted for inclusion in the Work 132 | by You to the Licensor shall be under the terms and conditions of 133 | this License, without any additional terms or conditions. 134 | Notwithstanding the above, nothing herein shall supersede or modify 135 | the terms of any separate license agreement you may have executed 136 | with Licensor regarding such Contributions. 137 | 138 | 6. Trademarks. This License does not grant permission to use the trade 139 | names, trademarks, service marks, or product names of the Licensor, 140 | except as required for reasonable and customary use in describing the 141 | origin of the Work and reproducing the content of the NOTICE file. 142 | 143 | 7. Disclaimer of Warranty. Unless required by applicable law or 144 | agreed to in writing, Licensor provides the Work (and each 145 | Contributor provides its Contributions) on an "AS IS" BASIS, 146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 147 | implied, including, without limitation, any warranties or conditions 148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 149 | PARTICULAR PURPOSE. You are solely responsible for determining the 150 | appropriateness of using or redistributing the Work and assume any 151 | risks associated with Your exercise of permissions under this License. 152 | 153 | 8. Limitation of Liability. In no event and under no legal theory, 154 | whether in tort (including negligence), contract, or otherwise, 155 | unless required by applicable law (such as deliberate and grossly 156 | negligent acts) or agreed to in writing, shall any Contributor be 157 | liable to You for damages, including any direct, indirect, special, 158 | incidental, or consequential damages of any character arising as a 159 | result of this License or out of the use or inability to use the 160 | Work (including but not limited to damages for loss of goodwill, 161 | work stoppage, computer failure or malfunction, or any and all 162 | other commercial damages or losses), even if such Contributor 163 | has been advised of the possibility of such damages. 164 | 165 | 9. Accepting Warranty or Additional Liability. While redistributing 166 | the Work or Derivative Works thereof, You may choose to offer, 167 | and charge a fee for, acceptance of support, warranty, indemnity, 168 | or other liability obligations and/or rights consistent with this 169 | License. However, in accepting such obligations, You may act only 170 | on Your own behalf and on Your sole responsibility, not on behalf 171 | of any other Contributor, and only if You agree to indemnify, 172 | defend, and hold each Contributor harmless for any liability 173 | incurred by, or claims asserted against, such Contributor by reason 174 | of your accepting any such warranty or additional liability. 175 | 176 | END OF TERMS AND CONDITIONS 177 | 178 | APPENDIX: How to apply the Apache License to your work. 179 | 180 | To apply the Apache License to your work, attach the following 181 | boilerplate notice, with the fields enclosed by brackets "{}" 182 | replaced with your own identifying information. (Don't include 183 | the brackets!) The text should be enclosed in the appropriate 184 | comment syntax for the file format. We also recommend that a 185 | file or class name and description of purpose be included on the 186 | same "printed page" as the copyright notice for easier 187 | identification within third-party archives. 188 | 189 | Copyright 2015 Guido Marucci Blas 190 | 191 | Licensed under the Apache License, Version 2.0 (the "License"); 192 | you may not use this file except in compliance with the License. 193 | You may obtain a copy of the License at 194 | 195 | http://www.apache.org/licenses/LICENSE-2.0 196 | 197 | Unless required by applicable law or agreed to in writing, software 198 | distributed under the License is distributed on an "AS IS" BASIS, 199 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 200 | See the License for the specific language governing permissions and 201 | limitations under the License. 202 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # iOS Scripts 2 | 3 | [![Build Status](https://travis-ci.org/guidomb/ios-scripts.svg)](https://travis-ci.org/guidomb/ios-scripts) 4 | 5 | A set of scripts to manage iOS projects. This scripts are inspired by [this](http://githubengineering.com/scripts-to-rule-them-all/) GitHub engineering blog post and [this](https://github.com/jspahrsummers/objc-build-scripts) repository from [jspahrsummers](https://github.com/jspahrsummers). 6 | 7 | This scripts assume that you are using `xcodebuild` to build the project. 8 | 9 | ## Installation 10 | 11 | To install the scripts into any iOS project you just need to run the install script (no pound intended :wink:) 12 | 13 | ``` 14 | git clone git@github.com:guidomb/ios-scripts.git 15 | cd ios-scripts 16 | ./install PATH_TO_IOS_PROJECT_FOLDER 17 | ``` 18 | 19 | The first time you run this script you would probably want to generate .env file that is needed for the scripts to work. 20 | 21 | ### Batch install 22 | 23 | If you have more than one project that is using the build scripts it might be bummer to update your build scripts everytime a new version is released. That is why it is recommended to use the batch install option. All you need to do is add a `.installrc` file (which is git ignored) in the `ios-scripts` root directory. This file should contain full paths to 24 | the projects that are using the build scripts. 25 | 26 | For example if you add a `.installrc` file with the following content: 27 | 28 | ``` 29 | /Users/guidomb/Documents/Projects/MyFirstProject 30 | /Users/guidomb/Documents/Projects/MySecondProject 31 | /Users/guidomb/Documents/Projects/MyThirdProject 32 | ``` 33 | 34 | and then run `.install`, the install script will install the builds script for each of the listed project. Which is the same as running 35 | 36 | ``` 37 | ./install /Users/guidomb/Documents/Projects/MyFirstProject 38 | ./install /Users/guidomb/Documents/Projects/MySecondProject 39 | ./install /Users/guidomb/Documents/Projects/MyThirdProject 40 | ``` 41 | 42 | Keep in mind that this only works for projects that have already installed the build scripts. 43 | 44 | ### Carthage users 45 | 46 | If you use Carthage you can specify the required carthage version by your project in `script/.env` by setting the `REQUIRED_CARTHAGE_VERSION` variable. 47 | 48 | All build script will check if the Carthage version matches the required version. If that is not the case the scripts will fail. 49 | 50 | When running `script/bootstrap` you can force the script to install the desired version of Carthage (pointed by `REQUIRED_CARTHAGE_VERSION`) using the environmental variable `FORCE_CARTHAGE_VERSION` or not updating Carthage 51 | (and fail) if the installed version does not match the desired one by using 52 | `NO_CARTHAGE_UPDATE`. 53 | 54 | If you are running on Travis CI (or any other CI services that already has Carthage installed) you probably want to use `FORCE_CARTHAGE_VERSION`. 55 | 56 | #### Carthage cache 57 | 58 | If [CarthageCache](https://github.com/guidomb/carthage_cache) is installed 59 | using Bundler, then the bootstrap and update script will try to use the cache. You can disable carthage cache for a specific run by setting the 60 | `DISABLE_CARTHAGE_CACHE` environmental variable. 61 | 62 | The bootstrap script will also try to generate the `.carthage_cache.yml` 63 | if it doesn't exist. Keep in mind that `.carthage_cache.yml` should be 64 | git ignored. You can avoid generating the configuration file by setting 65 | the `DISABLE_CARTHAGE_CACHE_CONFIG` environmental variable. 66 | 67 | In a CI environment, like Travis CI, it is recommended to configure 68 | carthage cache using environmental variables. If you want to change the 69 | bucket name you can set the `CARTHAGE_CACHE_BUCKET_NAME` variable. Which 70 | will pass the value of that variable to carthage cache's `--bucket-name` 71 | flag. 72 | 73 | #### Code signing certificates 74 | 75 | Because Carthage builds all the dependencies and generates a fat `.framework` with binaries for all the possible architectures (iWatch, iPhone, simulator). It needs to sign the artifacts using a code signing certificate. Code signing is not necessary if the dependency is properly configured not to code sign for 76 | simulator architectures. But some dependency are not properly configured and you 77 | will need to code sign even for simulator architectures. 78 | 79 | In such case you need to provide a `.p12` file with a development certificate and store them in `script/certificates/cibot.p12`. You will also need to provide the passphrase for the certificate in the environmental variable `KEY_PASSWORD`. 80 | 81 | #### GitHub API rate limit 82 | 83 | If you are using Carthage in a machine with a shared public IP, like in Travis CI, you are sharing 84 | the GitHub rate limit quota with the rest of the clients. Because Carthage uses the GitHub API 85 | this could be a problem. That is why is recommended in such environments to use your own access token. 86 | 87 | To tell Carthage to use your own access token and in order for the bootstrap script to install the custom version of Carthage you need to define the environmental variable `GITHUB_ACCESS_TOKEN`. 88 | 89 | ### Project configuration 90 | 91 | All the scripts are smart enough to detect if you are using Carthage or Cocoapods and tune their behavior to use the workflow that best suites the underlaying dependency management tool. 92 | 93 | #### Project schemes 94 | 95 | Both the `test` and `build` scripts need to know the schemes that are going to be built by `xcodebuild`. The scripts try to automatically infer the schemes by parsing the output from `xcodebuild -list` but sometimes it may not work (most likely when using Cocoapods) or you may want to customize it. You can do so by changing the `schemes` function in `script/script_hooks/schemes`. 96 | 97 | Lets say you want to build and test only for `MyScheme1` and `MyScheme2`. Then you must implement the `schemes` function like this: 98 | 99 | ```bash 100 | schemes () 101 | { 102 | echo "MyScheme1 MyScheme2" 103 | } 104 | ``` 105 | 106 | Or you can override this by defining the variable `SCHEME` like this 107 | 108 | ```bash 109 | SCHEME=MyScheme ./script/cibuild 110 | ``` 111 | 112 | #### xcodebuild `-destination` parameter 113 | 114 | In order to run your test, `xcodebuild` needs an extra parameter to specify where. 115 | The scripts pick the correct destination using the scheme name using the following pattern (case insensitive) 116 | 117 | * `*-iOS`: for iOS 118 | * `*-OSX`: for OSX targets 119 | > If the scheme name does not match any of these, iOS destination will be used by default. 120 | 121 | These are the default values for each platform 122 | 123 | * iOS: `'platform=iOS Simulator,name=iPhone 6,OS=latest'` 124 | * OSX: `'platform=OS X'` 125 | 126 | For iOS you can change the name of the simulator or the OS version it should emulate. 127 | To use a different emulator just define the variable `IOS_DESTINATION_SIMULATOR_NAME` with the name of the simulator to use 128 | 129 | ```bash 130 | IOS_DESTINATION_SIMULATOR_NAME="iPhone 6s Plus" script/cibuild 131 | ``` 132 | > For all possible names, just run `xcrun simctl list devicetypes` 133 | 134 | To use a different OS just define the variable `IOS_DESTINATION_VERSION` with the OS version to use 135 | 136 | ```bash 137 | IOS_DESTINATION_VERSION="9.0" script/cibuild 138 | ``` 139 | 140 | #### Git hooks 141 | 142 | The install script will prompt you if you want to install git hooks (recommended). At the moment it will install a `pre-push` hook that will run `script/test` before pushing. 143 | 144 | ## Usage 145 | 146 | All the scripts must be run from the root folder by prefixing the `script` folder. For example if you want to bootstrap your project you should be located at the project's root folder and then run `script/bootstrap`. 147 | 148 | After installing the scripts in your iOS project you should find a `script` folder with the following scripts: 149 | 150 | ### script/bootstrap 151 | 152 | The bootstrap script should be run every time the project is cloned. This scripts checks and installs all the required dependencies required for your project. 153 | 154 | By default this script install the basic dependencies for any iOS project to work. It is smart enough the check if you are using Cocoapods or Carthage as the dependency manager. 155 | 156 | You can skip updating brew formulas by defining `SKIP_BREW_FORMULAS_UPDATE` environmental variable. For example `SKIP_BREW_FORMULAS_UPDATE=1 script/bootstrap`. Which is useful when you are running the bootstrap script 157 | several time to add or test new functionality. 158 | 159 | #### Customize bootstrap process 160 | 161 | In case you need to install more dependencies or execute some configuration script, the appropriate way to do this is by adding a bootstrap hook by creating a file `script/script_hooks/bootstrap` with the following functions 162 | 163 | ``` 164 | bootstrap_before_install_hooks () 165 | { 166 | # Code that will be executed before installing dependencies 167 | } 168 | 169 | bootstrap_before_install_hooks () 170 | { 171 | # Code that will be executed after installing dependencies 172 | } 173 | ``` 174 | 175 | For example if you need access to Ruby gems that are defined in your `Gemfile` then you should put your 176 | code inside the `bootstrap_before_install_hooks`. 177 | 178 | You can disable bootstrap hooks by defining `DISABLE_BOOTSTRAP_HOOKS` 179 | environmental variable. 180 | 181 | If your hooks need to know if they are running on CI they can check if the 182 | environmental `$RUNNING_ON_CI` is defined. 183 | 184 | #### Build configuration for Travis CI 185 | 186 | If you are using Travis CI to build and test your project you only need to tell travis to 187 | execute `script/cibuild` 188 | 189 | ```yaml 190 | language: objective-c 191 | osx_image: xcode7.2 192 | before_install: 193 | - gem install bundler 194 | script: 195 | - REPO_SLUG="$TRAVIS_REPO_SLUG" PULL_REQUEST="$TRAVIS_PULL_REQUEST" FORCE_CARTHAGE_VERSION=true script/cibuild 196 | branches: 197 | only: 198 | - master 199 | ``` 200 | 201 | Remember to export the required environmental variables using the `travis` command line tool 202 | 203 | ``` 204 | travis encrypt GITHUB_ACCESS_TOKEN=your-access-token --add env.global 205 | travis encrypt KEY_PASSWORD=dev-certificate-passphrase --add env.global 206 | travis encrypt COVERALLS_TOKEN=coveralls-repo-token --add env.global 207 | ``` 208 | 209 | ### script/build 210 | 211 | The build script just builds the project 212 | 213 | ### script/test 214 | 215 | The test script builds and run the tests. 216 | 217 | * If the project has a `.swiftlint.yml` file the [Swift linter](https://github.com/realm/SwiftLint) is run. 218 | * If the project has a `.tailor.yml` file [Tailor analyzer](https://github.com/sleekbyte/tailor) is run. 219 | * If the project uses [linterbot](https://github.com/guidomb/linterbot), the `script/test` is run on CI for a pull request and `swiftlint` is avaliable then the `linterbot` will be executed. 220 | * If the project has a `.podspec` file the Cocoapods podspec linter is run. 221 | 222 | ### script/coverage 223 | 224 | Generates code coverage data and upload it to [Coveralls](http://coveralls.io). This script is intended to be used in CI. You need to export the environmental variable `COVERALLS_TOKEN`. 225 | 226 | Swift code coverage is not supported yet. 227 | 228 | ### script/update 229 | 230 | Updates the project's dependencies using the underlaying dependency management machinery. 231 | 232 | ### script/cibuild 233 | 234 | This script must be run in the CI environment. It bootstraps the project, builds it and run the test. 235 | 236 | ### script/buildtime 237 | 238 | This script builds the project and prints the files by their build time sorted from the slowest to the fastest. It 239 | only prints that takes more than 9ms to build. 240 | 241 | ### script/clean 242 | 243 | Removes the project's derived data folder. 244 | 245 | #### Configure SwiftLint run script for CI 246 | 247 | If your project is using [SwiftLint](https://github.com/realm/SwiftLint) it is recommended to configure the run script as follow instead of how it is explained in the SwiftLint docs. 248 | 249 | ```bash 250 | if [ ! -z "$RUNNING_ON_CI" ] 251 | then 252 | echo "SwiftLint run script has been disabled" 253 | exit 0 254 | fi 255 | 256 | if which swiftlint >/dev/null; then 257 | swiftlint 258 | else 259 | echo "warning: SwiftLint not installed, download from https://github.com/realm/SwiftLint" 260 | fi 261 | ``` 262 | 263 | This allows disabling the run script when running on CI and running the linter twice. 264 | 265 | #### Configure linterbot for CI 266 | 267 | If your project is using [SwiftLint](https://github.com/realm/SwiftLint) and [linterbot](https://github.com/guidomb/linterbot) then you need to add the following environmental variables when running `script/cibuild`: 268 | 269 | * `REPO_SLUG`: The GitHub repository slug, like `guidomb/ios-scripts`. 270 | * `PULL_REQUEST`: The pull request number to be analyzed if the current build was triggered by a pull request or `false` otherwise. 271 | 272 | Keep in mind that the linterbot also uses the enviromental variable `GITHUB_ACCESS_TOKEN` (which is also used by Carthage). The GitHub user associated with that token should have write access to the repository and is the user that will be used to comment on every linter validation in the pull request. 273 | 274 | ### General configuration variables 275 | 276 | * `VERBOSE` if you set the `VERBOSE` environmental with a value the scripts will print more information. 277 | 278 | ### Common utility scripts 279 | 280 | Common utility scripts or sets of functions that are useful but are not tied to a particular build script are available in `script/common`. 281 | 282 | * `script/common/install_carthage`: Allows to install a specific version of Carthage. 283 | * `script/common/install_swiftlint`: Allows to install a specific version of SwiftLint. 284 | * `script/common/install_tailor`: Allows to install a specific version of Tailor. 285 | 286 | ## License 287 | 288 | **ios-scripts** is available under the Apache 2.0 [license](https://raw.githubusercontent.com/guidomb/ios-scripts/master/LICENSE). 289 | 290 | Copyright 2015 Guido Marucci Blas 291 | 292 | Licensed under the Apache License, Version 2.0 (the "License"); 293 | you may not use this file except in compliance with the License. 294 | You may obtain a copy of the License at 295 | 296 | http://www.apache.org/licenses/LICENSE-2.0 297 | 298 | Unless required by applicable law or agreed to in writing, software 299 | distributed under the License is distributed on an "AS IS" BASIS, 300 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 301 | See the License for the specific language governing permissions and 302 | limitations under the License. 303 | -------------------------------------------------------------------------------- /tests/carthage/iOSScriptsCarthage.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 5F4D27A11BCF48E6003C27B3 /* Result.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 5F4D27A01BCF48E6003C27B3 /* Result.framework */; settings = {ASSET_TAGS = (); }; }; 11 | 9DEC355D1BAB737B00729239 /* iOSScriptsCarthage.h in Headers */ = {isa = PBXBuildFile; fileRef = 9DEC355C1BAB737B00729239 /* iOSScriptsCarthage.h */; settings = {ATTRIBUTES = (Public, ); }; }; 12 | 9DEC35631BAB737B00729239 /* ScriptsCarthage.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9DEC35571BAB737B00729239 /* ScriptsCarthage.framework */; }; 13 | 9DEC35791BAB759500729239 /* Nimble.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9DEC35771BAB759500729239 /* Nimble.framework */; }; 14 | 9DEC357A1BAB759500729239 /* Quick.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9DEC35781BAB759500729239 /* Quick.framework */; }; 15 | 9DEC357D1BAB75C500729239 /* GreeterTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9DEC357C1BAB75C500729239 /* GreeterTests.swift */; }; 16 | 9DEC357F1BAB764400729239 /* Greeter.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9DEC357E1BAB764400729239 /* Greeter.swift */; }; 17 | /* End PBXBuildFile section */ 18 | 19 | /* Begin PBXContainerItemProxy section */ 20 | 9DEC35641BAB737B00729239 /* PBXContainerItemProxy */ = { 21 | isa = PBXContainerItemProxy; 22 | containerPortal = 9DEC354E1BAB737B00729239 /* Project object */; 23 | proxyType = 1; 24 | remoteGlobalIDString = 9DEC35561BAB737B00729239; 25 | remoteInfo = iOSScriptsCarthage; 26 | }; 27 | /* End PBXContainerItemProxy section */ 28 | 29 | /* Begin PBXFileReference section */ 30 | 5F4D27A01BCF48E6003C27B3 /* Result.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Result.framework; path = Carthage/Build/iOS/Result.framework; sourceTree = ""; }; 31 | 9DEC35571BAB737B00729239 /* ScriptsCarthage.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = ScriptsCarthage.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 32 | 9DEC355B1BAB737B00729239 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 33 | 9DEC355C1BAB737B00729239 /* iOSScriptsCarthage.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = iOSScriptsCarthage.h; sourceTree = ""; }; 34 | 9DEC35621BAB737B00729239 /* ScriptsCarthageTests-iOS.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "ScriptsCarthageTests-iOS.xctest"; sourceTree = BUILT_PRODUCTS_DIR; }; 35 | 9DEC35681BAB737B00729239 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 36 | 9DEC35771BAB759500729239 /* Nimble.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Nimble.framework; path = Carthage/Build/iOS/Nimble.framework; sourceTree = ""; }; 37 | 9DEC35781BAB759500729239 /* Quick.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Quick.framework; path = Carthage/Build/iOS/Quick.framework; sourceTree = ""; }; 38 | 9DEC357B1BAB75C400729239 /* iOSScriptsCarthageTests-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "iOSScriptsCarthageTests-Bridging-Header.h"; sourceTree = ""; }; 39 | 9DEC357C1BAB75C500729239 /* GreeterTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = GreeterTests.swift; sourceTree = ""; }; 40 | 9DEC357E1BAB764400729239 /* Greeter.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Greeter.swift; sourceTree = ""; }; 41 | /* End PBXFileReference section */ 42 | 43 | /* Begin PBXFrameworksBuildPhase section */ 44 | 9DEC35531BAB737B00729239 /* Frameworks */ = { 45 | isa = PBXFrameworksBuildPhase; 46 | buildActionMask = 2147483647; 47 | files = ( 48 | 5F4D27A11BCF48E6003C27B3 /* Result.framework in Frameworks */, 49 | ); 50 | runOnlyForDeploymentPostprocessing = 0; 51 | }; 52 | 9DEC355F1BAB737B00729239 /* Frameworks */ = { 53 | isa = PBXFrameworksBuildPhase; 54 | buildActionMask = 2147483647; 55 | files = ( 56 | 9DEC35791BAB759500729239 /* Nimble.framework in Frameworks */, 57 | 9DEC357A1BAB759500729239 /* Quick.framework in Frameworks */, 58 | 9DEC35631BAB737B00729239 /* ScriptsCarthage.framework in Frameworks */, 59 | ); 60 | runOnlyForDeploymentPostprocessing = 0; 61 | }; 62 | /* End PBXFrameworksBuildPhase section */ 63 | 64 | /* Begin PBXGroup section */ 65 | 5F51D71B1BCDB83C00613162 /* Frameworks */ = { 66 | isa = PBXGroup; 67 | children = ( 68 | 5F51D71C1BCDB84900613162 /* iOS */, 69 | ); 70 | name = Frameworks; 71 | sourceTree = ""; 72 | }; 73 | 5F51D71C1BCDB84900613162 /* iOS */ = { 74 | isa = PBXGroup; 75 | children = ( 76 | 5F4D27A01BCF48E6003C27B3 /* Result.framework */, 77 | 9DEC35771BAB759500729239 /* Nimble.framework */, 78 | 9DEC35781BAB759500729239 /* Quick.framework */, 79 | ); 80 | name = iOS; 81 | sourceTree = ""; 82 | }; 83 | 9DEC354D1BAB737B00729239 = { 84 | isa = PBXGroup; 85 | children = ( 86 | 5F51D71B1BCDB83C00613162 /* Frameworks */, 87 | 9DEC35591BAB737B00729239 /* iOSScriptsCarthage */, 88 | 9DEC35661BAB737B00729239 /* iOSScriptsCarthageTests */, 89 | 9DEC35581BAB737B00729239 /* Products */, 90 | ); 91 | sourceTree = ""; 92 | }; 93 | 9DEC35581BAB737B00729239 /* Products */ = { 94 | isa = PBXGroup; 95 | children = ( 96 | 9DEC35571BAB737B00729239 /* ScriptsCarthage.framework */, 97 | 9DEC35621BAB737B00729239 /* ScriptsCarthageTests-iOS.xctest */, 98 | ); 99 | name = Products; 100 | sourceTree = ""; 101 | }; 102 | 9DEC35591BAB737B00729239 /* iOSScriptsCarthage */ = { 103 | isa = PBXGroup; 104 | children = ( 105 | 9DEC355C1BAB737B00729239 /* iOSScriptsCarthage.h */, 106 | 9DEC355A1BAB737B00729239 /* Supporting Files */, 107 | 9DEC357E1BAB764400729239 /* Greeter.swift */, 108 | ); 109 | path = iOSScriptsCarthage; 110 | sourceTree = ""; 111 | }; 112 | 9DEC355A1BAB737B00729239 /* Supporting Files */ = { 113 | isa = PBXGroup; 114 | children = ( 115 | 9DEC355B1BAB737B00729239 /* Info.plist */, 116 | ); 117 | name = "Supporting Files"; 118 | sourceTree = ""; 119 | }; 120 | 9DEC35661BAB737B00729239 /* iOSScriptsCarthageTests */ = { 121 | isa = PBXGroup; 122 | children = ( 123 | 9DEC35671BAB737B00729239 /* Supporting Files */, 124 | 9DEC357C1BAB75C500729239 /* GreeterTests.swift */, 125 | 9DEC357B1BAB75C400729239 /* iOSScriptsCarthageTests-Bridging-Header.h */, 126 | ); 127 | path = iOSScriptsCarthageTests; 128 | sourceTree = ""; 129 | }; 130 | 9DEC35671BAB737B00729239 /* Supporting Files */ = { 131 | isa = PBXGroup; 132 | children = ( 133 | 9DEC35681BAB737B00729239 /* Info.plist */, 134 | ); 135 | name = "Supporting Files"; 136 | sourceTree = ""; 137 | }; 138 | /* End PBXGroup section */ 139 | 140 | /* Begin PBXHeadersBuildPhase section */ 141 | 9DEC35541BAB737B00729239 /* Headers */ = { 142 | isa = PBXHeadersBuildPhase; 143 | buildActionMask = 2147483647; 144 | files = ( 145 | 9DEC355D1BAB737B00729239 /* iOSScriptsCarthage.h in Headers */, 146 | ); 147 | runOnlyForDeploymentPostprocessing = 0; 148 | }; 149 | /* End PBXHeadersBuildPhase section */ 150 | 151 | /* Begin PBXNativeTarget section */ 152 | 9DEC35561BAB737B00729239 /* ScriptsCarthage-iOS */ = { 153 | isa = PBXNativeTarget; 154 | buildConfigurationList = 9DEC356D1BAB737B00729239 /* Build configuration list for PBXNativeTarget "ScriptsCarthage-iOS" */; 155 | buildPhases = ( 156 | 9DEC35521BAB737B00729239 /* Sources */, 157 | 9DEC35531BAB737B00729239 /* Frameworks */, 158 | 9DEC35541BAB737B00729239 /* Headers */, 159 | 9DEC35551BAB737B00729239 /* Resources */, 160 | ); 161 | buildRules = ( 162 | ); 163 | dependencies = ( 164 | ); 165 | name = "ScriptsCarthage-iOS"; 166 | productName = iOSScriptsCarthage; 167 | productReference = 9DEC35571BAB737B00729239 /* ScriptsCarthage.framework */; 168 | productType = "com.apple.product-type.framework"; 169 | }; 170 | 9DEC35611BAB737B00729239 /* ScriptsCarthageTests-iOS */ = { 171 | isa = PBXNativeTarget; 172 | buildConfigurationList = 9DEC35701BAB737B00729239 /* Build configuration list for PBXNativeTarget "ScriptsCarthageTests-iOS" */; 173 | buildPhases = ( 174 | 9DEC355E1BAB737B00729239 /* Sources */, 175 | 9DEC355F1BAB737B00729239 /* Frameworks */, 176 | 9DEC35601BAB737B00729239 /* Resources */, 177 | 9DEC35801BAB77D400729239 /* Carthage */, 178 | ); 179 | buildRules = ( 180 | ); 181 | dependencies = ( 182 | 9DEC35651BAB737B00729239 /* PBXTargetDependency */, 183 | ); 184 | name = "ScriptsCarthageTests-iOS"; 185 | productName = iOSScriptsCarthageTests; 186 | productReference = 9DEC35621BAB737B00729239 /* ScriptsCarthageTests-iOS.xctest */; 187 | productType = "com.apple.product-type.bundle.unit-test"; 188 | }; 189 | /* End PBXNativeTarget section */ 190 | 191 | /* Begin PBXProject section */ 192 | 9DEC354E1BAB737B00729239 /* Project object */ = { 193 | isa = PBXProject; 194 | attributes = { 195 | LastSwiftUpdateCheck = 0700; 196 | LastUpgradeCheck = 0700; 197 | ORGANIZATIONNAME = guidomb; 198 | TargetAttributes = { 199 | 9DEC35561BAB737B00729239 = { 200 | CreatedOnToolsVersion = 6.4; 201 | }; 202 | 9DEC35611BAB737B00729239 = { 203 | CreatedOnToolsVersion = 6.4; 204 | }; 205 | }; 206 | }; 207 | buildConfigurationList = 9DEC35511BAB737B00729239 /* Build configuration list for PBXProject "iOSScriptsCarthage" */; 208 | compatibilityVersion = "Xcode 3.2"; 209 | developmentRegion = English; 210 | hasScannedForEncodings = 0; 211 | knownRegions = ( 212 | en, 213 | ); 214 | mainGroup = 9DEC354D1BAB737B00729239; 215 | productRefGroup = 9DEC35581BAB737B00729239 /* Products */; 216 | projectDirPath = ""; 217 | projectRoot = ""; 218 | targets = ( 219 | 9DEC35561BAB737B00729239 /* ScriptsCarthage-iOS */, 220 | 9DEC35611BAB737B00729239 /* ScriptsCarthageTests-iOS */, 221 | ); 222 | }; 223 | /* End PBXProject section */ 224 | 225 | /* Begin PBXResourcesBuildPhase section */ 226 | 9DEC35551BAB737B00729239 /* Resources */ = { 227 | isa = PBXResourcesBuildPhase; 228 | buildActionMask = 2147483647; 229 | files = ( 230 | ); 231 | runOnlyForDeploymentPostprocessing = 0; 232 | }; 233 | 9DEC35601BAB737B00729239 /* Resources */ = { 234 | isa = PBXResourcesBuildPhase; 235 | buildActionMask = 2147483647; 236 | files = ( 237 | ); 238 | runOnlyForDeploymentPostprocessing = 0; 239 | }; 240 | /* End PBXResourcesBuildPhase section */ 241 | 242 | /* Begin PBXShellScriptBuildPhase section */ 243 | 9DEC35801BAB77D400729239 /* Carthage */ = { 244 | isa = PBXShellScriptBuildPhase; 245 | buildActionMask = 2147483647; 246 | files = ( 247 | ); 248 | inputPaths = ( 249 | "$(SRCROOT)/Carthage/Build/iOS/Result.framework", 250 | "$(SRCROOT)/Carthage/Build/iOS/Quick.framework", 251 | "$(SRCROOT)/Carthage/Build/iOS/Nimble.framework", 252 | ); 253 | name = Carthage; 254 | outputPaths = ( 255 | ); 256 | runOnlyForDeploymentPostprocessing = 0; 257 | shellPath = /bin/sh; 258 | shellScript = "/usr/local/bin/carthage copy-frameworks"; 259 | }; 260 | /* End PBXShellScriptBuildPhase section */ 261 | 262 | /* Begin PBXSourcesBuildPhase section */ 263 | 9DEC35521BAB737B00729239 /* Sources */ = { 264 | isa = PBXSourcesBuildPhase; 265 | buildActionMask = 2147483647; 266 | files = ( 267 | 9DEC357F1BAB764400729239 /* Greeter.swift in Sources */, 268 | ); 269 | runOnlyForDeploymentPostprocessing = 0; 270 | }; 271 | 9DEC355E1BAB737B00729239 /* Sources */ = { 272 | isa = PBXSourcesBuildPhase; 273 | buildActionMask = 2147483647; 274 | files = ( 275 | 9DEC357D1BAB75C500729239 /* GreeterTests.swift in Sources */, 276 | ); 277 | runOnlyForDeploymentPostprocessing = 0; 278 | }; 279 | /* End PBXSourcesBuildPhase section */ 280 | 281 | /* Begin PBXTargetDependency section */ 282 | 9DEC35651BAB737B00729239 /* PBXTargetDependency */ = { 283 | isa = PBXTargetDependency; 284 | target = 9DEC35561BAB737B00729239 /* ScriptsCarthage-iOS */; 285 | targetProxy = 9DEC35641BAB737B00729239 /* PBXContainerItemProxy */; 286 | }; 287 | /* End PBXTargetDependency section */ 288 | 289 | /* Begin XCBuildConfiguration section */ 290 | 9DEC356B1BAB737B00729239 /* Debug */ = { 291 | isa = XCBuildConfiguration; 292 | buildSettings = { 293 | ALWAYS_SEARCH_USER_PATHS = NO; 294 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 295 | CLANG_CXX_LIBRARY = "libc++"; 296 | CLANG_ENABLE_MODULES = YES; 297 | CLANG_ENABLE_OBJC_ARC = YES; 298 | CLANG_WARN_BOOL_CONVERSION = YES; 299 | CLANG_WARN_CONSTANT_CONVERSION = YES; 300 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 301 | CLANG_WARN_EMPTY_BODY = YES; 302 | CLANG_WARN_ENUM_CONVERSION = YES; 303 | CLANG_WARN_INT_CONVERSION = YES; 304 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 305 | CLANG_WARN_UNREACHABLE_CODE = YES; 306 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 307 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 308 | COPY_PHASE_STRIP = NO; 309 | CURRENT_PROJECT_VERSION = 1; 310 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 311 | ENABLE_STRICT_OBJC_MSGSEND = YES; 312 | ENABLE_TESTABILITY = YES; 313 | GCC_C_LANGUAGE_STANDARD = gnu99; 314 | GCC_DYNAMIC_NO_PIC = NO; 315 | GCC_NO_COMMON_BLOCKS = YES; 316 | GCC_OPTIMIZATION_LEVEL = 0; 317 | GCC_PREPROCESSOR_DEFINITIONS = ( 318 | "DEBUG=1", 319 | "$(inherited)", 320 | ); 321 | GCC_SYMBOLS_PRIVATE_EXTERN = NO; 322 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 323 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 324 | GCC_WARN_UNDECLARED_SELECTOR = YES; 325 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 326 | GCC_WARN_UNUSED_FUNCTION = YES; 327 | GCC_WARN_UNUSED_VARIABLE = YES; 328 | IPHONEOS_DEPLOYMENT_TARGET = 8.4; 329 | MTL_ENABLE_DEBUG_INFO = YES; 330 | ONLY_ACTIVE_ARCH = YES; 331 | SDKROOT = iphoneos; 332 | TARGETED_DEVICE_FAMILY = "1,2"; 333 | VERSIONING_SYSTEM = "apple-generic"; 334 | VERSION_INFO_PREFIX = ""; 335 | }; 336 | name = Debug; 337 | }; 338 | 9DEC356C1BAB737B00729239 /* Release */ = { 339 | isa = XCBuildConfiguration; 340 | buildSettings = { 341 | ALWAYS_SEARCH_USER_PATHS = NO; 342 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 343 | CLANG_CXX_LIBRARY = "libc++"; 344 | CLANG_ENABLE_MODULES = YES; 345 | CLANG_ENABLE_OBJC_ARC = YES; 346 | CLANG_WARN_BOOL_CONVERSION = YES; 347 | CLANG_WARN_CONSTANT_CONVERSION = YES; 348 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 349 | CLANG_WARN_EMPTY_BODY = YES; 350 | CLANG_WARN_ENUM_CONVERSION = YES; 351 | CLANG_WARN_INT_CONVERSION = YES; 352 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 353 | CLANG_WARN_UNREACHABLE_CODE = YES; 354 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 355 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 356 | COPY_PHASE_STRIP = NO; 357 | CURRENT_PROJECT_VERSION = 1; 358 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 359 | ENABLE_NS_ASSERTIONS = NO; 360 | ENABLE_STRICT_OBJC_MSGSEND = YES; 361 | GCC_C_LANGUAGE_STANDARD = gnu99; 362 | GCC_NO_COMMON_BLOCKS = YES; 363 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 364 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 365 | GCC_WARN_UNDECLARED_SELECTOR = YES; 366 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 367 | GCC_WARN_UNUSED_FUNCTION = YES; 368 | GCC_WARN_UNUSED_VARIABLE = YES; 369 | IPHONEOS_DEPLOYMENT_TARGET = 8.4; 370 | MTL_ENABLE_DEBUG_INFO = NO; 371 | SDKROOT = iphoneos; 372 | TARGETED_DEVICE_FAMILY = "1,2"; 373 | VALIDATE_PRODUCT = YES; 374 | VERSIONING_SYSTEM = "apple-generic"; 375 | VERSION_INFO_PREFIX = ""; 376 | }; 377 | name = Release; 378 | }; 379 | 9DEC356E1BAB737B00729239 /* Debug */ = { 380 | isa = XCBuildConfiguration; 381 | buildSettings = { 382 | CLANG_ENABLE_MODULES = YES; 383 | DEFINES_MODULE = YES; 384 | DYLIB_COMPATIBILITY_VERSION = 1; 385 | DYLIB_CURRENT_VERSION = 1; 386 | DYLIB_INSTALL_NAME_BASE = "@rpath"; 387 | FRAMEWORK_SEARCH_PATHS = ( 388 | "$(inherited)", 389 | "$(PROJECT_DIR)/Carthage/Build/iOS", 390 | ); 391 | INFOPLIST_FILE = iOSScriptsCarthage/Info.plist; 392 | INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; 393 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 394 | PRODUCT_BUNDLE_IDENTIFIER = "me.guidomb.$(PRODUCT_NAME:rfc1034identifier)"; 395 | PRODUCT_NAME = ScriptsCarthage; 396 | SKIP_INSTALL = YES; 397 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 398 | }; 399 | name = Debug; 400 | }; 401 | 9DEC356F1BAB737B00729239 /* Release */ = { 402 | isa = XCBuildConfiguration; 403 | buildSettings = { 404 | CLANG_ENABLE_MODULES = YES; 405 | DEFINES_MODULE = YES; 406 | DYLIB_COMPATIBILITY_VERSION = 1; 407 | DYLIB_CURRENT_VERSION = 1; 408 | DYLIB_INSTALL_NAME_BASE = "@rpath"; 409 | FRAMEWORK_SEARCH_PATHS = ( 410 | "$(inherited)", 411 | "$(PROJECT_DIR)/Carthage/Build/iOS", 412 | ); 413 | INFOPLIST_FILE = iOSScriptsCarthage/Info.plist; 414 | INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; 415 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 416 | PRODUCT_BUNDLE_IDENTIFIER = "me.guidomb.$(PRODUCT_NAME:rfc1034identifier)"; 417 | PRODUCT_NAME = ScriptsCarthage; 418 | SKIP_INSTALL = YES; 419 | }; 420 | name = Release; 421 | }; 422 | 9DEC35711BAB737B00729239 /* Debug */ = { 423 | isa = XCBuildConfiguration; 424 | buildSettings = { 425 | CLANG_ENABLE_MODULES = YES; 426 | FRAMEWORK_SEARCH_PATHS = ( 427 | "$(inherited)", 428 | "$(PROJECT_DIR)/Carthage/Build/iOS", 429 | ); 430 | GCC_PREPROCESSOR_DEFINITIONS = ( 431 | "DEBUG=1", 432 | "$(inherited)", 433 | ); 434 | INFOPLIST_FILE = iOSScriptsCarthageTests/Info.plist; 435 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 436 | PRODUCT_BUNDLE_IDENTIFIER = "me.guidomb.$(PRODUCT_NAME:rfc1034identifier)"; 437 | PRODUCT_NAME = "$(TARGET_NAME)"; 438 | SWIFT_OBJC_BRIDGING_HEADER = "iOSScriptsCarthageTests/iOSScriptsCarthageTests-Bridging-Header.h"; 439 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 440 | }; 441 | name = Debug; 442 | }; 443 | 9DEC35721BAB737B00729239 /* Release */ = { 444 | isa = XCBuildConfiguration; 445 | buildSettings = { 446 | CLANG_ENABLE_MODULES = YES; 447 | FRAMEWORK_SEARCH_PATHS = ( 448 | "$(inherited)", 449 | "$(PROJECT_DIR)/Carthage/Build/iOS", 450 | ); 451 | INFOPLIST_FILE = iOSScriptsCarthageTests/Info.plist; 452 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 453 | PRODUCT_BUNDLE_IDENTIFIER = "me.guidomb.$(PRODUCT_NAME:rfc1034identifier)"; 454 | PRODUCT_NAME = "$(TARGET_NAME)"; 455 | SWIFT_OBJC_BRIDGING_HEADER = "iOSScriptsCarthageTests/iOSScriptsCarthageTests-Bridging-Header.h"; 456 | }; 457 | name = Release; 458 | }; 459 | /* End XCBuildConfiguration section */ 460 | 461 | /* Begin XCConfigurationList section */ 462 | 9DEC35511BAB737B00729239 /* Build configuration list for PBXProject "iOSScriptsCarthage" */ = { 463 | isa = XCConfigurationList; 464 | buildConfigurations = ( 465 | 9DEC356B1BAB737B00729239 /* Debug */, 466 | 9DEC356C1BAB737B00729239 /* Release */, 467 | ); 468 | defaultConfigurationIsVisible = 0; 469 | defaultConfigurationName = Release; 470 | }; 471 | 9DEC356D1BAB737B00729239 /* Build configuration list for PBXNativeTarget "ScriptsCarthage-iOS" */ = { 472 | isa = XCConfigurationList; 473 | buildConfigurations = ( 474 | 9DEC356E1BAB737B00729239 /* Debug */, 475 | 9DEC356F1BAB737B00729239 /* Release */, 476 | ); 477 | defaultConfigurationIsVisible = 0; 478 | defaultConfigurationName = Release; 479 | }; 480 | 9DEC35701BAB737B00729239 /* Build configuration list for PBXNativeTarget "ScriptsCarthageTests-iOS" */ = { 481 | isa = XCConfigurationList; 482 | buildConfigurations = ( 483 | 9DEC35711BAB737B00729239 /* Debug */, 484 | 9DEC35721BAB737B00729239 /* Release */, 485 | ); 486 | defaultConfigurationIsVisible = 0; 487 | defaultConfigurationName = Release; 488 | }; 489 | /* End XCConfigurationList section */ 490 | }; 491 | rootObject = 9DEC354E1BAB737B00729239 /* Project object */; 492 | } 493 | --------------------------------------------------------------------------------