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


C# IAnalyzerAssemblyLoader类代码示例

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


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

示例1: TestableCompilerServerHost

 public TestableCompilerServerHost(
     IAnalyzerAssemblyLoader loader = null, 
     Func<string, MetadataReferenceProperties, PortableExecutableReference> assemblyReferenceProvider = null) : 
     base(ServerUtil.DefaultClientDirectory, ServerUtil.DefaultSdkDirectory)
 {
     AnalyzerAssemblyLoader = loader;
     AssemblyReferenceProvider = assemblyReferenceProvider;
 }
开发者ID:XieShuquan,项目名称:roslyn,代码行数:8,代码来源:CompilerServerHostTests.cs

示例2: Run

        internal static int Run(string[] args, BuildPaths buildPaths, TextWriter textWriter, IAnalyzerAssemblyLoader analyzerLoader)
        {
            FatalError.Handler = FailFast.OnFatalException;

            var responseFile = Path.Combine(buildPaths.ClientDirectory, CSharpCompiler.ResponseFileName);
            var compiler = new Csc(responseFile, buildPaths, args, analyzerLoader);
            return ConsoleUtil.RunWithUtf8Output(compiler.Arguments.Utf8Output, textWriter, tw => compiler.Run(tw));
        }
开发者ID:Rickinio,项目名称:roslyn,代码行数:8,代码来源:Csc.cs

示例3: Run

        internal static int Run(string clientDirectory, string sdkDirectory, string[] args, IAnalyzerAssemblyLoader analyzerLoader)
        {
            FatalError.Handler = FailFast.OnFatalException;

            var responseFile = Path.Combine(clientDirectory, VisualBasicCompiler.ResponseFileName);
            Vbc compiler = new Vbc(responseFile, clientDirectory, Directory.GetCurrentDirectory(), sdkDirectory, args, analyzerLoader);

            return ConsoleUtil.RunWithOutput(compiler.Arguments.Utf8Output, (textWriterOut, _) => compiler.Run(textWriterOut));
        }
开发者ID:GloryChou,项目名称:roslyn,代码行数:9,代码来源:Vbc.cs

示例4: Run

 public static int Run(CommandLineParser parser, string responseFile, string[] args,
     string clientDirectory, string baseDirectory, string sdkDirectory,
     string additionalReferenceDirectories,
     IAnalyzerAssemblyLoader analyzerLoader,
     TextWriter output)
 {
     return
         new PhpCompiler(parser, responseFile, args, clientDirectory, baseDirectory, sdkDirectory, additionalReferenceDirectories, analyzerLoader)
         .Run(output);
 }
开发者ID:iolevel,项目名称:peachpie,代码行数:10,代码来源:PhpCompilerDriver.cs

示例5: Run

 internal static int Run(IEnumerable<string> arguments, IEnumerable<string> extraArguments, RequestLanguage language, CompileFunc compileFunc, IAnalyzerAssemblyLoader analyzerAssemblyLoader)
 {
     var client = new DesktopBuildClient(language, compileFunc, analyzerAssemblyLoader);
     var clientDir = AppDomain.CurrentDomain.BaseDirectory;
     var sdkDir = RuntimeEnvironment.GetRuntimeDirectory();
     var workingDir = Directory.GetCurrentDirectory();
     var buildPaths = new BuildPaths(clientDir: clientDir, workingDir: workingDir, sdkDir: sdkDir);
     var originalArguments = BuildClient.GetCommandLineArgs(arguments).Concat(extraArguments).ToArray();
     return client.RunCompilation(originalArguments, buildPaths).ExitCode;
 }
开发者ID:Rickinio,项目名称:roslyn,代码行数:10,代码来源:DesktopBuildClient.cs

示例6: VisualStudioAnalyzer

 public VisualStudioAnalyzer(string fullPath, IVsFileChangeEx fileChangeService, HostDiagnosticUpdateSource hostDiagnosticUpdateSource, ProjectId projectId, Workspace workspace, IAnalyzerAssemblyLoader loader, string language)
 {
     _fullPath = fullPath;
     _tracker = new FileChangeTracker(fileChangeService, fullPath);
     _tracker.UpdatedOnDisk += OnUpdatedOnDisk;
     _tracker.StartFileChangeListeningAsync();
     _tracker.EnsureSubscription();
     _hostDiagnosticUpdateSource = hostDiagnosticUpdateSource;
     _projectId = projectId;
     _workspace = workspace;
     _loader = loader;
     _language = language;
 }
开发者ID:Rickinio,项目名称:roslyn,代码行数:13,代码来源:VisualStudioAnalyzer.cs

