Skip to content

Commit

Permalink
Show warning when paket.references is used in nupkg content - fixes #…
Browse files Browse the repository at this point in the history
  • Loading branch information
forki committed Jan 5, 2016
1 parent 5ef1cc1 commit e7f4636
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 9 deletions.
3 changes: 3 additions & 0 deletions RELEASE_NOTES.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
#### 2.40.5 - 05.01.2016
* USABILITY: Show warning when paket.references is used in nupkg content - https://github.com/fsprojects/Paket/issues/1344

#### 2.40.4 - 03.01.2016
* USABILITY: Report group name in download trace - https://github.com/fsprojects/Paket/issues/1337

Expand Down
12 changes: 7 additions & 5 deletions src/Paket.Core/InstallProcess.fs
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,9 @@ let processContentFiles root project (usedPackages:Map<_,_>) gitRemoteItems opti
|> List.append
(fromDir.GetFiles()
|> Array.toList
|> List.filter (onBlackList >> not)
|> List.filter (fun file ->
if onBlackList file then false else
if file.Name = "paket.references" then traceWarnfn "You can't use paket.references as a content file in the root of a project. Please take a look at %s" file.FullName; false else true)
|> List.map (fun file ->
let overwrite = settings = ContentCopySettings.Overwrite
let target = FileInfo(Path.Combine(toDir.Force().FullName, file.Name))
Expand Down Expand Up @@ -119,7 +121,7 @@ let processContentFiles root project (usedPackages:Map<_,_>) gitRemoteItems opti
removeEmptyDirHierarchy (DirectoryInfo dirPath)

project.GetPaketFileItems()
|> List.filter (fun fi -> not <| fi.FullName.Contains(Constants.PaketFilesFolderName) && not (contentFiles.Contains(fi.FullName)))
|> List.filter (fun fi -> not <| fi.FullName.Contains(Constants.PaketFilesFolderName) && not (contentFiles.Contains(fi.FullName)) && fi.Name <> "paket.references")
|> removeFilesAndTrimDirs

removeCopiedFiles project
Expand Down Expand Up @@ -264,10 +266,10 @@ let findAllReferencesFiles root =
|> collect

/// Installs all packages from the lock file.
let InstallIntoProjects(options : InstallerOptions, dependenciesFile, lockFile : LockFile, projects : (ProjectFile * ReferencesFile) list) =
let InstallIntoProjects(options : InstallerOptions, dependenciesFile, lockFile : LockFile, projectsAndReferences : (ProjectFile * ReferencesFile) list) =
let packagesToInstall =
if options.OnlyReferenced then
projects
projectsAndReferences
|> List.map (fun (_, referencesFile)->
referencesFile
|> lockFile.GetPackageHull
Expand All @@ -281,7 +283,7 @@ let InstallIntoProjects(options : InstallerOptions, dependenciesFile, lockFile :
let model = CreateModel(root, options.Force, dependenciesFile, lockFile, Set.ofSeq packagesToInstall) |> Map.ofArray
let lookup = lockFile.GetDependencyLookupTable()

for project : ProjectFile, referenceFile in projects do
for project, referenceFile in projectsAndReferences do
verbosefn "Installing to %s" project.FileName

let usedPackages =
Expand Down
4 changes: 2 additions & 2 deletions src/Paket.Core/UpdateProcess.fs
Original file line number Diff line number Diff line change
Expand Up @@ -193,10 +193,10 @@ let SmartInstall(dependenciesFile, updateMode, options : UpdaterOptions) =
let lockFile = SelectiveUpdate(dependenciesFile, updateMode, options.Common.SemVerUpdateMode, options.Common.Force)

let root = Path.GetDirectoryName dependenciesFile.FileName
let projects = InstallProcess.findAllReferencesFiles root |> returnOrFail
let projectsAndReferences = InstallProcess.findAllReferencesFiles root |> returnOrFail

if not options.NoInstall then
InstallProcess.InstallIntoProjects(options.Common, dependenciesFile, lockFile, projects)
InstallProcess.InstallIntoProjects(options.Common, dependenciesFile, lockFile, projectsAndReferences)

/// Update a single package command
let UpdatePackage(dependenciesFileName, groupName, packageName : PackageName, newVersion, options : UpdaterOptions) =
Expand Down
4 changes: 2 additions & 2 deletions src/Paket/Paket.fsproj
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
<StartArguments>pack output D:\code\paketbug\output</StartArguments>
<StartArguments>install</StartArguments>
<StartArguments>restore</StartArguments>
<StartArguments>update -f</StartArguments>
<StartArguments>install</StartArguments>
<StartAction>Project</StartAction>
<StartProgram>paket.exe</StartProgram>
<StartWorkingDirectory>c:\code\Paketkopie</StartWorkingDirectory>
Expand All @@ -48,7 +48,7 @@
<StartWorkingDirectory>d:\code\paketrepro</StartWorkingDirectory>
<StartWorkingDirectory>D:\code\Paket\integrationtests\scenarios\i001270-net461\temp</StartWorkingDirectory>
<StartWorkingDirectory>C:\code\restore</StartWorkingDirectory>
<StartWorkingDirectory>D:\code\FSharpVSPowerTools\</StartWorkingDirectory>
<StartWorkingDirectory>D:\code\ConsoleApplication8</StartWorkingDirectory>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
Expand Down

0 comments on commit e7f4636

Please sign in to comment.