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


C# Bam.Parse方法代码示例

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


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

示例1:

        IInstallNameToolPolicy.InstallName(
            InstallNameModule sender,
            Bam.Core.ExecutionContext context,
            Bam.Core.TokenizedString oldName,
            Bam.Core.TokenizedString newName)
        {
            var originalModule = sender.Source.SourceModule;
            if (originalModule == null)
            {
                return;
            }

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

            var commands = new Bam.Core.StringArray();

            if (sender.Source.SourceModule != null && sender.Source.SourceModule.MetaData != null)
            {
                commands.Add(System.String.Format("{0} {1} {2} {3} {4} {5}",
                    CommandLineProcessor.Processor.StringifyTool(sender.Tool as Bam.Core.ICommandLineTool),
                    commandLine.ToString(' '),
                    oldName.Parse(),
                    newName.Parse(),
                    sender.Source.GeneratedPaths[CollatedObject.Key].Parse(),
                    CommandLineProcessor.Processor.TerminatingArgs(sender.Tool as Bam.Core.ICommandLineTool)));

                var target = sender.Source.SourceModule.MetaData as XcodeBuilder.Target;
                var configuration = target.GetConfiguration(sender.Source.SourceModule);
                target.AddPostBuildCommands(commands, configuration);
            }
            else
            {
                var destinationFolder = "$CONFIGURATION_BUILD_DIR";
                if (sender.Source.Reference != null)
                {
                    destinationFolder = "$CONFIGURATION_BUILD_DIR/$EXECUTABLE_FOLDER_PATH";
                }

                commands.Add(System.String.Format("{0} {1} {2} {3} {4}/{5} {6}",
                    CommandLineProcessor.Processor.StringifyTool(sender.Tool as Bam.Core.ICommandLineTool),
                    commandLine.ToString(' '),
                    oldName.Parse(),
                    newName.Parse(),
                    destinationFolder,
                    sender.Source.CreateTokenizedString("$(0)/@filename($(1))", sender.Source.SubDirectory, sender.Source.SourcePath).Parse(),
                    CommandLineProcessor.Processor.TerminatingArgs(sender.Tool as Bam.Core.ICommandLineTool)));

                var target = sender.Source.Reference.SourceModule.MetaData as XcodeBuilder.Target;
                var configuration = target.GetConfiguration(sender.Source.Reference.SourceModule);
                target.AddPostBuildCommands(commands, configuration);
            }
        }
开发者ID:knocte,项目名称:BuildAMation,代码行数:53,代码来源:XcodeChangeNameOSX.cs

示例2:

        IObjCopyToolPolicy.ObjCopy(
            ObjCopyModule sender,
            Bam.Core.ExecutionContext context,
            Bam.Core.TokenizedString originalPath,
            Bam.Core.TokenizedString copiedPath)
        {
            var mode = (sender.Settings as IObjCopyToolSettings).Mode;

            // if linking debug data, add to the strip
            var meta = (EObjCopyToolMode.AddGNUDebugLink == mode) ? sender.SourceModule.MetaData as MakeFileBuilder.MakeFileMeta : new MakeFileBuilder.MakeFileMeta(sender);
            var rule = (EObjCopyToolMode.AddGNUDebugLink == mode) ? meta.Rules[0] :meta.AddRule();

            if (EObjCopyToolMode.AddGNUDebugLink == mode)
            {
                rule.AddOrderOnlyDependency(copiedPath.Parse());
            }
            else
            {
                meta.CommonMetaData.Directories.AddUnique(sender.CreateTokenizedString("@dir($(0))", copiedPath).Parse());

                var sourceFilename = System.IO.Path.GetFileName(originalPath.Parse());
                rule.AddTarget(copiedPath, variableName: "objcopy_" + sourceFilename);
                rule.AddPrerequisite(originalPath);
            }

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

            rule.AddShellCommand(System.String.Format("{0} {1} {2}",
                CommandLineProcessor.Processor.StringifyTool(sender.Tool as Bam.Core.ICommandLineTool),
                commandLine.ToString(' '),
                CommandLineProcessor.Processor.TerminatingArgs(sender.Tool as Bam.Core.ICommandLineTool)));
        }
开发者ID:knocte,项目名称:BuildAMation,代码行数:33,代码来源:MakeFileObjCopy.cs

示例3:

        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

示例4:

        void IMocGenerationPolicy.Moc(
            MocGeneratedSource sender,
            Bam.Core.ExecutionContext context,
            Bam.Core.ICommandLineTool mocCompiler,
            Bam.Core.TokenizedString generatedMocSource,
            C.HeaderFile source)
        {
            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 output = generatedMocSource.Parse();
            var sourcePath = source.InputPath.Parse();

            var commands = new Bam.Core.StringArray();
            commands.Add(System.String.Format("[[ ! -d {0} ]] && mkdir -p {0}", System.IO.Path.GetDirectoryName(output)));

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

            var moc_commandLine = args.ToString(' ');

            commands.Add(System.String.Format("if [[ ! -e {0} || {1} -nt {0} ]]", output, sourcePath));
            commands.Add("then");
            commands.Add(System.String.Format("\techo {0}", moc_commandLine));
            commands.Add(System.String.Format("\t{0}", moc_commandLine));
            commands.Add("fi");

            target.AddPreBuildCommands(commands, configuration);
        }
