コード例 #1
0
ファイル: ILMergeRunner.cs プロジェクト: sjmcallister/cake
        private ToolArgumentBuilder GetArguments(FilePath outputAssemblyPath,
                                                 FilePath primaryAssemblyFilePath, IEnumerable <FilePath> assemblyPaths, ILMergeSettings settings)
        {
            var builder = new ToolArgumentBuilder();

            builder.AppendText(GetOutputParameter(outputAssemblyPath));

            if (settings.TargetKind != TargetKind.Default)
            {
                builder.AppendText(GetTargetKindParameter(settings));
            }

            if (settings.Internalize)
            {
                builder.AppendText("/internalize");
            }

            // Add primary assembly.
            builder.AppendQuotedText(primaryAssemblyFilePath.MakeAbsolute(_environment).FullPath);

            foreach (var file in assemblyPaths)
            {
                builder.AppendQuotedText(file.MakeAbsolute(_environment).FullPath);
            }

            // Create the process start info.
            return(builder);
        }
コード例 #2
0
        private ToolArgumentBuilder GetArguments(FilePath targetFilePath, NuGetRestoreSettings settings)
        {
            var builder = new ToolArgumentBuilder();

            builder.AppendText("restore");
            builder.AppendQuotedText(targetFilePath.MakeAbsolute(_environment).FullPath);

            // RequireConsent?
            if (settings.RequireConsent)
            {
                builder.AppendText("-RequireConsent");
            }

            // Packages Directory
            if (settings.PackagesDirectory != null)
            {
                builder.AppendText("-PackagesDirectory");
                builder.AppendQuotedText(settings.PackagesDirectory.MakeAbsolute(_environment).FullPath);
            }

            // List of package sources
            if (settings.Source != null && settings.Source.Count > 0)
            {
                builder.AppendText("-Source");
                builder.AppendQuotedText(string.Join(";", settings.Source));
            }

            // No Cache?
            if (settings.NoCache)
            {
                builder.AppendText("-NoCache");
            }

            // Disable Parallel Processing?
            if (settings.DisableParallelProcessing)
            {
                builder.AppendText("-DisableParallelProcessing");
            }

            // Verbosity?
            if (settings.Verbosity.HasValue)
            {
                builder.AppendText("-Verbosity");
                builder.AppendText(settings.Verbosity.Value.ToString().ToLowerInvariant());
            }

            // Configuration file
            if (settings.ConfigFile != null)
            {
                builder.AppendText("-ConfigFile");
                builder.AppendQuotedText(settings.ConfigFile.MakeAbsolute(_environment).FullPath);
            }

            builder.AppendText("-NonInteractive");

            return(builder);
        }
コード例 #3
0
        private ToolArgumentBuilder GetArguments(IEnumerable <FilePath> objectFiles, LightSettings settings)
        {
            var builder = new ToolArgumentBuilder();

            // Add defines
            if (settings.Defines != null && settings.Defines.Any())
            {
                var defines = settings.Defines.Select(define => string.Format(CultureInfo.InvariantCulture, "-d{0}={1}", define.Key, define.Value));
                foreach (var define in defines)
                {
                    builder.AppendText(define);
                }
            }

            // Add extensions
            if (settings.Extensions != null && settings.Extensions.Any())
            {
                var extensions = settings.Extensions.Select(extension => string.Format(CultureInfo.InvariantCulture, "-ext {0}", extension));
                foreach (var extension in extensions)
                {
                    builder.AppendText(extension);
                }
            }

            // No logo
            if (settings.NoLogo)
            {
                builder.AppendText("-nologo");
            }

            // Output file
            if (settings.OutputFile != null && !string.IsNullOrEmpty(settings.OutputFile.FullPath))
            {
                builder.AppendText("-o");
                builder.AppendQuotedText(settings.OutputFile.MakeAbsolute(_environment).FullPath);
            }

            // Raw arguments
            if (!string.IsNullOrEmpty(settings.RawArguments))
            {
                builder.AppendText(settings.RawArguments);
            }

            // Object files (.wixobj)
            foreach (var objectFile in objectFiles.Select(file => file.MakeAbsolute(_environment).FullPath))
            {
                builder.AppendQuotedText(objectFile);
            }

            return(builder);
        }
コード例 #4
0
ファイル: NUnitRunner.cs プロジェクト: sjmcallister/cake
        private ToolArgumentBuilder GetArguments(FilePath assemblyPath, NUnitSettings settings)
        {
            var builder = new ToolArgumentBuilder();

            // Add the assembly to build.
            builder.AppendQuotedText(assemblyPath.MakeAbsolute(_environment).FullPath);

            // No shadow copy?
            if (!settings.ShadowCopy)
            {
                builder.AppendQuotedText("/noshadow");
            }

            return(builder);
        }
コード例 #5
0
        private ToolArgumentBuilder GetArguments(FilePath nuspecFilePath, NuGetPackSettings settings)
        {
            var builder = new ToolArgumentBuilder();

            builder.AppendText("pack");

            // Version
            if (!string.IsNullOrWhiteSpace(settings.Version))
            {
                builder.AppendText("-Version");
                builder.AppendQuotedText(settings.Version);
            }

            // Base path
            if (settings.BasePath != null)
            {
                builder.AppendText("-BasePath");
                builder.AppendQuotedText(settings.BasePath.MakeAbsolute(_environment).FullPath);
            }

            // Output directory
            if (settings.OutputDirectory != null)
            {
                builder.AppendText("-OutputDirectory");
                builder.AppendQuotedText(settings.OutputDirectory.MakeAbsolute(_environment).FullPath);
            }

            // Nuspec file
            builder.AppendQuotedText(nuspecFilePath.MakeAbsolute(_environment).FullPath);

            // No package analysis?
            if (settings.NoPackageAnalysis)
            {
                builder.AppendText("-NoPackageAnalysis");
            }

            // Symbols?
            if (settings.Symbols)
            {
                builder.AppendText("-Symbols");
            }

            return(builder);
        }
