Skip to content

Commit 51f2ced

Browse files
committed
pyproj support
1 parent 336c62e commit 51f2ced

File tree

8 files changed

+29
-12
lines changed

8 files changed

+29
-12
lines changed

.gitattributes

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
*.vbproj merge=union
1313
*.fsproj merge=union
1414
*.dbproj merge=union
15+
*.pyproj merge=union
1516

1617
# Standard to msysgit
1718
*.doc diff=astextplain

RELEASE_NOTES.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1836,7 +1836,7 @@
18361836
* Package names in Dependencies file are no longer case-sensitive - https://github.com/fsprojects/Paket/pull/108
18371837

18381838
#### 0.1.4 - 2014-09-16
1839-
* Only vbproj, csproj and fsproj files are handled
1839+
* Only vbproj, csproj, fsproj and pyproj files are handled
18401840

18411841
#### 0.1.3 - 2014-09-15
18421842
* Detect FSharpx.Core in packages

docs/content/analyzers.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,13 +62,14 @@ conforms to the
6262
for analyzers to be installed by NuGet in `project.json`-based projects.
6363

6464
If the `<language></language>` is absent from the path the analyzer will be
65-
installed in any supported project type (`.csproj`, `.vbproj` and `.fsproj`).
65+
installed in any supported project type (`.csproj`, `.vbproj`, `.fsproj` and `.pyproj`).
6666
If it is present the analyzer will only be installed in the corresponding
6767
project type:
6868

6969
* `cs` -> `.csproj`
7070
* `vb` -> `.vbproj`
7171
* `fs` -> `.fsproj`
72+
* `py` -> `.pyproj`
7273

7374
**Remarks:**
7475

src/Paket.Core/Installation/BindingRedirects.fs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ let internal indentAssemblyBindings config =
8585
parent.Remove()
8686

8787
let private configFiles = [ "app"; "web" ] |> Set.ofList
88-
let private projectFiles = [ ".csproj"; ".vbproj"; ".fsproj"; ".wixproj"; ".nproj"; ".vcxproj" ] |> Set.ofList
88+
let private projectFiles = [ ".csproj"; ".vbproj"; ".fsproj"; ".wixproj"; ".nproj"; ".vcxproj"; ".pyproj" ] |> Set.ofList
8989
let private toLower (s:string) = s.ToLower()
9090
let private isAppOrWebConfig = configFiles.Contains << (Path.GetFileNameWithoutExtension >> toLower)
9191
let private isDotNetProject = projectFiles.Contains << (Path.GetExtension >> toLower)

src/Paket.Core/PaketConfigFiles/ProjectFile.fs

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ type ProjectOutputType =
5959
| Exe
6060
| Library
6161

62-
type ProjectLanguage = Unknown | CSharp | FSharp | VisualBasic | WiX | Nemerle | CPP
62+
type ProjectLanguage = Unknown | CSharp | FSharp | VisualBasic | WiX | Nemerle | CPP | IronPython
6363

6464
module LanguageEvaluation =
6565
let private extractProjectTypeGuids (projectDocument:XmlDocument) =
@@ -104,18 +104,25 @@ module LanguageEvaluation =
104104
[
105105
"{EDCC3B85-0BAD-11DB-BC1A-00112FDE8B61}" // Nemerle
106106
] |> List.map Guid.Parse |> Set.ofList
107+
108+
let private ironPythonGuids =
109+
[
110+
"{D499C55F-46C0-4FE1-8D05-02605C1891EA}" // IronPython
111+
] |> List.map Guid.Parse |> Set.ofList
107112

108113
let private getGuidLanguage (guid:Guid) =
109114
let isCsharp = csharpGuids.Contains(guid)
110115
let isVb = vbGuids.Contains(guid)
111116
let isFsharp = fsharpGuids.Contains(guid)
112117
let isNemerle = nemerleGuids.Contains(guid)
113-
114-
match (isCsharp, isVb, isFsharp, isNemerle) with
115-
| (true, false, false, false) -> Some CSharp
116-
| (false, true, false, false) -> Some VisualBasic
117-
| (false, false, true, false) -> Some FSharp
118-
| (false, false, false, true) -> Some Nemerle
118+
let isIronPython = ironPythonGuids.Contains(guid)
119+
120+
match (isCsharp, isVb, isFsharp, isNemerle, isIronPython) with
121+
| (true, false, false, false, false) -> Some CSharp
122+
| (false, true, false, false, false) -> Some VisualBasic
123+
| (false, false, true, false, false) -> Some FSharp
124+
| (false, false, false, true, false) -> Some Nemerle
125+
| (false, false, false, false, true) -> Some IronPython
119126
| _ -> None
120127