开发者ID:markfinal,项目名称:bam-qt,代码行数:35,代码来源:MocGeneration.cs

示例5:

        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

示例6:

        IStripToolPolicy.Strip(
            StripModule sender,
            Bam.Core.ExecutionContext context,
            Bam.Core.TokenizedString originalPath,
            Bam.Core.TokenizedString strippedPath)
        {
            var strippedDir = System.IO.Path.GetDirectoryName(strippedPath.Parse());
            if (!System.IO.Directory.Exists(strippedDir))
            {
                System.IO.Directory.CreateDirectory(strippedDir);
            }

            var commandLine = new Bam.Core.StringArray();
            (sender.Settings as CommandLineProcessor.IConvertToCommandLine).Convert(commandLine);
            commandLine.Add(originalPath.Parse());
            commandLine.Add(System.String.Format("-o {0}", strippedPath.Parse()));
            CommandLineProcessor.Processor.Execute(context, sender.Tool as Bam.Core.ICommandLineTool, commandLine);
        }
开发者ID:knocte,项目名称:BuildAMation,代码行数:18,代码来源:NativeStrip.cs

示例7:

 INSISPolicy.CreateInstaller(
     NSISInstaller sender,
     Bam.Core.ExecutionContext context,
     Bam.Core.ICommandLineTool compiler,
     Bam.Core.TokenizedString scriptPath)
 {
     var args = new Bam.Core.StringArray();
     args.Add(scriptPath.Parse());
     CommandLineProcessor.Processor.Execute(context, compiler, args);
 }
开发者ID:knocte,项目名称:BuildAMation,代码行数:10,代码来源:NativeNSIS.cs

示例8:

        IInstallNameToolPolicy.InstallName(
            InstallNameModule sender,
            Bam.Core.ExecutionContext context,
            Bam.Core.TokenizedString oldName,
            Bam.Core.TokenizedString newName)
        {
            var commandLine = new Bam.Core.StringArray();
            (sender.Settings as CommandLineProcessor.IConvertToCommandLine).Convert(commandLine);

            commandLine.Add(newName.Parse());
            commandLine.Add(sender.Source.GeneratedPaths[CollatedObject.Key].Parse());
            CommandLineProcessor.Processor.Execute(context, sender.Tool as Bam.Core.ICommandLineTool, commandLine);
        }
开发者ID:knocte,项目名称:BuildAMation,代码行数:13,代码来源:NativeIdNameOSX.cs

示例9:

        IStripToolPolicy.Strip(
            StripModule sender,
            Bam.Core.ExecutionContext context,
            Bam.Core.TokenizedString originalPath,
            Bam.Core.TokenizedString copiedPath)
        {
            var meta = new MakeFileBuilder.MakeFileMeta(sender);
            var rule = meta.AddRule();

            var sourceFilename = System.IO.Path.GetFileName(originalPath.Parse());

            meta.CommonMetaData.Directories.AddUnique(sender.CreateTokenizedString("@dir($(0))", copiedPath).Parse());
            rule.AddTarget(copiedPath, variableName: "strip_" + sourceFilename);

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

            rule.AddShellCommand(System.String.Format("{0} {1} {2} -o {3} {4}",
                CommandLineProcessor.Processor.StringifyTool(sender.Tool as Bam.Core.ICommandLineTool),
                commandLine.ToString(' '),
                originalPath.Parse(),
                copiedPath.Parse(),
                CommandLineProcessor.Processor.TerminatingArgs(sender.Tool as Bam.Core.ICommandLineTool)));
        }
开发者ID:knocte,项目名称:BuildAMation,代码行数:24,代码来源:MakeFileStrip.cs

示例10:

        IObjCopyToolPolicy.ObjCopy(
            ObjCopyModule sender,
            Bam.Core.ExecutionContext context,
            Bam.Core.TokenizedString originalPath,
            Bam.Core.TokenizedString copiedPath)
        {
            var copiedDir = System.IO.Path.GetDirectoryName(copiedPath.Parse());
            if (!System.IO.Directory.Exists(copiedDir))
            {
                System.IO.Directory.CreateDirectory(copiedDir);
            }

            var commandLine = new Bam.Core.StringArray();
            (sender.Settings as CommandLineProcessor.IConvertToCommandLine).Convert(commandLine);
            CommandLineProcessor.Processor.Execute(context, sender.Tool as Bam.Core.ICommandLineTool, commandLine);
        }
开发者ID:knocte,项目名称:BuildAMation,代码行数:16,代码来源:NativeObjCopy.cs

