Code Monkey home page Code Monkey logo

firebase-unity-sdk's Introduction

Firebase Unity


Getting Started

You can clone the repo with the following command:

git clone https://github.com/firebase/firebase-unity-sdk.git

Prerequisites

The prerequisites for firebase cpp are required. Please install the following packages outlined in README.md for firebase cpp.

The following prerequisites are required for all platforms. Be sure to add any directories to your PATH as needed.

  • CMake version 3.13.3, or newer.
  • Mono version 5 or newer.
  • Unity version 5 or newer.
  • Swig3 version 3.0.6 or newer (Not version 4 though).

Prerequisites for Windows

On windows, to work around path length issues with google unity resolver enable long path support in git:

git config --system core.longpaths true

Prerequisites for Mac

Home brew can be used to install required dependencies:

# https://github.com/protocolbuffers/protobuf/blob/master/kokoro/macos/prepare_build_macos_rc#L20
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
source $HOME/.rvm/scripts/rvm
brew install cmake protobuf python2 mono swig@3
sudo chown -R $(whoami) /usr/local

export PATH="/usr/local/opt/swig@3/bin:$PATH"

Building

The build uses CMake to generate the necessary build files, and supports out of source builds.

The following CMake options are avaliable:

  • FIREBASE_INCLUDE_UNITY: Build for unity only (no mono support)
  • FIREBASE_INCLUDE_MONO: Build for mono only (no unity support)
  • FIREBASE_UNI_LIBRARY: Build all native modules as one dynamic lib
  • FIREBASE_CPP_SDK_DIR: Local path to firebase cpp
  • FIREBASE_UNITY_SDK_VERSION: Set version string of firebase unity package
  • UNITY_ROOT_DIR: Local path to Unity's installation directory (path should end with version number)
  • MONO_DIR: Local path to mono's xbuild executable directory
  • OPENSSL_ROOT_DIR: Open ssl root directory
  • PROTOBUF_SRC_ROOT_FOLDER: Protobuf root directory

Note:
   UNITY_ROOT_DIR is a recommended setting for building unity, else CMake will make an effort to auto find unity.

Note:
   On windows, MONO_DIR is a required setting.

Example build command for linux:

mkdir build && cd build
cmake .. -DFIREBASE_INCLUDE_MONO=ON -DFIREBASE_CPP_SDK_DIR=../../firebase-cpp-sdk
make -j 8

Note:
   There are build helper scripts in the root folder that will build the most common variants and can be used as examples on how to build firebase unity.

Building for iOS

CMake needs an extra argument specifing the tool chain to use:

-DCMAKE_TOOLCHAIN_FILE=../cmake/unity_ios.cmake -G Xcode

Building for Android

Run script ./build_android.sh on linux machine.

Unity Package Command

CPack is used to generate platform zip files with the same folder structure of the Unity plugin. Once each platform zip file is built, run unity packaging tool to generate a .unitypackage file.

cd build
cpack .
cd ../unity_packer
python export_unity_package.py --config_file=exports.json --guids_file=guids.json --assets_dir=.. --assets_zip=../build/*.zip --output_dir=../build/

firebase-unity-sdk's People

Contributors

cynthiajoan avatar a-maurice avatar sunmou99 avatar vimanyu avatar chkuang-g avatar var-const avatar stephenhodgson avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.