コード例 #1
0
ファイル: ManagedCompiler.cs プロジェクト: nsm120/roslyn
        /// <summary>
        /// Return the path to the tool to execute.
        /// </summary>
        protected override string GenerateFullPathToTool()
        {
            var pathToTool = Utilities.GenerateFullPathToTool(ToolName);

            if (null == pathToTool)
            {
                Log.LogErrorWithCodeFromResources("General_ToolFileNotFound", ToolName);
            }

            return(pathToTool);
        }
コード例 #2
0
        public static DotnetHost CreateManagedInvocationTool(string toolName, string commandLineArgs)
        {
            var pathToToolOpt = Utilities.GenerateFullPathToTool(toolName);

            // Desktop executes tool directly, only prepend if we're on CLI
            if (pathToToolOpt != null && IsCliHost(out string pathToDotnet))
            {
                commandLineArgs = PrependFileToArgs(pathToToolOpt, commandLineArgs);
                pathToToolOpt   = pathToDotnet;
            }

            return(new DotnetHost(pathToToolOpt, commandLineArgs, isManagedInvocation: true));
        }
コード例 #3
0
ファイル: DotnetHost.cs プロジェクト: sslasi/roslyn
        public static DotnetHost CreateManagedToolInvocation(string toolNameWithoutExtension, string commandLineArgs)
        {
            string pathToToolOpt;
            string toolName;

            if (IsCliHost(out string pathToDotnet))
            {
                toolName      = $"{toolNameWithoutExtension}.dll";
                pathToToolOpt = Utilities.GenerateFullPathToTool(toolName);
                if (pathToToolOpt != null)
                {
                    commandLineArgs = PrependFileToArgs(pathToToolOpt, commandLineArgs);
                    pathToToolOpt   = pathToDotnet;
                }
            }
            else
            {
                // Desktop executes tool directly
                toolName      = $"{toolNameWithoutExtension}.exe";
                pathToToolOpt = Utilities.GenerateFullPathToTool(toolName);
            }

            return(new DotnetHost(toolName, pathToToolOpt, commandLineArgs));
        }