Skip to content

Commit

Permalink
Merge branch 'master' into v3
Browse files Browse the repository at this point in the history
Conflicts:
	RELEASE_NOTES.md
	src/Paket.Bootstrapper/Properties/AssemblyInfo.cs
	src/Paket.Core/AssemblyInfo.fs
	src/Paket.PowerShell/AssemblyInfo.fs
	src/Paket/AssemblyInfo.fs
  • Loading branch information
forki committed Jan 5, 2016
2 parents 553a82b + 2e6dd01 commit 290ac56
Show file tree
Hide file tree
Showing 13 changed files with 63 additions and 54 deletions.
5 changes: 4 additions & 1 deletion RELEASE_NOTES.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
#### 3.0.0-alpha002 - 05.01.2016
#### 3.0.0-alpha003 - 05.01.2016
* Allow to reference git repositories

#### 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
4 changes: 2 additions & 2 deletions integrationtests/Paket.IntegrationTests/FullGitSpecs.fs
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,5 @@ let ``#284 should use git.exe to restore``() =
let gistDir = Path.Combine(paketFilesRoot,"gist.github.com","89d8f9fd6d466224da04")
Git.Handling.getCurrentHash gistDir |> shouldEqual (Some "b14d55a8844f092b44b9155c904c8a3f2d9d9f46")

