Skip to content
Zachary Orr edited this page Mar 13, 2019 · 20 revisions

To develop for The Blue Alliance for iOS, you will need a machine running macOS.

Install Build Tool Dependencies

The commands below suggest Homebrew to install the dependencies.

Automatically

All build tool dependencies can be installed automatically - this includes Xcode, from the Mac App Store.

$ brew bundle

Afterwards, you will need to manually install the Xcode Command Line Tools

$ xcode-select --install

Manually

  1. Install Xcode
    • The Blue Alliance for iOS is written in Swift 4.2, which comes with Xcode 10+
  2. Install the Xcode command line tools
    • xcode-select --install
    • Or, open Xcode, go to Preferences -> Locations -> Command Line Tools, and select your version of Xcode
  3. Install Ruby (if it's not already installed on your system) and Bundler
    • brew install ruby
    • gem install bundler
  4. Install Node/npm
    • brew install node

Install Project Dependencies

These should be done after you've cloned the project and navigated to the project directory

Automatically

$ bundle install
$ bundle exec fastlane install_deps

Manually

  1. Install React Native dependencies
    • npm install --prefix subtrees/the-blue-alliance-react
  2. Install Ruby dependencies
    • bundle install
  3. Install Cocoapods dependencies
    • bundle exec pod install --repo-update

Setup TBA API

The Blue Alliance's mobile apps depend on The Blue Alliance's API for providing data. You'll need an API key to develop with when testing/building.

  1. Navigate to The Blue Alliance's Account page (sign in if prompted)
  2. Scroll down to Read API Keys
  3. Enter a locally namespaced description (ex: zach-tba-ios-dev)
  4. Click + Add New Key to generate a new API key

We'll use this key in the Setup Secrets step when setting up local secrets in the The Blue Alliance for iOS project.

Setup Secrets

The Blue Alliance for iOS stores secrets locally in a Secrets.plist file, which is loaded dynamically at runtime as a dictionary to be used in the app. Create a Secrets.plist file from the template mock-Secrets.plist

$ cp mock-Secrets.plist the-blue-alliance-ios/Secrets.plist

If linked properly, the Secrets.plist file in the Xcode project navigation should go from being red to being black. Edit Secrets.plist (either in Xcode or in a text editor) and fill out the secret values. tba_api_key should be the TBA API key you generated in the Setup TBA API step.

Building in Xcode

  1. Be sure you have all required build tools, as described in the Install Build Tool Dependencies section
  2. Install project dependencies, as described in the Install Project Dependencies section
  3. Setup your Secrets.plist file, as described in the Setup Secrets section
  4. Open the workspace file (the-blue-alliance-ios.xcworkspace)
  5. Build and run The Blue Alliance for iOS!

Updating Your Environment

If you have a local copy of the repo but haven't work on it in a while, updating to the latest codebase is fairly straightforward

$ git pull
$ bundle exec fastlane install_deps
Clone this wiki locally