コード例 #1
0
        private static void SetupStaticTestProject()
        {
            AssetsRoot = Path.Combine(AppContext.BaseDirectory, "bin");
            RestoredTestProjectDirectory = Path.Combine(AssetsRoot, s_testdirName);

            // Ignore Delete Failure
            try
            {
                Directory.Delete(RestoredTestProjectDirectory, true);
            }
            catch (Exception) { }

            Directory.CreateDirectory(RestoredTestProjectDirectory);

            // Todo: this is a hack until corefx is on nuget.org remove this After RC 2 Release
            NuGetConfig.Write(RestoredTestProjectDirectory);

            var newCommand = new NewCommand();

            newCommand.WorkingDirectory = RestoredTestProjectDirectory;
            newCommand.Execute().Should().Pass();

            var restoreCommand = new Restore3Command();

            restoreCommand.WorkingDirectory = RestoredTestProjectDirectory;
            restoreCommand.Execute("/p:SkipInvalidConfigurations=true")
            .Should().Pass();
        }
コード例 #2
0
        /// <summary>
        /// Ensures that the project has been restored for the specified runtime.
        /// </summary>
        private int EnsureRestored()
        {
            int result = 0;

            if (!string.IsNullOrEmpty(Runtime))
            {
                result = Restore3Command.Run(new[] { $"/p:RuntimeIdentifiers={Runtime}" });
            }

            return(result);
        }
コード例 #3
0
        private void Restore3(string projectDirectory, string projectName = null)
        {
            var command = new Restore3Command()
                          .WithWorkingDirectory(projectDirectory);

            if (projectName != null)
            {
                command.Execute($"{projectName}.csproj /p:SkipInvalidConfigurations=true")
                .Should().Pass();
            }
            else
            {
                command.Execute("/p:SkipInvalidConfigurations=true")
                .Should().Pass();
            }
        }
コード例 #4
0
        private void Restore3(string projectDirectory, string projectName = null)
        {
            var command = new Restore3Command()
                          .WithWorkingDirectory(projectDirectory);

            if (projectName != null)
            {
                command.Execute($"{projectName}.csproj")
                .Should()
                .Pass();
            }
            else
            {
                command.Execute()
                .Should()
                .Pass();
            }
        }