public ConsoleHostMSBuildNuGetProject(
     ConsoleHostMSBuildNuGetProjectSystem projectSystem,
     string folderNuGetProjectFullPath,
     string packagesConfigFolderPath)
     : base(projectSystem, folderNuGetProjectFullPath, packagesConfigFolderPath)
 {
     this.projectSystem = projectSystem;
 }
        public NuGetProject CreateNuGetProject(DotNetProject project, INuGetProjectContext context)
        {
            Runtime.AssertMainThread();

            var nugetAwareProject = project as INuGetAwareProject;

            if (nugetAwareProject != null)
            {
                return(nugetAwareProject.CreateNuGetProject());
            }

            NuGetProject dotNetCoreProject = DotNetCoreNuGetProject.Create(project);

            if (dotNetCoreProject != null)
            {
                return(dotNetCoreProject);
            }

            NuGetProject packageReferenceProject = PackageReferenceNuGetProject.Create(project);

            if (packageReferenceProject != null)
            {
                return(packageReferenceProject);
            }

            var projectSystem = new ConsoleHostMSBuildNuGetProjectSystem(project, context);

            string projectJsonPath = ProjectJsonPathUtilities.GetProjectConfigPath(project.BaseDirectory, project.Name);

            if (File.Exists(projectJsonPath))
            {
                return(new ProjectJsonBuildIntegratedNuGetProject(
                           projectJsonPath,
                           project.FileName,
                           project,
                           settings));
            }

            string baseDirectory = GetBaseDirectory(project);
            string folderNuGetProjectFullPath = PackagesFolderPathUtility.GetPackagesFolderPath(baseDirectory, settings);

            string packagesConfigFolderPath = project.BaseDirectory;

            return(new ConsoleHostMSBuildNuGetProject(
                       projectSystem,
                       folderNuGetProjectFullPath,
                       packagesConfigFolderPath));
        }