Exemplo n.º 1
0
        protected void Execute(string args)
        {
            if (!File.Exists(toolPath))
            {
                throw new FileNotFoundException(string.Format("Could not execute the file '{0}' as it does not exist.", toolPath));
            }

            IOFunctions.exec(toolPath, args);
        }
Exemplo n.º 2
0
        protected override void Execute()
        {
            if (string.IsNullOrEmpty(program))
            {
                throw new InvalidOperationException("The 'program' property must be specified.");
            }

            if (string.IsNullOrEmpty(testAssembly))
            {
                throw new InvalidOperationException("The 'assembly' property must be specified.");
            }

            if (applicationAssemblies == null || applicationAssemblies.Length == 0)
            {
                throw new InvalidOperationException("Please specify the 'applicationAssemblies' property as an array of strings.");
            }

            IOFunctions.mkdir(reportDirectory);

            string assembliesJoined = applicationAssemblies.JoinWith(";");
            string additionalArgs   = args.JoinWith(" ");

            var testAssemblyFile = new FileInfo(testAssembly);
            var reportDir        = new DirectoryInfo(reportDirectory);

            string xmlPath = Path.Combine(reportDir.FullName, testAssemblyFile.Name + ".Coverage.xml");
            string logPath = Path.Combine(reportDir.FullName, testAssemblyFile.Name + ".Coverage.log");

            string applicationArgs = string.Format("{0} {1} {2} //a {3} //w {4} //x {5} //l {6} //v",
                                                   program, testAssembly, additionalArgs, assembliesJoined, workingDirectory,
                                                   xmlPath, logPath);

            if (!string.IsNullOrEmpty(excludeAttributes))
            {
                applicationArgs += string.Format(" //ea {0}", excludeAttributes);
            }

            Execute(applicationArgs);
        }
Exemplo n.º 3
0
        protected override void Execute()
        {
            if (string.IsNullOrWhiteSpace(nuspecFile))
            {
                throw new InvalidOperationException("Nuspec file to pack must be specified.");
            }
            nugetArgs.AppendFormat("pack \"{0}\"", Path.GetFullPath(nuspecFile));

            if (string.IsNullOrWhiteSpace(basePath))
            {
                basePath = Environment.CurrentDirectory;
            }
            nugetArgs.AppendFormat(" -basePath \"{0}\"", Path.GetFullPath(basePath));

            if (!string.IsNullOrWhiteSpace(outputDirectory))
            {
                outputDirectory = Path.GetFullPath(outputDirectory);
                nugetArgs.AppendFormat(" -outputDirectory \"{0}\"", outputDirectory);
                IOFunctions.mkdir(outputDirectory);
            }

            if (!string.IsNullOrWhiteSpace(version))
            {
                nugetArgs.AppendFormat(" -version \"{0}\"", version);
            }

            if (symbols)
            {
                nugetArgs.Append(" -symbols");
            }

            if (verbose)
            {
                nugetArgs.Append(" -verbose");
            }

            Execute(nugetArgs.ToString());
        }