121128
let private getLanguageFromExtension = function
@@ -125,6 +132,7 @@ module LanguageEvaluation =
125132
| ".vcxproj" -> Some CPP
126133
| ".wixproj" -> Some WiX
127134
| ".nproj" -> Some Nemerle
135+
| ".pyproj" -> Some IronPython
128136
| _ -> None
129137

130138
let private getLanguageFromFileName (fileName : string) =
@@ -163,7 +171,7 @@ type ProjectFile =
163171

164172
[<CompilationRepresentation(CompilationRepresentationFlags.ModuleSuffix)>]
165173
module ProjectFile =
166-
let supportedEndings = [ ".csproj"; ".fsproj"; ".vbproj"; ".wixproj"; ".nproj"; ".vcxproj"]
174+
let supportedEndings = [ ".csproj"; ".fsproj"; ".vbproj"; ".wixproj"; ".nproj"; ".vcxproj"; ".pyproj"]
167175

168176
let isSupportedFile (fi:FileInfo) =
169177
supportedEndings

tests/Paket.Tests/InstallModel/Xml/RefactoringEssentials.fs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,4 +52,4 @@ let ``should generate Xml for RefactoringEssentials in VisualBasic project``() =
5252
ctx.AnalyzersNode
5353
|> (fun n -> n.OuterXml)
5454
|> normalizeXml
55-
|> shouldEqual (normalizeXml expected)
55+
|> shouldEqual (normalizeXml expected)

tests/Paket.Tests/Paket.Tests.fsproj

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -235,6 +235,9 @@
235235
<None Include="ProjectFile\TestData\EmptyVbGuid.vbprojtest">
236236
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
237237
</None>
238+
<None Include="ProjectFile\TestData\EmptyPyGuid.pyprojtest">
239+
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
240+
</None>
238241
<None Include="ProjectFile\TestData\Project1.fsprojtest">
239242
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
240243
</None>

tests/Paket.Tests/ProjectFile/FileBuildActionSpecs.fs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,24 +21,28 @@ let ``should recognize compilable files``() =
2121
(createProject "B.fsproj").DetermineBuildAction "Module.fsi" |> shouldEqual BuildAction.Compile
2222
(createProject "C.vbproj").DetermineBuildAction "Whatever.vb" |> shouldEqual BuildAction.Compile
2323
(createProject "D.nproj").DetermineBuildAction "Main.n" |> shouldEqual BuildAction.Compile
24+
(createProject "E.pyproj").DetermineBuildAction "Class.py" |> shouldEqual BuildAction.Compile
2425

2526
[<Test>]
2627
let ``should recognize content files``() =
2728
(createProject "A.csproj").DetermineBuildAction "Something.js" |> shouldEqual BuildAction.Content
2829
(createProject "B.fsproj").DetermineBuildAction "config.yml" |> shouldEqual BuildAction.Content
2930
(createProject "C.vbproj").DetermineBuildAction "noext" |> shouldEqual BuildAction.Content
3031
(createProject "D.nproj").DetermineBuildAction "App.config" |> shouldEqual BuildAction.Content
32+
(createProject "E.pyproj").DetermineBuildAction "Something.xml" |> shouldEqual BuildAction.Content
3133

3234
[<Test>]
3335
let ``should recognize page files``() =
3436
(createProject "A.csproj").DetermineBuildAction "Form1.xaml" |> shouldEqual BuildAction.Page
3537
(createProject "B.fsproj").DetermineBuildAction "Form1.Xaml" |> shouldEqual BuildAction.Page
3638
(createProject "C.vbproj").DetermineBuildAction "Form1.XAML" |> shouldEqual BuildAction.Page
3739
(createProject "D.nproj" ).DetermineBuildAction "Form1.XaML" |> shouldEqual BuildAction.Page
40+
(createProject "E.pyproj" ).DetermineBuildAction "Form1.xaml" |> shouldEqual BuildAction.Page
3841

3942
[<Test>]
4043
let ``should recognize resource files``() =
4144
(createProject "A.csproj").DetermineBuildAction "Form1.ttf" |> shouldEqual BuildAction.Resource
4245
(createProject "B.fsproj").DetermineBuildAction "Form1.ico" |> shouldEqual BuildAction.Resource
4346
(createProject "C.vbproj").DetermineBuildAction "Form1.png" |> shouldEqual BuildAction.Resource
4447
(createProject "D.nproj" ).DetermineBuildAction "Form1.jpg" |> shouldEqual BuildAction.Resource
48+
(createProject "E.pyproj" ).DetermineBuildAction "Form1.jpg" |> shouldEqual BuildAction.Resource

0 commit comments

Comments
 (0)