コード例 #1
0
        private static void PushPackage(ArgumentOptions args, PackageOptions options, bool pushSymbolPackage)
        {
            var startInfo = new ProcessStartInfo
            {
                Arguments        = options.GetPushCommandArgs(args, pushSymbolPackage),
                FileName         = Path.Combine(args.PathToNuGet, "NuGet.exe"),
                CreateNoWindow   = false,
                UseShellExecute  = false,
                WorkingDirectory = args.WorkingDirectory
            };

            Console.WriteLine("{0} {1}", startInfo.FileName, startInfo.Arguments);
            using (var process = Process.Start(startInfo))
            {
                process.WaitForExit();
            }
        }
コード例 #2
0
		private static void PushPackage(ArgumentOptions args, PackageOptions options)
		{
			var startInfo = new ProcessStartInfo
			{
				Arguments = options.GetPushCommandArgs(args),
				FileName = Path.Combine(args.PathToNuGet, "NuGet.exe"),
				CreateNoWindow = false,
				UseShellExecute = false,
				WorkingDirectory = args.WorkingDirectory
			};

			Console.WriteLine("{0} {1}", startInfo.FileName, startInfo.Arguments);
			using (var process = Process.Start(startInfo))
			{
				process.WaitForExit(5000);
			}
		}
コード例 #3
0
        private static void CreatePublishCommand(ArgumentOptions args, PackageOptions options)
        {
            var solutionDir = Directory.GetParent(args.PathToNuGet + @"\..\..\..\").FullName;
            var outputFile  = Path.Combine(solutionDir, string.Format("publish_{0}.cmd", args.TargetName));

            Console.WriteLine(outputFile);
            if (File.Exists(outputFile))
            {
                File.Delete(outputFile);
            }

            if (string.IsNullOrWhiteSpace(args.OverrideApiKey) && string.IsNullOrWhiteSpace(options.Publish.ApiKey))
            {
                args.OverrideApiKey = "%1";
            }

            if (string.IsNullOrWhiteSpace(args.OverrideSource) && string.IsNullOrWhiteSpace(options.Publish.Source))
            {
                args.OverrideSource = "%2";
            }

            File.WriteAllText(
                outputFile,
                string.Format("\"{0}\" {1}", Path.Combine(args.PathToNuGet, "NuGet.exe"), options.GetPushCommandArgs(args, false))
                );
        }
コード例 #4
0
		//Publish Get-ChildItem -Path "C:\Users\Lars\Documents\visual studio 2013\Projects\ClassLibrary2" -File publish_*.cmd | Foreach { & $_.FullName 'apikey', 'https://mysource' }
		private static void CreatePublishCommand(ArgumentOptions args, PackageOptions options)
		{
			var solutionDir = Directory.GetParent(args.PathToNuGet + @"\..\..\..\").FullName;
			var outputFile = Path.Combine(solutionDir, string.Format("publish_{0}.cmd", args.TargetName));
			Console.WriteLine(outputFile);
			if (File.Exists(outputFile))
				File.Delete(outputFile);

			if (string.IsNullOrWhiteSpace(args.OverrideApiKey) && string.IsNullOrWhiteSpace(options.Publish.ApiKey))
				args.OverrideApiKey = "%1";

			if (string.IsNullOrWhiteSpace(args.OverrideSource) && string.IsNullOrWhiteSpace(options.Publish.Source))
				args.OverrideSource = "%2";

			File.WriteAllText(
				outputFile, 
				string.Format("\"{0}\" {1}", Path.Combine(args.PathToNuGet, "NuGet.exe"), options.GetPushCommandArgs(args))
			);
		}