Fusion.Build.Builder.SafeBuild C# (CSharp) Method

SafeBuild() public static method

public static SafeBuild ( bool force = false, string cleanPattern = null ) : bool
force bool
cleanPattern string
return bool
		public static bool SafeBuild ( bool force = false, string cleanPattern = null )
		{
			try {

				Options.ForceRebuild	=	force;
				Options.CleanPattern	=	cleanPattern;
				
				if (File.Exists(Options.ContentIniFile)) {

					Build( Options );
					return true;

				} else {

					Log.Message("{0} does not exist. Build skipped.", Options.ContentIniFile );
					return false;

				}

			} catch ( BuildException be ) {

				Log.Error("{0}", be.Message);
				return false;
			}
		}

Usage Example

Beispiel #1
0
 void BuildTask()
 {
     Builder.SafeBuild(ForceRebuild, CleanPattern, Files);
     if (Game.IsInitialized)
     {
         Invoker.Game.Reload();
     }
 }