Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix another bug when paket finds no references file.
  • Loading branch information
matthid committed Aug 28, 2017
commit bac79f1f24c0de119760d6aa9b1afdcaa782641b
6 changes: 5 additions & 1 deletion src/Paket.Core/Installation/RestoreProcess.fs
Original file line number Diff line number Diff line change
Expand Up @@ -344,7 +344,11 @@ let createProjectReferencesFiles (dependenciesFile:DependenciesFile) (lockFile:L

// Write "cached" file, this way msbuild can check if the references file has changed.
let paketCachedReferencesFileName = FileInfo(Path.Combine(projectFileInfo.Directory.FullName,"obj",projectFileInfo.Name + ".paket.references.cached"))
File.Copy(referencesFile.FileName, paketCachedReferencesFileName.FullName, true)
if File.Exists (referencesFile.FileName) then
File.Copy(referencesFile.FileName, paketCachedReferencesFileName.FullName, true)
else
// it can happen that the references file doesn't exist if paket doesn't find one in that case we update the cache by deleting it.
if paketCachedReferencesFileName.Exists then paketCachedReferencesFileName.Delete()

let CreateScriptsForGroups dependenciesFile lockFile (groups:Map<GroupName,LockFileGroup>) =
let groupsToGenerate =
Expand Down
5 changes: 5 additions & 0 deletions src/Paket/embedded/Paket.Restore.targets
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,11 @@
<PaketRestoreRequired Condition=" '$(PaketRestoreReferencesFileHash)' == '$(PaketRestoreCachedHash)' ">false</PaketRestoreRequired>
</PropertyGroup>

<PropertyGroup Condition="!Exists('$(PaketOriginalReferencesFilePath)') AND !Exists('$(PaketReferencesCachedFilePath)') ">
<!-- If both don't exist there is nothing to do. -->
<PaketRestoreRequired>false</PaketRestoreRequired>
</PropertyGroup>

<!-- Step 2 b detect relevant changes in project file (new targetframework) -->
<PropertyGroup Condition=" !Exists('$(PaketResolvedFilePath)') AND '$(TargetFramework)' != '' ">
<PaketRestoreRequired>true</PaketRestoreRequired>
Expand Down