I was trying to get some logic to work in a PreBuild script whether the build is a development build or not using the define symbol #DEVELOPMENT_BUILD. It works in regular scripts, but apparently it doesn’t work for PreBuild scripts because the symbol won’t be defined until the build actually starts. So the #DEVELOPMENT_BUILD never actually hits even though you have “Development Build” checked in the Build Settings.
To check whether or not your build is a development build use:
var isDev = (report.summary.options & BuildOptions.Development) != 0;
In the PreBuild script it would look like this:
public void OnPreprocessBuild(BuildReport report) { var isDev = (report.summary.options & BuildOptions.Development) != 0; if (isDev) { // Is development build } else { // Normal build } }
Source: https://qiita.com/Clpsplug/items/c34e8f596e54444623ba
Related Posts
December 19, 2011
Learning ROILA
The RObot Interaction Language (ROILA) is a new spoken language that is optimized for the communication between machines and humans
May 3, 2011
Project Blender – Day1: Color of Death
January 30, 2014
[FIX] Scaling Smart Objects With Nearest Neighbor in Photoshop
How to use Nearest Neighbor interpolation to free transform Smart Objects in Photoshop
November 7, 2011
[How] Premiere: Avi File; No Video, Only Audio
How to fix no video when importing AVI with Premiere