Exemplo n.º 1
0
        public LockFilePatcher(LockFile lockFile, LockFileReader reader)
        {
            _lockFile = lockFile;
            _reader   = reader;

            var msbuildProjectLibraries = lockFile.ProjectLibraries.Where(MSBuildDependencyProvider.IsMSBuildProjectLibrary);

            _msbuildTargetLibraries = msbuildProjectLibraries.ToDictionary(GetProjectLibraryKey, l => GetTargetsForLibrary(_lockFile, l));
        }
Exemplo n.º 2
0
        public void Patch()
        {
            var exportFilePath = GetExportFilePath(_lockFile.LockFilePath);

            if (File.Exists(exportFilePath) && _msbuildTargetLibraries.Any())
            {
                var exportFile = LockFileReader.ReadExportFile(exportFilePath);
                PatchLockWithExport(exportFile);
            }
            else
            {
                ThrowIfAnyMsbuildLibrariesPresent();
            }
        }