IOverrideModuleConfiguration.execute( Bam.Core.IModuleConfiguration config, Bam.Core.Environment buildEnvironment) { var libConfig = config as ConfigureLibrary; if (null != libConfig) { libConfig.UseFunkyNewFeature = true; } }
IOverrideModuleConfiguration.execute( Bam.Core.IModuleConfiguration config, Bam.Core.Environment buildEnvironment) { var pythonConfig = config as Python.ConfigurePython; if (null != pythonConfig) { if (buildEnvironment.Platform.Includes(Bam.Core.EPlatform.Windows)) { pythonConfig.PyDEBUG = false; // depends on the CRT debug-ness } else { pythonConfig.PyDEBUG = (buildEnvironment.Configuration == Bam.Core.EConfiguration.Debug); } } }
public ConfigureLibrary( Bam.Core.Environment buildEnv) { this.UseFunkyNewFeature = false; }
Main( string[] args) { #if false // take control of Ctrl+C System.Console.CancelKeyPress += new System.ConsoleCancelEventHandler(HandleCancellation); #endif try { var totalTimeProfile = new Core.TimeProfile(Core.ETimingProfiles.TimedTotal); var processCommandLineProfile = new Core.TimeProfile(Core.ETimingProfiles.ProcessCommandLine); totalTimeProfile.StartProfile(); processCommandLineProfile.StartProfile(); var verbosityLevel = (Core.EVerboseLevel)Core.CommandLineProcessor.Evaluate(new Core.Options.VerbosityLevel()); switch (verbosityLevel) { case Core.EVerboseLevel.None: case Core.EVerboseLevel.Info: case Core.EVerboseLevel.Detail: case Core.EVerboseLevel.Full: Core.Graph.Instance.VerbosityLevel = verbosityLevel; break; default: throw new Core.Exception("Unrecognized verbosity level, {0}", verbosityLevel); } if (Core.CommandLineProcessor.Evaluate(new Core.Options.PrintHelp())) { CommandLineArgumentHelper.PrintHelp(); return; } if (Core.CommandLineProcessor.Evaluate(new Core.Options.PrintVersion())) { CommandLineArgumentHelper.PrintVersion(); return; } if (Core.CommandLineProcessor.Evaluate(new Core.Options.CreateDebugProject())) { DebugProject.Create(); return; } if (Core.CommandLineProcessor.Evaluate(new Core.Options.MakePackage())) { Core.PackageUtilities.MakePackage(); return; } if (Core.CommandLineProcessor.Evaluate(new Core.Options.AddDependentPackage())) { Core.PackageUtilities.AddDependentPackage(); return; } if (Core.CommandLineProcessor.Evaluate(new Core.Options.ShowDefinitionFile())) { Core.PackageUtilities.IdentifyAllPackages(allowDuplicates: true, enforceBamAssemblyVersions: false); Core.Graph.Instance.MasterPackage.Show(); return; } // configure Core.Graph.Instance.BuildRoot = Core.CommandLineProcessor.Evaluate(new Core.Options.BuildRoot()); Core.Graph.Instance.Mode = Core.CommandLineProcessor.Evaluate(new Core.Options.BuildMode()); if (null == Core.Graph.Instance.Mode) { throw new Core.Exception("No build mode specified"); } var configs = new Core.Array <Core.Environment>(); var requestedConfigs = Core.CommandLineProcessor.Evaluate(new Core.Options.BuildConfigurations()); if (0 == requestedConfigs.Count) { // default requestedConfigs.Add(new Core.StringArray("debug")); } foreach (var configOption in requestedConfigs) { foreach (var config in configOption) { var env = new Core.Environment(); env.Configuration = Core.Configuration.FromString(config); configs.Add(env); } } processCommandLineProfile.StopProfile(); Core.EntryPoint.Execute(configs); totalTimeProfile.StopProfile(); } catch (Core.Exception exception) { Core.Exception.DisplayException(exception); System.Environment.ExitCode = -1; } catch (System.Exception exception) { var message = new System.Text.StringBuilder(); message.AppendFormat("{0} not handled: {1}", exception.GetType().ToString(), exception.Message); message.AppendLine(); message.AppendLine(exception.StackTrace); Core.Log.ErrorMessage(message.ToString()); System.Environment.ExitCode = -2; } finally { if (Core.Graph.Instance.BuildEnvironments.Count > 0) { Core.Log.Info((0 == System.Environment.ExitCode) ? "\nBuild Succeeded" : "\nBuild Failed"); if (Core.CommandLineProcessor.Evaluate(new Core.Options.PrintStatistics())) { Core.Statistics.Display(); } Core.Log.DebugMessage("Exit code {0}", System.Environment.ExitCode); } } }
Main( string[] args) { #if false // take control of Ctrl+C System.Console.CancelKeyPress += new System.ConsoleCancelEventHandler(HandleCancellation); #endif try { var totalTimeProfile = new Core.TimeProfile(Core.ETimingProfiles.TimedTotal); var processCommandLineProfile = new Core.TimeProfile(Core.ETimingProfiles.ProcessCommandLine); totalTimeProfile.StartProfile(); processCommandLineProfile.StartProfile(); var verbosityLevel = (Core.EVerboseLevel)Core.CommandLineProcessor.Evaluate(new Core.Options.VerbosityLevel()); switch (verbosityLevel) { case Core.EVerboseLevel.None: case Core.EVerboseLevel.Info: case Core.EVerboseLevel.Detail: case Core.EVerboseLevel.Full: Core.Graph.Instance.VerbosityLevel = verbosityLevel; break; default: throw new Core.Exception("Unrecognized verbosity level, {0}", verbosityLevel); } if (Core.CommandLineProcessor.Evaluate(new Core.Options.PrintHelp())) { CommandLineArgumentHelper.PrintHelp(); return; } if (Core.CommandLineProcessor.Evaluate(new Core.Options.PrintVersion())) { CommandLineArgumentHelper.PrintVersion(); return; } if (Core.CommandLineProcessor.Evaluate(new Core.Options.CreateDebugProject())) { DebugProject.Create(); return; } if (Core.CommandLineProcessor.Evaluate(new Core.Options.MakePackage())) { Core.PackageUtilities.MakePackage(); return; } if (Core.CommandLineProcessor.Evaluate(new Core.Options.AddDependentPackage())) { Core.PackageUtilities.AddDependentPackage(); return; } if (Core.CommandLineProcessor.Evaluate(new Core.Options.ShowDefinitionFile())) { Core.PackageUtilities.IdentifyAllPackages(allowDuplicates: true, enforceBamAssemblyVersions: false); Core.Graph.Instance.MasterPackage.Show(); return; } // configure Core.Graph.Instance.BuildRoot = Core.CommandLineProcessor.Evaluate(new Core.Options.BuildRoot()); Core.Graph.Instance.Mode = Core.CommandLineProcessor.Evaluate(new Core.Options.BuildMode()); if (null == Core.Graph.Instance.Mode) { throw new Core.Exception("No build mode specified"); } var configs = new Core.Array<Core.Environment>(); var requestedConfigs = Core.CommandLineProcessor.Evaluate(new Core.Options.BuildConfigurations()); if (0 == requestedConfigs.Count) { // default requestedConfigs.Add(new Core.StringArray("debug")); } foreach (var configOption in requestedConfigs) { foreach (var config in configOption) { var env = new Core.Environment(); env.Configuration = Core.Configuration.FromString(config); configs.Add(env); } } processCommandLineProfile.StopProfile(); Core.EntryPoint.Execute(configs); totalTimeProfile.StopProfile(); } catch (Core.Exception exception) { Core.Exception.DisplayException(exception); System.Environment.ExitCode = -1; } catch (System.Exception exception) { var message = new System.Text.StringBuilder(); message.AppendFormat("{0} not handled: {1}", exception.GetType().ToString(), exception.Message); message.AppendLine(); message.AppendLine(exception.StackTrace); Core.Log.ErrorMessage(message.ToString()); System.Environment.ExitCode = -2; } finally { if (Core.Graph.Instance.BuildEnvironments.Count > 0) { Core.Log.Info((0 == System.Environment.ExitCode) ? "\nBuild Succeeded" : "\nBuild Failed"); if (Core.CommandLineProcessor.Evaluate(new Core.Options.PrintStatistics())) { Core.Statistics.Display(); } Core.Log.DebugMessage("Exit code {0}", System.Environment.ExitCode); } } }
// on non-Windows platforms, setting Py_DEBUG to true will 'do the right thing' as the pyconfig.h // is generated in code below // on Windows, PC/pyconfig.h is part of the source, and Py_DEBUG is only defined when _DEBUG // is defined, which is when a debug CRT is in use // - user packages are expected to be consistent in their setting of this module configuration // and the CRT in use, or Python library compilations will occur public ConfigurePython( Bam.Core.Environment buildEnvironment) => this.PyDEBUG = false;