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
June 13, 2011
The Unofficial LEGO Minifigure Catalog
The LEGO Minifigure Catalog promotion video that I was making is up and running! The purpose of the video is to show how extensive the book actually is with over 3600 minifigure photographs with professional quality, interconnected metadata and theme taxonomy.
April 4, 2011
Google Chrome – Recovering Deleted Bookmarks
April 26, 2015
[FIX] AoE II HD Won’t Start
October 31, 2011
Ryusei Teaser
Presenting tomorrow at Round 4, Building Virtual Worlds. Streaming will be available! More info soon!