let chessieDir = Path.Combine(paketFilesRoot,"github.com","Chessie")
Git.Handling.getCurrentHash chessieDir |> shouldEqual (Some "c22448cb3755b2df1e15d8ad5f0f15635ac5914e")
let chessieDir = Path.Combine(paketFilesRoot,"github.com","AskMe")
Git.Handling.getCurrentHash chessieDir |> shouldEqual (Some "23c2cf83495c9096f9bdd9d629a0849e3e853f42")
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
git https://gist.github.com/89d8f9fd6d466224da04.git
git [email protected]:fsprojects/Chessie.git
git [email protected]:forki/AskMe.git
2 changes: 1 addition & 1 deletion src/Paket.Bootstrapper/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
[assembly: AssemblyDescriptionAttribute("A package dependency manager for .NET with support for NuGet packages and GitHub repositories.")]
[assembly: AssemblyVersionAttribute("3.0.0")]
[assembly: AssemblyFileVersionAttribute("3.0.0")]
[assembly: AssemblyInformationalVersionAttribute("3.0.0-alpha002")]
[assembly: AssemblyInformationalVersionAttribute("3.0.0-alpha003")]
namespace System {
internal static class AssemblyVersionInformation {
internal const string Version = "3.0.0";
Expand Down
2 changes: 1 addition & 1 deletion src/Paket.Core/AssemblyInfo.fs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ open System.Reflection
[<assembly: AssemblyDescriptionAttribute("A package dependency manager for .NET with support for NuGet packages and GitHub repositories.")>]
[<assembly: AssemblyVersionAttribute("3.0.0")>]
[<assembly: AssemblyFileVersionAttribute("3.0.0")>]
[<assembly: AssemblyInformationalVersionAttribute("3.0.0-alpha002")>]
[<assembly: AssemblyInformationalVersionAttribute("3.0.0-alpha003")>]
do ()

module internal AssemblyVersionInformation =
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
31 changes: 18 additions & 13 deletions src/Paket.Core/ProjectFile.fs
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,14 @@ open System.Collections.Generic
open Paket.Xml
open Paket.Requirements

[<RequireQualifiedAccess>]
type BuildAction =
| Compile
| Content

/// File item inside of project files.
type FileItem =
{ BuildAction : string
{ BuildAction : BuildAction
Include : string
Link : string option }

Expand Down Expand Up @@ -454,16 +459,16 @@ type ProjectFile =
let firstItemGroup = this.ProjectNode |> getNodes "ItemGroup" |> List.tryHead
match firstItemGroup with
| None ->
["Content", this.CreateNode("ItemGroup")
"Compile", this.CreateNode("ItemGroup") ]
[BuildAction.Content, this.CreateNode("ItemGroup")
BuildAction.Compile, this.CreateNode("ItemGroup") ]
| Some node ->
["Content", node :?> XmlElement
"Compile", node :?> XmlElement ]
[BuildAction.Content, node :?> XmlElement
BuildAction.Compile, node :?> XmlElement ]
|> dict

for fileItem in fileItems |> List.rev do
let libReferenceNode =
this.CreateNode(fileItem.BuildAction)
this.CreateNode(fileItem.BuildAction.ToString())
|> addAttribute "Include" fileItem.Include
|> addChild (this.CreateNode("Paket","True"))
|> fun n -> match fileItem.Link with
Expand All @@ -472,7 +477,7 @@ type ProjectFile =

let fileItemsInSameDir =
this.Document
|> getDescendants fileItem.BuildAction
|> getDescendants (fileItem.BuildAction.ToString())
|> List.filter (fun node ->
match node |> getAttribute "Include" with
| Some path when path.StartsWith(Path.GetDirectoryName(fileItem.Include)) -> true
Expand Down Expand Up @@ -538,7 +543,7 @@ type ProjectFile =
if nodesToDelete <> [] then
verbosefn " - Deleting custom projects nodes for %O" model.PackageName

for node in nodesToDelete do
for node in nodesToDelete do
node.ParentNode.RemoveChild(node) |> ignore

member private this.GenerateAnalyzersXml(model:InstallModel) =
Expand Down Expand Up @@ -726,16 +731,16 @@ type ProjectFile =
this.DeletePaketNodes("Analyzer")
this.DeletePaketNodes("Reference")

let rec PaketNodes (node:XmlNode) =
let rec getPaketNodes (node:XmlNode) =
[for node in node.ChildNodes do
if node.Name.Contains("__paket__") ||
(node.Name = "Import" && match node |> getAttribute "Project" with Some v -> v.Contains("__paket__") | None -> false) ||
(node |> withAttributeValue "Label" "Paket")
then
yield node
yield! PaketNodes node]
yield! getPaketNodes node]

for node in PaketNodes this.Document do
for node in getPaketNodes this.Document do
let parent = node.ParentNode
try
node.ParentNode.RemoveChild(node) |> ignore
Expand Down Expand Up @@ -981,8 +986,8 @@ type ProjectFile =

member this.DetermineBuildAction fileName =
if Path.GetExtension(this.FileName) = Path.GetExtension(fileName) + "proj"
then "Compile"
else "Content"
then BuildAction.Compile
else BuildAction.Content

member this.GetOutputDirectory buildConfiguration buildPlatform =
let platforms =
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
2 changes: 1 addition & 1 deletion src/Paket.PowerShell/AssemblyInfo.fs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ open System.Reflection
[<assembly: AssemblyDescriptionAttribute("A package dependency manager for .NET with support for NuGet packages and GitHub repositories.")>]
[<assembly: AssemblyVersionAttribute("3.0.0")>]
[<assembly: AssemblyFileVersionAttribute("3.0.0")>]
[<assembly: AssemblyInformationalVersionAttribute("3.0.0-alpha002")>]
[<assembly: AssemblyInformationalVersionAttribute("3.0.0-alpha003")>]
do ()

module internal AssemblyVersionInformation =
Expand Down
2 changes: 1 addition & 1 deletion src/Paket/AssemblyInfo.fs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ open System.Reflection
[<assembly: AssemblyDescriptionAttribute("A package dependency manager for .NET with support for NuGet packages and GitHub repositories.")>]
[<assembly: AssemblyVersionAttribute("3.0.0")>]
[<assembly: AssemblyFileVersionAttribute("3.0.0")>]
[<assembly: AssemblyInformationalVersionAttribute("3.0.0-alpha002")>]
[<assembly: AssemblyInformationalVersionAttribute("3.0.0-alpha003")>]
do ()

module internal AssemblyVersionInformation =
Expand Down
1 change: 1 addition & 0 deletions src/Paket/Paket.fsproj
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@
<StartWorkingDirectory>D:\code\FSharpVSPowerTools\</StartWorkingDirectory>
<StartWorkingDirectory>C:\code\Paket\integrationtests\scenarios\i001334-download-fail\temp</StartWorkingDirectory>
<StartWorkingDirectory>d:\code\Paket\integrationtests\scenarios\i000284-full-git\temp\</StartWorkingDirectory>
<StartWorkingDirectory>D:\code\ConsoleApplication8</StartWorkingDirectory>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
Expand Down
14 changes: 6 additions & 8 deletions tests/Paket.Tests/ProjectFile/FileBuildActionSpecs.fs
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,12 @@ let createProject name =

[<Test>]
let ``should recognize compilable files``() =

(createProject "A.csproj").DetermineBuildAction "Class.cs" |> shouldEqual "Compile"
(createProject "B.fsproj").DetermineBuildAction "Module.fs" |> shouldEqual "Compile"
(createProject "C.vbproj").DetermineBuildAction "Whatever.vb" |> shouldEqual "Compile"
(createProject "A.csproj").DetermineBuildAction "Class.cs" |> shouldEqual BuildAction.Compile
(createProject "B.fsproj").DetermineBuildAction "Module.fs" |> shouldEqual BuildAction.Compile
(createProject "C.vbproj").DetermineBuildAction "Whatever.vb" |> shouldEqual BuildAction.Compile

[<Test>]
let ``should recognize content files``() =

(createProject "A.csproj").DetermineBuildAction "Something.js" |> shouldEqual "Content"
(createProject "B.fsproj").DetermineBuildAction "config.yml" |> shouldEqual "Content"
(createProject "C.vbproj").DetermineBuildAction "noext" |> shouldEqual "Content"
(createProject "A.csproj").DetermineBuildAction "Something.js" |> shouldEqual BuildAction.Content
(createProject "B.fsproj").DetermineBuildAction "config.yml" |> shouldEqual BuildAction.Content
(createProject "C.vbproj").DetermineBuildAction "noext" |> shouldEqual BuildAction.Content
36 changes: 18 additions & 18 deletions tests/Paket.Tests/ProjectFile/OutputSpecs.fs
Original file line number Diff line number Diff line change
Expand Up @@ -63,29 +63,29 @@ let ``should maintain order when updating project file items`` () =

let projFile = ProjectFile.TryLoad("./ProjectFile/TestData/MaintainsOrdering.fsprojtest").Value
let fileItems = [
{ BuildAction = "Compile"; Include = "..\\..\\paket-files\\fsharp\\FSharp.Data\\src\\CommonRuntime\\Pluralizer.fs"; Link = Some("fsharp_data\\Pluralizer.fs") }
{ BuildAction = "Compile"; Include = "..\\..\\paket-files\\fsharp\\FSharp.Data\\src\\CommonRuntime\\NameUtils.fs"; Link = Some("fsharp_data\\NameUtils.fs") }
{ BuildAction = "Compile"; Include = "..\\..\\paket-files\\fsharp\\FSharp.Data\\src\\CommonRuntime\\TextConversions.fs"; Link = Some("fsharp_data\\TextConversions.fs") }
{ BuildAction = "Compile"; Include = "..\\..\\paket-files\\fsharp\\FSharp.Data\\src\\CommonRuntime\\StructuralTypes.fs"; Link = Some("fsharp_data\\StructuralTypes.fs") }
{ BuildAction = "Compile"; Include = "..\\..\\paket-files\\fsharp\\FSharp.Data\\src\\CommonRuntime\\StructuralInference.fs"; Link = Some("fsharp_data\\StructuralInference.fs") }
{ BuildAction = "Compile"; Include = "..\\..\\paket-files\\fsharp\\FSharp.Data\\src\\CommonRuntime\\TextRuntime.fs"; Link = Some("fsharp_data\\TextRuntime.fs") }
{ BuildAction = "Compile"; Include = "DebugProvidedTypes.fs"; Link = None }
{ BuildAction = "Compile"; Include = "ProvidedTypes.fs"; Link = None }
{ BuildAction = "Content"; Include = "ProvidedTypes.fsi"; Link = None }
{ BuildAction = BuildAction.Compile; Include = "..\\..\\paket-files\\fsharp\\FSharp.Data\\src\\CommonRuntime\\Pluralizer.fs"; Link = Some("fsharp_data\\Pluralizer.fs") }
{ BuildAction = BuildAction.Compile; Include = "..\\..\\paket-files\\fsharp\\FSharp.Data\\src\\CommonRuntime\\NameUtils.fs"; Link = Some("fsharp_data\\NameUtils.fs") }
{ BuildAction = BuildAction.Compile; Include = "..\\..\\paket-files\\fsharp\\FSharp.Data\\src\\CommonRuntime\\TextConversions.fs"; Link = Some("fsharp_data\\TextConversions.fs") }
{ BuildAction = BuildAction.Compile; Include = "..\\..\\paket-files\\fsharp\\FSharp.Data\\src\\CommonRuntime\\StructuralTypes.fs"; Link = Some("fsharp_data\\StructuralTypes.fs") }
{ BuildAction = BuildAction.Compile; Include = "..\\..\\paket-files\\fsharp\\FSharp.Data\\src\\CommonRuntime\\StructuralInference.fs"; Link = Some("fsharp_data\\StructuralInference.fs") }
{ BuildAction = BuildAction.Compile; Include = "..\\..\\paket-files\\fsharp\\FSharp.Data\\src\\CommonRuntime\\TextRuntime.fs"; Link = Some("fsharp_data\\TextRuntime.fs") }
{ BuildAction = BuildAction.Compile; Include = "DebugProvidedTypes.fs"; Link = None }
{ BuildAction = BuildAction.Compile; Include = "ProvidedTypes.fs"; Link = None }
{ BuildAction = BuildAction.Content; Include = "ProvidedTypes.fsi"; Link = None }
]
projFile.UpdateFileItems(fileItems, false)

let rec nodes node =
seq {
for node in node |> Seq.cast<XmlNode> do
if node.Name = "Compile" || node.Name = "Content"
if node.Name ="Compile" || node.Name = "Content"
then yield Paket.Xml.getAttribute "Include" node
yield! nodes node
}

let actual =
nodes projFile.Document
|> Seq.choose id
nodes projFile.Document
|> Seq.choose id
|> Seq.toList
let expected =
[
Expand All @@ -111,23 +111,23 @@ let ``should remove missing files that exist in the project`` () =

let projFile = ProjectFile.TryLoad("./ProjectFile/TestData/MaintainsOrdering.fsprojtest").Value
let fileItems = [
{ BuildAction = "Compile"; Include = "DebugProvidedTypes.fs"; Link = None }
{ BuildAction = "Compile"; Include = "ProvidedTypes.fs"; Link = None }
{ BuildAction = "Content"; Include = "ProvidedTypes.fsi"; Link = None }
{ BuildAction = BuildAction.Compile; Include = "DebugProvidedTypes.fs"; Link = None }
{ BuildAction = BuildAction.Compile; Include = "ProvidedTypes.fs"; Link = None }
{ BuildAction = BuildAction.Content; Include = "ProvidedTypes.fsi"; Link = None }
]
projFile.UpdateFileItems(fileItems, false)

let rec nodes node =
seq {
for node in node |> Seq.cast<XmlNode> do
if node.Name = "Compile" || node.Name = "Content"
if node.Name ="Compile" || node.Name = "Content"
then yield Paket.Xml.getAttribute "Include" node
yield! nodes node
}

let actual =
nodes projFile.Document
|> Seq.choose id
nodes projFile.Document
|> Seq.choose id
|> Seq.toList
let expected =
[
Expand Down

0 comments on commit 290ac56

Please sign in to comment.