diff --git a/.gitattributes b/.gitattributes index 7ff73f425c..6e56e2cd41 100644 --- a/.gitattributes +++ b/.gitattributes @@ -12,6 +12,7 @@ *.vbproj merge=union *.fsproj merge=union *.dbproj merge=union +*.pyproj merge=union # Standard to msysgit *.doc diff=astextplain diff --git a/RELEASE_NOTES.md b/RELEASE_NOTES.md index a5b8d3b044..aeb05d4a98 100644 --- a/RELEASE_NOTES.md +++ b/RELEASE_NOTES.md @@ -1836,7 +1836,7 @@ * Package names in Dependencies file are no longer case-sensitive - https://github.com/fsprojects/Paket/pull/108 #### 0.1.4 - 2014-09-16 -* Only vbproj, csproj and fsproj files are handled +* Only vbproj, csproj, fsproj and pyproj files are handled #### 0.1.3 - 2014-09-15 * Detect FSharpx.Core in packages diff --git a/docs/content/analyzers.md b/docs/content/analyzers.md index 9130534b38..6032202007 100644 --- a/docs/content/analyzers.md +++ b/docs/content/analyzers.md @@ -62,13 +62,14 @@ conforms to the for analyzers to be installed by NuGet in `project.json`-based projects. If the `` is absent from the path the analyzer will be -installed in any supported project type (`.csproj`, `.vbproj` and `.fsproj`). +installed in any supported project type (`.csproj`, `.vbproj`, `.fsproj` and `.pyproj`). If it is present the analyzer will only be installed in the corresponding project type: * `cs` -> `.csproj` * `vb` -> `.vbproj` * `fs` -> `.fsproj` +* `py` -> `.pyproj` **Remarks:** diff --git a/src/Paket.Core/Installation/BindingRedirects.fs b/src/Paket.Core/Installation/BindingRedirects.fs index 7266c4e7fe..bf0383d1bd 100644 --- a/src/Paket.Core/Installation/BindingRedirects.fs +++ b/src/Paket.Core/Installation/BindingRedirects.fs @@ -85,7 +85,7 @@ let internal indentAssemblyBindings config = parent.Remove() let private configFiles = [ "app"; "web" ] |> Set.ofList -let private projectFiles = [ ".csproj"; ".vbproj"; ".fsproj"; ".wixproj"; ".nproj"; ".vcxproj" ] |> Set.ofList +let private projectFiles = [ ".csproj"; ".vbproj"; ".fsproj"; ".wixproj"; ".nproj"; ".vcxproj"; ".pyproj" ] |> Set.ofList let private toLower (s:string) = s.ToLower() let private isAppOrWebConfig = configFiles.Contains << (Path.GetFileNameWithoutExtension >> toLower) let private isDotNetProject = projectFiles.Contains << (Path.GetExtension >> toLower) diff --git a/src/Paket.Core/PaketConfigFiles/ProjectFile.fs b/src/Paket.Core/PaketConfigFiles/ProjectFile.fs index 08e39ba6fc..2e77f7541b 100644 --- a/src/Paket.Core/PaketConfigFiles/ProjectFile.fs +++ b/src/Paket.Core/PaketConfigFiles/ProjectFile.fs @@ -59,7 +59,7 @@ type ProjectOutputType = | Exe | Library -type ProjectLanguage = Unknown | CSharp | FSharp | VisualBasic | WiX | Nemerle | CPP +type ProjectLanguage = Unknown | CSharp | FSharp | VisualBasic | WiX | Nemerle | CPP | IronPython module LanguageEvaluation = let private extractProjectTypeGuids (projectDocument:XmlDocument) = @@ -104,18 +104,25 @@ module LanguageEvaluation = [ "{EDCC3B85-0BAD-11DB-BC1A-00112FDE8B61}" // Nemerle ] |> List.map Guid.Parse |> Set.ofList + + let private ironPythonGuids = + [ + "{D499C55F-46C0-4FE1-8D05-02605C1891EA}" // IronPython + ] |> List.map Guid.Parse |> Set.ofList let private getGuidLanguage (guid:Guid) = let isCsharp = csharpGuids.Contains(guid) let isVb = vbGuids.Contains(guid) let isFsharp = fsharpGuids.Contains(guid) let isNemerle = nemerleGuids.Contains(guid) - - match (isCsharp, isVb, isFsharp, isNemerle) with - | (true, false, false, false) -> Some CSharp - | (false, true, false, false) -> Some VisualBasic - | (false, false, true, false) -> Some FSharp - | (false, false, false, true) -> Some Nemerle + let isIronPython = ironPythonGuids.Contains(guid) + + match (isCsharp, isVb, isFsharp, isNemerle, isIronPython) with + | (true, false, false, false, false) -> Some CSharp + | (false, true, false, false, false) -> Some VisualBasic + | (false, false, true, false, false) -> Some FSharp + | (false, false, false, true, false) -> Some Nemerle + | (false, false, false, false, true) -> Some IronPython | _ -> None let private getLanguageFromExtension = function @@ -125,6 +132,7 @@ module LanguageEvaluation = | ".vcxproj" -> Some CPP | ".wixproj" -> Some WiX | ".nproj" -> Some Nemerle + | ".pyproj" -> Some IronPython | _ -> None let private getLanguageFromFileName (fileName : string) = @@ -163,7 +171,7 @@ type ProjectFile = [] module ProjectFile = - let supportedEndings = [ ".csproj"; ".fsproj"; ".vbproj"; ".wixproj"; ".nproj"; ".vcxproj"] + let supportedEndings = [ ".csproj"; ".fsproj"; ".vbproj"; ".wixproj"; ".nproj"; ".vcxproj"; ".pyproj"] let isSupportedFile (fi:FileInfo) = supportedEndings diff --git a/tests/Paket.Tests/InstallModel/Xml/RefactoringEssentials.fs b/tests/Paket.Tests/InstallModel/Xml/RefactoringEssentials.fs index fc788b1738..080b7c27e8 100644 --- a/tests/Paket.Tests/InstallModel/Xml/RefactoringEssentials.fs +++ b/tests/Paket.Tests/InstallModel/Xml/RefactoringEssentials.fs @@ -52,4 +52,4 @@ let ``should generate Xml for RefactoringEssentials in VisualBasic project``() = ctx.AnalyzersNode |> (fun n -> n.OuterXml) |> normalizeXml - |> shouldEqual (normalizeXml expected) \ No newline at end of file + |> shouldEqual (normalizeXml expected) diff --git a/tests/Paket.Tests/Paket.Tests.fsproj b/tests/Paket.Tests/Paket.Tests.fsproj index 88d856ecbb..d213c99fdb 100644 --- a/tests/Paket.Tests/Paket.Tests.fsproj +++ b/tests/Paket.Tests/Paket.Tests.fsproj @@ -235,6 +235,9 @@ PreserveNewest + + PreserveNewest + PreserveNewest diff --git a/tests/Paket.Tests/ProjectFile/FileBuildActionSpecs.fs b/tests/Paket.Tests/ProjectFile/FileBuildActionSpecs.fs index 88ab161f51..e63de0df6b 100644 --- a/tests/Paket.Tests/ProjectFile/FileBuildActionSpecs.fs +++ b/tests/Paket.Tests/ProjectFile/FileBuildActionSpecs.fs @@ -21,6 +21,7 @@ let ``should recognize compilable files``() = (createProject "B.fsproj").DetermineBuildAction "Module.fsi" |> shouldEqual BuildAction.Compile (createProject "C.vbproj").DetermineBuildAction "Whatever.vb" |> shouldEqual BuildAction.Compile (createProject "D.nproj").DetermineBuildAction "Main.n" |> shouldEqual BuildAction.Compile + (createProject "E.pyproj").DetermineBuildAction "Class.py" |> shouldEqual BuildAction.Compile [] let ``should recognize content files``() = @@ -28,6 +29,7 @@ let ``should recognize content files``() = (createProject "B.fsproj").DetermineBuildAction "config.yml" |> shouldEqual BuildAction.Content (createProject "C.vbproj").DetermineBuildAction "noext" |> shouldEqual BuildAction.Content (createProject "D.nproj").DetermineBuildAction "App.config" |> shouldEqual BuildAction.Content + (createProject "E.pyproj").DetermineBuildAction "Something.xml" |> shouldEqual BuildAction.Content [] let ``should recognize page files``() = @@ -35,6 +37,7 @@ let ``should recognize page files``() = (createProject "B.fsproj").DetermineBuildAction "Form1.Xaml" |> shouldEqual BuildAction.Page (createProject "C.vbproj").DetermineBuildAction "Form1.XAML" |> shouldEqual BuildAction.Page (createProject "D.nproj" ).DetermineBuildAction "Form1.XaML" |> shouldEqual BuildAction.Page + (createProject "E.pyproj" ).DetermineBuildAction "Form1.xaml" |> shouldEqual BuildAction.Page [] let ``should recognize resource files``() = @@ -42,3 +45,4 @@ let ``should recognize resource files``() = (createProject "B.fsproj").DetermineBuildAction "Form1.ico" |> shouldEqual BuildAction.Resource (createProject "C.vbproj").DetermineBuildAction "Form1.png" |> shouldEqual BuildAction.Resource (createProject "D.nproj" ).DetermineBuildAction "Form1.jpg" |> shouldEqual BuildAction.Resource + (createProject "E.pyproj" ).DetermineBuildAction "Form1.jpg" |> shouldEqual BuildAction.Resource diff --git a/tests/Paket.Tests/ProjectFile/TestData/EmptyPyGuid.pyprojtest b/tests/Paket.Tests/ProjectFile/TestData/EmptyPyGuid.pyprojtest new file mode 100644 index 0000000000..64c40e13b6 --- /dev/null +++ b/tests/Paket.Tests/ProjectFile/TestData/EmptyPyGuid.pyprojtest @@ -0,0 +1,7 @@ + + + + + D499C55F-46C0-4FE1-8D05-02605C1891EA + +