当前位置: 首页>>代码示例>>C#>>正文


C# Bam类代码示例

本文整理汇总了C#中Bam的典型用法代码示例。如果您正苦于以下问题:C# Bam类的具体用法?C# Bam怎么用?C# Bam使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


Bam类属于命名空间,在下文中一共展示了Bam类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Init

        protected override void Init(
            Bam.Core.Module parent)
        {
            base.Init(parent);

            var qtPackage = Bam.Core.Graph.Instance.Packages.First(item => item.Name == "Qt");
            var qtMeta = qtPackage.MetaData as IICUMeta;
            this.Macros.Add("ICUVersion", Bam.Core.TokenizedString.CreateVerbatim(qtMeta.Version));

            this.Macros["MajorVersion"] = this.Macros["ICUVersion"];
            this.Macros["MinorVersion"] = Bam.Core.TokenizedString.CreateVerbatim("1");
            this.Macros.Remove("PatchVersion"); // does not use this part of the version numbering system

            this.Macros.Add("QtInstallPath", Configure.InstallPath);

            if (this.BuildEnvironment.Platform.Includes(Bam.Core.EPlatform.Windows))
            {
                this.Macros.Add("ICUInstallPath", this.CreateTokenizedString("$(QtInstallPath)/bin"));
            }
            else if (this.BuildEnvironment.Platform.Includes(Bam.Core.EPlatform.Linux))
            {
                this.Macros.Add("ICUInstallPath", this.CreateTokenizedString("$(QtInstallPath)/lib"));
            }

            this.GeneratedPaths[C.DynamicLibrary.Key] = this.CreateTokenizedString("$(ICUInstallPath)/$(dynamicprefix)$(OutputName)$(dynamicext)");
        }
开发者ID:markfinal,项目名称:bam-qt,代码行数:26,代码来源:ICU.cs

示例2: GetConfiguration

        GetConfiguration(
            Bam.Core.Module module)
        {
            lock (this.Configurations)
            {
                var moduleConfig = module.BuildEnvironment.Configuration;
                if (this.Configurations.ContainsKey(moduleConfig))
                {
                    return this.Configurations[moduleConfig];
                }

                var platform = Bam.Core.EPlatform.Invalid;
                var bitDepth = (module as C.CModule).BitDepth;
                switch (bitDepth)
                {
                    case C.EBit.ThirtyTwo:
                        platform = Bam.Core.EPlatform.Win32;
                        break;

                    case C.EBit.SixtyFour:
                        platform = Bam.Core.EPlatform.Win64;
                        break;
                }
                if (Bam.Core.EPlatform.Invalid == platform)
                {
                    throw new Bam.Core.Exception("Platform cannot be extracted from the tool {0} for project {1}", module.Tool.ToString(), this.ProjectPath);
                }
                var configuration = new VSProjectConfiguration(this, module, platform);
                this.Configurations.Add(moduleConfig, configuration);
                return configuration;
            }
        }
开发者ID:knocte,项目名称:BuildAMation,代码行数:32,代码来源:VSProject.cs

示例3: VSProjectConfiguration

        public VSProjectConfiguration(
            VSProject project,
            Bam.Core.Module module,
            Bam.Core.EPlatform platform)
        {
            this.Project = project;
            this.Module = module;
            this.Configuration = module.BuildEnvironment.Configuration;
            this.Platform = platform;
            this.FullName = this.CombinedName;

            this.Type = EType.NA;

            var visualCMeta = Bam.Core.Graph.Instance.PackageMetaData<VisualC.MetaData>("VisualC");
            this.PlatformToolset = visualCMeta.PlatformToolset;
            this.UseDebugLibraries = false;
            this.CharacterSet = C.ECharacterSet.NotSet;
            this.WholeProgramOptimization = false;// TODO: false is consistent with Native builds (module.BuildEnvironment.Configuration != Bam.Core.EConfiguration.Debug);

            this.SettingGroups = new Bam.Core.Array<VSSettingsGroup>();
            this.Sources = new Bam.Core.Array<VSSettingsGroup>();

            this.PreBuildCommands = new Bam.Core.StringArray();
            this.PostBuildCommands = new Bam.Core.StringArray();
        }
