Giter Site home page Giter Site logo

unitybuildpipeline's Introduction

A Build Pipeline for Unity using Odin Inspector

Automate multiple builds to different platforms in a friendly inspector. For developers deploying to multiple platforms wanting an advanced time-saving build pipeline. All with one scriptable object.

ExampleInspector

Example file tree produced with one scriptable object per pipeline:

  • Builds/Development Pipeline 1
    • build 01-01-2020 One run of the pipeline
      • win64 One build
      • android
      • build-log.txt
    • build 02-02-2020 ...
  • Builds/Production Pipeline 2
    • build 01-01-2020
      • win64
      • win32
      • osx
      • android

Getting started

  1. Copy the two .cs scripts into somewhere your Assets/Editor folder
  2. Create a Build Pipeline instance Assets > Create > Build Pipeline which will store all the information for one pipeline
  3. Edit the settings in the Inspector, use the tooltips provided
    1. Choose where you want builds to be saved for this pipeline relative to the project root
    2. Add the scenes you want included
    3. Choose the options you want for all builds in the overrides
    4. Add the list of platforms you want to build to in the build configs
  4. Click Build All

Tips

  • Scenes and build configurations can be deactivated
  • You can use /'s in the paths and names to add more subdirectories

Advanced Features

Callbacks & Customization

In the BuildPipelineCustomization.cs script you can add your own callbacks as well as modify the naming of your builds.

Multi-pipeline & Shortcuts

Multiple Build Pipeline instances can be created and run individually. However, a pipeline can also be added to a pipeline group. A group of pipelines can be triggered via Tools > Build Pipeline or preferably via the shortcuts defined in Edit > Shortcuts > Build. This makes the shortcuts work like events triggering a set pipelines. This grouping functionality could be used to create a development and production pipeline which are triggered together.

Logging & Progress

As Unity's UI is very unresponsive and infrequently repainted when building, the exact progress of the pipeline can be seen in a log file build-log.txt inside the output folder. The callbacks can also choose to log further details with a StreamWriter.

Command-line

A static function is provided to enable building from the command-line in batchmode. This could be used in a CI/CD script for further automation on a server. Note the argument -buildPipeline <path/to/pipeline.asset> being the desired pipeline to run. Alternatively a group can be triggered as shown using groupId as an integer 0,1,2.

#Example CMD usage
"C:\Program Files\Unity\Hub\Editor\2019.3.0f6\Editor\Unity.exe" -quit -batchmode -projectPath 
Path\To\Project -executeMethod RogerBarton.BuildPipeline.BuildAll 
-buildPipeline "Assets/Editor/Production Build Pipeline.asset" -logfile unityBuildLog.txt
#Trigger a Pipeline Group
Unity.exe ... -executeMethod RogerBarton.BuildPipeline.BuildPipelineGroup -pipelineGroup <groupId>

Sample Project

A basic sample project UnityBuildPipelineSample is available here

Tested with Odin Inspector 2.1.9 and Unity 2019.3.0f6, 2019.2.21f1, 2018.4.17f1 (LTS), 2018.3.9f1, no shortcuts in 2018.x

Known Issues

  • Currently Odin will sometimes generate errors relating to drawing the UI after a build. These have no effect and can be ignored while a solution is being found. InvalidOperationException: Stack empty. and Pop call mismatch
  • 'Try Add Current Build Settings' will fail if the project has never been built before (a build path has to be set)

Note: The Odin Inspector asset is required

unitybuildpipeline's People

Contributors

rogerbarton avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  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.