示例7: Pchp

 public Pchp(string[] args, IAnalyzerAssemblyLoader analyzerLoader)
     :base(
          PhpCommandLineParser.Default,
          Path.Combine(AppDomain.CurrentDomain.BaseDirectory, ResponseFileName),
          CreateArgs(args),
          AppDomain.CurrentDomain.BaseDirectory,
          Directory.GetCurrentDirectory(),
          System.Runtime.InteropServices.RuntimeEnvironment.GetRuntimeDirectory(),
          Environment.GetEnvironmentVariable("LIB") + @";C:\Windows\Microsoft.NET\assembly\GAC_MSIL",
          analyzerLoader)
 {
     
 }
开发者ID:iolevel,项目名称:peachpie,代码行数:13,代码来源:peach.cs

示例8: CommonCompiler

        public CommonCompiler(CommandLineParser parser, string responseFile, string[] args, string clientDirectory, string baseDirectory, string sdkDirectoryOpt, string additionalReferenceDirectories, IAnalyzerAssemblyLoader analyzerLoader)
        {
            IEnumerable<string> allArgs = args;
            _clientDirectory = clientDirectory;

            Debug.Assert(null == responseFile || PathUtilities.IsAbsolute(responseFile));
            if (!SuppressDefaultResponseFile(args) && PortableShim.File.Exists(responseFile))
            {
                allArgs = new[] { "@" + responseFile }.Concat(allArgs);
            }

            this.Arguments = parser.Parse(allArgs, baseDirectory, sdkDirectoryOpt, additionalReferenceDirectories);
            this.MessageProvider = parser.MessageProvider;
            this.AnalyzerLoader = analyzerLoader;
        }
开发者ID:SoumikMukherjeeDOTNET,项目名称:roslyn,代码行数:15,代码来源:CommonCompiler.cs

示例9: RunWithConsoleOutput

        /// <summary>
        /// Run a compilation through the compiler server and print the output
        /// to the console. If the compiler server fails, run the fallback
        /// compiler.
        /// </summary>
        public static int RunWithConsoleOutput(
            string[] args,
            string clientDir,
            string workingDir,
            string sdkDir,
            IAnalyzerAssemblyLoader analyzerLoader,
            RequestLanguage language,
            Func<string, string, string[], IAnalyzerAssemblyLoader, int> fallbackCompiler)
        {
            args = args.Select(arg => arg.Trim()).ToArray();

            bool hasShared;
            string keepAlive;
            string errorMessage;
            List<string> parsedArgs;
            if (!CommandLineParser.TryParseClientArgs(
                    args,
                    out parsedArgs,
                    out hasShared,
                    out keepAlive,
                    out errorMessage))
            {
                Console.Out.WriteLine(errorMessage);
                return CommonCompiler.Failed;
            }

            if (hasShared)
            {
                var responseTask = TryRunServerCompilation(
                    language,
                    clientDir,
                    workingDir,
                    parsedArgs,
                    default(CancellationToken),
                    keepAlive: keepAlive,
                    libEnvVariable: Environment.GetEnvironmentVariable("LIB"));

                var response = responseTask.Result;
                if (response != null)
                {
                    return HandleResponse(response, clientDir, sdkDir, analyzerLoader, fallbackCompiler, parsedArgs);
                }
            }

            return fallbackCompiler(clientDir, sdkDir, parsedArgs.ToArray(), analyzerLoader);
        }
开发者ID:noahstein,项目名称:roslyn,代码行数:51,代码来源:BuildClient.cs

示例10: CommonCompiler

        public CommonCompiler(CommandLineParser parser, string responseFile, string[] args, string clientDirectory, string baseDirectory, string sdkDirectoryOpt, string additionalReferenceDirectories, IAnalyzerAssemblyLoader assemblyLoader)
        {
            IEnumerable<string> allArgs = args;
            _clientDirectory = clientDirectory;

            Debug.Assert(null == responseFile || PathUtilities.IsAbsolute(responseFile));
            if (!SuppressDefaultResponseFile(args) && File.Exists(responseFile))
            {
                allArgs = new[] { "@" + responseFile }.Concat(allArgs);
            }

            this.Arguments = parser.Parse(allArgs, baseDirectory, sdkDirectoryOpt, additionalReferenceDirectories);
            this.MessageProvider = parser.MessageProvider;
            this.AssemblyLoader = assemblyLoader;
            this.EmbeddedSourcePaths = GetEmbedddedSourcePaths(Arguments);

            if (Arguments.ParseOptions.Features.ContainsKey("debug-determinism"))
            {
                EmitDeterminismKey(Arguments, args, baseDirectory, parser);
            }
        }
开发者ID:orthoxerox,项目名称:roslyn,代码行数:21,代码来源:CommonCompiler.cs