开发者ID:knocte,项目名称:BuildAMation,代码行数:25,代码来源:VSProjectConfiguration.cs

示例4: Convert

        public static void Convert(
            this C.ICommonLinkerSettings settings,
            Bam.Core.StringArray commandLine)
        {
            var module = (settings as Bam.Core.Settings).Module;
            switch (settings.OutputType)
            {
                case C.ELinkerOutput.Executable:
                    commandLine.Add(System.String.Format("-OUT:{0}", module.GeneratedPaths[C.ConsoleApplication.Key].ToString()));
                    break;

                case C.ELinkerOutput.DynamicLibrary:
                    commandLine.Add("-DLL");
                    commandLine.Add(System.String.Format("-OUT:{0}", module.GeneratedPaths[C.ConsoleApplication.Key].ToString()));
                    break;
            }
            foreach (var path in settings.LibraryPaths)
            {
                commandLine.Add(System.String.Format("-LIBPATH:{0}", path.ParseAndQuoteIfNecessary()));
            }
            foreach (var path in settings.Libraries)
            {
                commandLine.Add(path);
            }
            if (settings.DebugSymbols)
            {
                commandLine.Add("-DEBUG");
                if (null != module.GeneratedPaths[C.ConsoleApplication.PDBKey])
                {
                    commandLine.Add(System.String.Format("-PDB:{0}", module.GeneratedPaths[C.ConsoleApplication.PDBKey].Parse()));
                }
            }
        }
开发者ID:knocte,项目名称:BuildAMation,代码行数:33,代码来源:ICommonLinkerSettings.cs

示例5: Convert

 public static void Convert(
     System.Type conversionClass,
     Bam.Core.Settings toolSettings,
     Bam.Core.Module module,
     XcodeBuilder.Configuration configuration)
 {
     var moduleType = typeof(Bam.Core.Module);
     var xcodeConfigurationType = typeof(XcodeBuilder.Configuration);
     foreach (var i in toolSettings.Interfaces())
     {
         var method = conversionClass.GetMethod("Convert", new[] { i, moduleType, xcodeConfigurationType });
         if (null == method)
         {
             throw new Bam.Core.Exception("Unable to locate method {0}.Convert({1}, {2}, {3})",
                 conversionClass.ToString(),
                 i.ToString(),
                 moduleType,
                 xcodeConfigurationType);
         }
         try
         {
             method.Invoke(null, new object[] { toolSettings, module, configuration });
         }
         catch (System.Reflection.TargetInvocationException exception)
         {
             throw new Bam.Core.Exception(exception.InnerException, "Xcode conversion error:");
         }
     }
 }
开发者ID:knocte,项目名称:BuildAMation,代码行数:29,代码来源:Conversion.cs