示例11: AddFilters

 AddFilters(
     Bam.Core.Module module,
     Bam.Core.TokenizedString filterPath)
 {
     var path = filterPath.Parse();
     if (!this.Filters.ContainsKey(path))
     {
         this.Filters.Add(path, new Bam.Core.Array<VSSettingsGroup>());
     }
     if (!path.Contains(System.IO.Path.DirectorySeparatorChar))
     {
         return;
     }
     // the entire hierarchy needs to be added, even if they are empty
     var parent = module.CreateTokenizedString("@dir($(0))", filterPath);
     this.AddFilters(module, parent);
 }
开发者ID:knocte,项目名称:BuildAMation,代码行数:17,代码来源:VSProjectFilter.cs

示例12:

        IInstallNameToolPolicy.InstallName(
            InstallNameModule sender,
            Bam.Core.ExecutionContext context,
            Bam.Core.TokenizedString oldName,
            Bam.Core.TokenizedString newName)
        {
            // add another shell command to the rule for copying the file
            var meta = sender.Source.MetaData as MakeFileBuilder.MakeFileMeta;
            var rule = meta.Rules[0];

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

            rule.AddShellCommand(System.String.Format(@"{0} {1} {2} [email protected] {3}",
                CommandLineProcessor.Processor.StringifyTool(sender.Tool as Bam.Core.ICommandLineTool),
                commandLine.ToString(' '),
                newName.Parse(),
                CommandLineProcessor.Processor.TerminatingArgs(sender.Tool as Bam.Core.ICommandLineTool)));
        }
开发者ID:knocte,项目名称:BuildAMation,代码行数:19,代码来源:MakeFileIdNameOSX.cs

示例13:

        void IMocGenerationPolicy.Moc(
            MocGeneratedSource sender,
            Bam.Core.ExecutionContext context,
            Bam.Core.ICommandLineTool mocCompiler,
            Bam.Core.TokenizedString generatedMocSource,
            C.HeaderFile source)
        {
            var mocOutputPath = generatedMocSource.Parse();
            var mocOutputDir = System.IO.Path.GetDirectoryName(mocOutputPath);
            if (!System.IO.Directory.Exists(mocOutputDir))
            {
                System.IO.Directory.CreateDirectory(mocOutputDir);
            }

            var args = new Bam.Core.StringArray();
            (sender.Settings as CommandLineProcessor.IConvertToCommandLine).Convert(args);
            args.Add(System.String.Format("-o {0}", mocOutputPath));
            args.Add(source.InputPath.Parse());
            CommandLineProcessor.Processor.Execute(context, mocCompiler, args);
        }
开发者ID:markfinal,项目名称:bam-qt,代码行数:20,代码来源:MocGeneration.cs

示例14:

        ISharedObjectSymbolicLinkPolicy.Symlink(
            ConsoleApplication sender,
            Bam.Core.ExecutionContext context,
            Bam.Core.PreBuiltTool tool,
            Bam.Core.TokenizedString linkname,
            Bam.Core.TokenizedString target)
        {
            var makeMeta = sender.MetaData as MakeFileBuilder.MakeFileMeta;
            var rule = makeMeta.Rules[0];

            var commandLineArgs = new Bam.Core.StringArray();
            commandLineArgs.Add("-s");
            commandLineArgs.Add("-f");

            rule.AddShellCommand(System.String.Format(@"{0} {1} $(notdir [email protected]) $(dir [email protected])/{2} {3}",
                CommandLineProcessor.Processor.StringifyTool(tool),
                commandLineArgs.ToString(' '),
                linkname.Parse(),
                CommandLineProcessor.Processor.TerminatingArgs(tool)));
        }
开发者ID:knocte,项目名称:BuildAMation,代码行数:20,代码来源:MakeFileSharedObjectSymbolicLink.cs

示例15: GetSettingsGroup

        GetSettingsGroup(
            VSSettingsGroup.ESettingsGroup group,
            Bam.Core.TokenizedString include = null,
            bool uniqueToProject = false)
        {
            lock (this.SettingGroups)
            {
                foreach (var settings in this.SettingGroups)
                {
                    if (null == include)
                    {
                        if ((null == settings.Include) && (settings.Group == group))
                        {
                            return settings;
                        }
                    }
                    else
                    {
                        // ignore group, as files can mutate between them during the buildprocess (e.g. headers into custom builds)
                        if ((null != include) && (settings.Include.Parse() == include.Parse()))
                        {
                            return settings;
                        }
                    }
                }

                var newGroup = uniqueToProject ? this.Project.GetUniqueSettingsGroup(this.Module, group, include) : new VSSettingsGroup(this.Module, group, include);
                this.SettingGroups.Add(newGroup);
                return newGroup;
            }
        }
开发者ID:knocte,项目名称:BuildAMation,代码行数:31,代码来源:VSProjectConfiguration.cs


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