示例11: Check

        public static bool Check(string baseDirectory, IEnumerable<CommandLineAnalyzerReference> analyzerReferences, IAnalyzerAssemblyLoader loader, IEnumerable<string> ignorableReferenceNames = null)
        {
            if (ignorableReferenceNames == null)
            {
                ignorableReferenceNames = s_defaultIgnorableReferenceNames;
            }

            try
            {
                CompilerServerLogger.Log("Begin Analyzer Consistency Check");
                return CheckCore(baseDirectory, analyzerReferences, loader, ignorableReferenceNames);
            }
            catch (Exception e)
            {
                CompilerServerLogger.LogException(e, "Analyzer Consistency Check");
                return false;
            }
            finally
            {
                CompilerServerLogger.Log("End Analyzer Consistency Check");
            }
        }
开发者ID:GloryChou,项目名称:roslyn,代码行数:22,代码来源:AnalyzerConsistencyChecker.cs

示例12: RunCompiler

        public static BuildResponse RunCompiler(
            string clientDirectory,
            string[] args,
            string baseDirectory,
            string sdkDirectory,
            string libDirectory,
            IAnalyzerAssemblyLoader analyzerLoader,
            CancellationToken cancellationToken)
        {
            var compiler = new VisualBasicCompilerServer(args, clientDirectory, baseDirectory, sdkDirectory, libDirectory, analyzerLoader);
            bool utf8output = compiler.Arguments.Utf8Output;

            if (!AnalyzerConsistencyChecker.Check(baseDirectory, compiler.Arguments.AnalyzerReferences, analyzerLoader))
            {
                return new AnalyzerInconsistencyBuildResponse();
            }

            TextWriter output = new StringWriter(CultureInfo.InvariantCulture);
            int returnCode = compiler.Run(output, cancellationToken);

            return new CompletedBuildResponse(returnCode, utf8output, output.ToString(), string.Empty);
        }
开发者ID:GloryChou,项目名称:roslyn,代码行数:22,代码来源:VisualBasicCompilerServer.cs

示例13: CSharpCompiler

 protected CSharpCompiler(CSharpCommandLineParser parser, string responseFile, string[] args, string clientDirectory, string baseDirectory, string sdkDirectoryOpt, string additionalReferenceDirectories, IAnalyzerAssemblyLoader analyzerLoader)
     : base(parser, responseFile, args, clientDirectory, baseDirectory, sdkDirectoryOpt, additionalReferenceDirectories, analyzerLoader)
 {
     _diagnosticFormatter = new CommandLineDiagnosticFormatter(baseDirectory, Arguments.PrintFullPaths, Arguments.ShouldIncludeErrorEndLocation);
 }
开发者ID:nemec,项目名称:roslyn,代码行数:5,代码来源:CSharpCompiler.cs

示例14: HandleResponse

        private static int HandleResponse(BuildResponse response, string clientDir, string sdkDir, IAnalyzerAssemblyLoader analyzerLoader, Func<string, string, string[], IAnalyzerAssemblyLoader, int> fallbackCompiler, List<string> parsedArgs)
        {
            switch (response.Type)
            {
                case BuildResponse.ResponseType.MismatchedVersion:
                    Console.Error.WriteLine(CommandLineParser.MismatchedVersionErrorText);
                    return CommonCompiler.Failed;

                case BuildResponse.ResponseType.Completed:
                    var completedResponse = (CompletedBuildResponse)response;
                    return ConsoleUtil.RunWithOutput(
                        completedResponse.Utf8Output,
                        (outWriter, errorWriter) =>
                        {
                            outWriter.Write(completedResponse.Output);
                            errorWriter.Write(completedResponse.ErrorOutput);
                            return completedResponse.ReturnCode;
                        });

                case BuildResponse.ResponseType.AnalyzerInconsistency:
                    return fallbackCompiler(clientDir, sdkDir, parsedArgs.ToArray(), analyzerLoader);

                default:
                    throw new InvalidOperationException("Encountered unknown response type");
            }
        }
开发者ID:noahstein,项目名称:roslyn,代码行数:26,代码来源:BuildClient.cs

示例15: Vbc

 internal Vbc(string responseFile, string clientDirectory, string baseDirectory, string sdkDirectory, string[] args, IAnalyzerAssemblyLoader analyzerLoader)
     : base(VisualBasicCommandLineParser.Default, responseFile, args, clientDirectory, baseDirectory, sdkDirectory, Environment.GetEnvironmentVariable("LIB"), analyzerLoader)
 {
 }
开发者ID:GloryChou,项目名称:roslyn,代码行数:4,代码来源:Vbc.cs


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