示例6: Convert

        Convert(
            this C.ICxxOnlyCompilerSettings settings,
            Bam.Core.StringArray commandLine)
        {
            if (settings.ExceptionHandler.HasValue)
            {
                switch (settings.ExceptionHandler.Value)
                {
                case C.Cxx.EExceptionHandler.Disabled:
                    commandLine.Add("-fno-exceptions");
                    break;

                case C.Cxx.EExceptionHandler.Asynchronous:
                case C.Cxx.EExceptionHandler.Synchronous:
                    commandLine.Add("-fexceptions");
                    break;

                default:
                    throw new Bam.Core.Exception("Unrecognized exception handler option, {0}", settings.ExceptionHandler.Value.ToString());
                }
            }
            if (settings.LanguageStandard.HasValue)
            {
                switch (settings.LanguageStandard.Value)
                {
                    case C.Cxx.ELanguageStandard.Cxx98:
                        commandLine.Add("-std=c++98");
                        break;

                    case C.Cxx.ELanguageStandard.GnuCxx98:
                        commandLine.Add("-std=gnu++98");
                        break;

                    case C.Cxx.ELanguageStandard.Cxx11:
                        commandLine.Add("-std=c++11");
                        break;
                    default:
                        throw new Bam.Core.Exception("Invalid C++ language standard, {0}", settings.LanguageStandard.Value.ToString());
                }
            }
            if (settings.StandardLibrary.HasValue)
            {
                switch (settings.StandardLibrary.Value)
                {
                case C.Cxx.EStandardLibrary.NotSet:
                    break;

                case C.Cxx.EStandardLibrary.libstdcxx:
                    commandLine.Add("-stdlib=libstdc++");
                    break;

                case C.Cxx.EStandardLibrary.libcxx:
                    commandLine.Add("-stdlib=libc++");
                    break;

                default:
                    throw new Bam.Core.Exception("Invalid C++ standard library {0}", settings.StandardLibrary.Value.ToString());
                }
            }
        }
开发者ID:knocte,项目名称:BuildAMation,代码行数:60,代码来源:ICxxOnlyCompilerSettings.cs

示例7: SetType

 protected static void SetType(
     Bam.Core.IModule module,
     Bam.Core.Target target)
 {
     var options = module.Options as IOptions;
     options.Target = ETarget.WindowsExecutable;
 }
开发者ID:markfinal,项目名称:bam-csharp,代码行数:7,代码来源:WindowsExecutable.cs

示例8: Init

        protected override void Init(
            Bam.Core.Module parent)
        {
            base.Init (parent);

            this.CreateCSourceContainer("$(packagedir)/source/library.c");
        }
开发者ID:knocte,项目名称:BuildAMation,代码行数:7,代码来源:CocoaTest1.cs

示例9:

        ITarPolicy.CreateTarBall(
            TarBall sender,
            Bam.Core.ExecutionContext context,
            Bam.Core.ICommandLineTool compiler,
            Bam.Core.TokenizedString scriptPath,
            Bam.Core.TokenizedString outputPath)
        {
            var tarPath = outputPath.ToString();
            var tarDir = System.IO.Path.GetDirectoryName(tarPath);
            if (!System.IO.Directory.Exists(tarDir))
            {
                System.IO.Directory.CreateDirectory(tarDir);
            }

            var commandLine = new Bam.Core.StringArray();
            (sender.Settings as CommandLineProcessor.IConvertToCommandLine).Convert(commandLine);

            commandLine.Add("-c");
            commandLine.Add("-v");
            commandLine.Add("-T");
            commandLine.Add(scriptPath.Parse());
            commandLine.Add("-f");
            commandLine.Add(tarPath);
            CommandLineProcessor.Processor.Execute(context, compiler, commandLine);
        }
开发者ID:knocte,项目名称:BuildAMation,代码行数:25,代码来源:NativeTarBall.cs

示例10: Convert

        public static void Convert(
            this C.ICOnlyCompilerSettings settings,
            Bam.Core.Module module,
            XcodeBuilder.Configuration configuration)
        {
            if (settings.LanguageStandard.HasValue)
            {
                switch (settings.LanguageStandard.Value)
                {
                    case C.ELanguageStandard.C89:
                        configuration["GCC_C_LANGUAGE_STANDARD"] = new XcodeBuilder.UniqueConfigurationValue("c89");
                        break;

                    case C.ELanguageStandard.GNU89:
                            configuration["GCC_C_LANGUAGE_STANDARD"] = new XcodeBuilder.UniqueConfigurationValue("gnu89");
                            break;

                    case C.ELanguageStandard.C99:
                        configuration["GCC_C_LANGUAGE_STANDARD"] = new XcodeBuilder.UniqueConfigurationValue("c99");
                        break;

                    case C.ELanguageStandard.GNU99:
                        configuration["GCC_C_LANGUAGE_STANDARD"] = new XcodeBuilder.UniqueConfigurationValue("gnu99");
                        break;

                    default:
                        throw new Bam.Core.Exception("Invalid C language standard, {0}", settings.LanguageStandard.Value.ToString());
                }
            }
        }