コード例 #6
0
ファイル: NuGetPusher.cs プロジェクト: sjmcallister/cake
        private ToolArgumentBuilder GetArguments(FilePath packageFilePath, NuGetPushSettings settings)
        {
            var builder = new ToolArgumentBuilder();

            builder.AppendText("push");

            builder.AppendQuotedText(packageFilePath.MakeAbsolute(_environment).FullPath);

            if (settings.ApiKey != null)
            {
                builder.AppendText(settings.ApiKey);
            }

            builder.AppendText("-NonInteractive");

            if (settings.ConfigFile != null)
            {
                builder.AppendText("-ConfigFile");
                builder.AppendQuotedText(settings.ConfigFile.MakeAbsolute(_environment).FullPath);
            }

            if (settings.Source != null)
            {
                builder.AppendText("-Source");
                builder.AppendQuotedText(settings.Source);
            }

            if (settings.Timeout != null)
            {
                builder.AppendText("-Timeout");
                builder.AppendText(Convert.ToInt32(settings.Timeout.Value.TotalSeconds).ToString(CultureInfo.InvariantCulture));
            }

            if (settings.Verbosity != null)
            {
                builder.AppendText("-Verbosity");
                builder.AppendText(settings.Verbosity.Value.ToString().ToLowerInvariant());
            }

            return(builder);
        }
コード例 #7
0
        private ToolArgumentBuilder GetArguments(FilePath assemblyPath, XUnitSettings settings)
        {
            var builder = new ToolArgumentBuilder();

            // Add the assembly to build.
            builder.AppendQuotedText(assemblyPath.MakeAbsolute(_environment).FullPath);

            // No shadow copy?
            if (!settings.ShadowCopy)
            {
                builder.AppendQuotedText("/noshadow");
            }

            // Generate HTML report?
            if (settings.HtmlReport)
            {
                var assemblyFilename = assemblyPath.GetFilename().AppendExtension(".html");
                var outputPath       = settings.OutputDirectory.GetFilePath(assemblyFilename);

                builder.AppendQuotedText("/html");
                builder.AppendQuotedText(outputPath.FullPath);
            }

            // Generate XML report?
            if (settings.XmlReport)
            {
                var assemblyFilename = assemblyPath.GetFilename().AppendExtension(".xml");
                var outputPath       = settings.OutputDirectory.GetFilePath(assemblyFilename);

                builder.AppendQuotedText("/xml");
                builder.AppendQuotedText(outputPath.FullPath);
            }

            return(builder);
        }
コード例 #8
0
ファイル: MSTestRunner.cs プロジェクト: sjmcallister/cake
        private ToolArgumentBuilder GetArguments(FilePath assemblyPath, MSTestSettings settings)
        {
            var builder = new ToolArgumentBuilder();

            // Add the assembly to build.
            builder.AppendText(string.Concat("/testcontainer:", assemblyPath.MakeAbsolute(_environment).FullPath).Quote());

            if (settings.NoIsolation)
            {
                builder.AppendQuotedText("/noisolation");
            }

            return(builder);
        }
コード例 #9
0
ファイル: CandleRunner.cs プロジェクト: sjmcallister/cake
        private ToolArgumentBuilder GetArguments(IEnumerable <FilePath> sourceFiles, CandleSettings settings)
        {
            var builder = new ToolArgumentBuilder();

            // Architecture
            if (settings.Architecture.HasValue)
            {
                builder.AppendText("-arch");
                builder.AppendText(GetArchitectureName(settings.Architecture.Value));
            }

            // Add defines
            if (settings.Defines != null && settings.Defines.Any())
            {
                var defines = settings.Defines.Select(define => string.Format(CultureInfo.InvariantCulture, "-d{0}={1}", define.Key, define.Value));
                foreach (var define in defines)
                {
                    builder.AppendText(define);
                }
            }

            // Add extensions
            if (settings.Extensions != null && settings.Extensions.Any())
            {
                var extensions = settings.Extensions.Select(extension => string.Format(CultureInfo.InvariantCulture, "-ext {0}", extension));
                foreach (var extension in extensions)
                {
                    builder.AppendText(extension);
                }
            }

            // FIPS
            if (settings.FIPS)
            {
                builder.AppendText("-fips");
            }

            // No logo
            if (settings.NoLogo)
            {
                builder.AppendText("-nologo");
            }

            // Output directory
            if (settings.OutputDirectory != null && !string.IsNullOrEmpty(settings.OutputDirectory.FullPath))
            {
                // Candle want the path to end with \\, double separator chars.
                var separatorChar = System.IO.Path.DirectorySeparatorChar;
                var fullPath      = string.Concat(settings.OutputDirectory.MakeAbsolute(_environment).FullPath, separatorChar, separatorChar);

                builder.AppendText("-o");
                builder.AppendQuotedText(fullPath);
            }

            // Pedantic
            if (settings.Pedantic)
            {
                builder.AppendText("-pedantic");
            }

            // Show source trace
            if (settings.ShowSourceTrace)
            {
                builder.AppendText("-trace");
            }

            // Verbose
            if (settings.Verbose)
            {
                builder.AppendText("-v");
            }

            // Source files (.wxs)
            foreach (var sourceFile in sourceFiles.Select(file => file.MakeAbsolute(_environment).FullPath))
            {
                builder.AppendQuotedText(sourceFile);
            }

            return(builder);
        }