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
August 5, 2011
[How-to-Fix] Chrome Adblock & Youtube Auto HD
Great extensions if you're using Google Chrome! :)
July 28, 2011
[How-to-Fix] Joomla!: Enabling Object, Embed & Iframe
How to enable object, embed & iframe tags in joomla for adding YouTube and Google Maps
July 11, 2013
Outlook.com’s UI Inconsistency
I like Outlook.com (revamped Hotmail), but there's an inconsistency in the Outlook.com's user interface which kind of bugs me.
August 28, 2011
Pittsburgh from Mount Washington Panorama
Pittsburgh from Mount Washington panorama picture