开发者ID:Diwahars,项目名称:BuildAMation,代码行数:30,代码来源:ICOnlyCompilerSettings.cs

示例11: Convert

 public static void Convert(
     System.Type conversionClass,
     Bam.Core.Settings settings,
     Bam.Core.Module module,
     VSSolutionBuilder.VSSettingsGroup vsSettingsGroup,
     string condition)
 {
     var moduleType = typeof(Bam.Core.Module);
     var vsSettingsGroupType = typeof(VSSolutionBuilder.VSSettingsGroup);
     var stringType = typeof(string);
     foreach (var i in settings.Interfaces())
     {
         var method = conversionClass.GetMethod("Convert", new[] { i, moduleType, vsSettingsGroupType, stringType });
         if (null == method)
         {
             throw new Bam.Core.Exception("Unable to locate method {0}.Convert({1}, {2}, {3})",
                 conversionClass.ToString(),
                 i.ToString(),
                 moduleType,
                 vsSettingsGroupType,
                 stringType);
         }
         try
         {
             method.Invoke(null, new object[] { settings, module, vsSettingsGroup, condition });
         }
         catch (System.Reflection.TargetInvocationException exception)
         {
             throw new Bam.Core.Exception(exception.InnerException, "VisualStudio conversion error:");
         }
     }
 }
开发者ID:knocte,项目名称:BuildAMation,代码行数:32,代码来源:Conversion.cs

示例12:

        void IRccGenerationPolicy.Rcc(
            RccGeneratedSource sender,
            Bam.Core.ExecutionContext context,
            Bam.Core.ICommandLineTool rccCompiler,
            Bam.Core.TokenizedString generatedRccSource,
            QRCFile source)
        {
            var encapsulating = sender.GetEncapsulatingReferencedModule();

            var solution = Bam.Core.Graph.Instance.MetaData as VSSolutionBuilder.VSSolution;
            var project = solution.EnsureProjectExists(encapsulating);
            var config = project.GetConfiguration(encapsulating);

            var output = generatedRccSource.Parse();

            var args = new Bam.Core.StringArray();
            args.Add(CommandLineProcessor.Processor.StringifyTool(rccCompiler));
            (sender.Settings as CommandLineProcessor.IConvertToCommandLine).Convert(args);
            args.Add(System.String.Format("-o {0}", output));
            args.Add("%(FullPath)");

            config.AddOtherFile(source);

            var customBuild = config.GetSettingsGroup(VSSolutionBuilder.VSSettingsGroup.ESettingsGroup.CustomBuild, include: source.InputPath, uniqueToProject: true);
            customBuild.AddSetting("Command", args.ToString(' '), condition: config.ConditionText);
            customBuild.AddSetting("Message", System.String.Format("Rccing {0}", System.IO.Path.GetFileName(source.InputPath.Parse())), condition: config.ConditionText);
            customBuild.AddSetting("Outputs", output, condition: config.ConditionText);
        }
开发者ID:markfinal,项目名称:bam-qt,代码行数:28,代码来源:RccGeneration.cs

