private MSBuildNuGetProject GetProject(string project, ICanAddFileStrategy canAddFileStrategy = null) { MSBuildNuGetProject msBuildNuGetProject; if (!_loadedMsBuildNuGetProjects.TryGetValue(project, out msBuildNuGetProject)) { var msbuildNuGetProjectSystem = new CustomMsbuildProjectSystem( msbuildDirectory: MsBuildUtility.GetMsbuildDirectory(null, _console), projectFullPath: project, projectContext: _nuGetProjectContext); msBuildNuGetProject = new MSBuildNuGetProject( msbuildNuGetProjectSystem: msbuildNuGetProjectSystem, folderNuGetProjectPath: _packagesFolder, packagesConfigFolderPath: Path.GetDirectoryName(project)); _loadedMsBuildNuGetProjects.Add(project, msBuildNuGetProject); } ((CustomMsbuildProjectSystem)msBuildNuGetProject.MSBuildNuGetProjectSystem).ApplyCanAddFileStrategy(canAddFileStrategy); return(msBuildNuGetProject); }
public void ApplyCanAddFileStrategy(ICanAddFileStrategy canAddFileStrategy) { _canAddFileStrategy = canAddFileStrategy; }