示例13:

        void IGeneratedSourcePolicy.GenerateSource(
            GeneratedSourceModule sender,
            Bam.Core.ExecutionContext context,
            Bam.Core.ICommandLineTool compiler,
            Bam.Core.TokenizedString generatedFilePath)
        {
            var encapsulating = sender.GetEncapsulatingReferencedModule();

            var workspace = Bam.Core.Graph.Instance.MetaData as XcodeBuilder.WorkspaceMeta;
            var target = workspace.EnsureTargetExists(encapsulating);
            var configuration = target.GetConfiguration(encapsulating);

            var command = new System.Text.StringBuilder();
            // recode the executable path for Xcode
            var xcodePath = encapsulating.CreateTokenizedString("$(packagebuilddir)/$(config)").Parse();
            xcodePath += "/" + System.IO.Path.GetFileName(compiler.Executable.Parse());
            command.AppendFormat(xcodePath);
            // TODO: change this to a configuration directory really
            command.AppendFormat(" {0}", Bam.Core.TokenizedString.Create("$(buildroot)", null).Parse());
            command.AppendFormat(" {0}", "Generated");

            var commands = new Bam.Core.StringArray();
            commands.Add(command.ToString());
            target.AddPreBuildCommands(commands, configuration);

            var compilerTarget = workspace.EnsureTargetExists(compiler as Bam.Core.Module);
            target.Requires(compilerTarget);
        }
开发者ID:knocte,项目名称:BuildAMation,代码行数:28,代码来源:CodeGenModule.cs

示例14: Convert

        Convert(
            this IObjCopyToolSettings settings,
            Bam.Core.StringArray commandLine)
        {
            var objCopy = (settings as Bam.Core.Settings).Module as ObjCopyModule;
            switch (settings.Mode)
            {
            case EObjCopyToolMode.OnlyKeepDebug:
                commandLine.Add(System.String.Format("--only-keep-debug {0} {1}",
                    objCopy.SourceModule.GeneratedPaths[objCopy.SourceKey].Parse(),
                    objCopy.GeneratedPaths[ObjCopyModule.Key].Parse()));
                break;

            case EObjCopyToolMode.AddGNUDebugLink:
                commandLine.Add(System.String.Format("--add-gnu-debuglink={0} {1}",
                    objCopy.GeneratedPaths[ObjCopyModule.Key].Parse(),
                    objCopy.SourceModule.GeneratedPaths[objCopy.SourceKey].Parse()));
                break;

            default:
                throw new Bam.Core.Exception("Unrecognized objcopy mode, {0}", settings.Mode.ToString());
            }
            if (settings.Verbose)
            {
                commandLine.Add("-v");
            }
        }
开发者ID:knocte,项目名称:BuildAMation,代码行数:27,代码来源:IObjCopyToolSettings.cs

示例15: SetDefaultOptionValues

        SetDefaultOptionValues(
            Bam.Core.DependencyNode node)
        {
            base.SetDefaultOptionValues(node);

            // TODO: think I can move this to GccCommon, but it misses out the C++ include paths for some reason (see Test9-dev)
            var target = node.Target;
            var gccToolset = target.Toolset as GccCommon.Toolset;
            var machineType = gccToolset.GccDetail.Target;
            var cxxIncludePath = gccToolset.GccDetail.GxxIncludePath;

            if (!System.IO.Directory.Exists(cxxIncludePath))
            {
                throw new Bam.Core.Exception("Gcc C++ include path '{0}' does not exist. Is g++ installed?", cxxIncludePath);
            }
            var cxxIncludePath2 = System.String.Format("{0}/{1}", cxxIncludePath, machineType);
            if (!System.IO.Directory.Exists(cxxIncludePath2))
            {
                throw new Bam.Core.Exception("Gcc C++ include path '{0}' does not exist. Is g++ installed?", cxxIncludePath2);
            }

            var cCompilerOptions = this as C.ICCompilerOptions;
            cCompilerOptions.SystemIncludePaths.Add(cxxIncludePath);
            cCompilerOptions.SystemIncludePaths.Add(cxxIncludePath2);

            GccCommon.CxxCompilerOptionCollection.ExportedDefaults(this, node);
        }
开发者ID:knocte,项目名称:BuildAMation,代码行数:27,代码来源:CxxCompilerOptionCollection.cs


注:本文中的Bam类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。