Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/fsprojects/Paket
Browse files Browse the repository at this point in the history
  • Loading branch information
Ian2020 committed Apr 7, 2015
2 parents ee7c56f + a29d13c commit b71fa50
Show file tree
Hide file tree
Showing 10 changed files with 144 additions and 22 deletions.
3 changes: 3 additions & 0 deletions RELEASE_NOTES.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
#### 0.38.5 - 07.04.2015
* Detect Silverlight version in csproj files - https://github.com/fsprojects/Paket/issues/751

#### 0.38.4 - 02.04.2015
* Fix mono timeout during license download - https://github.com/fsprojects/Paket/issues/746

Expand Down
8 changes: 4 additions & 4 deletions src/Paket.Bootstrapper/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@
[assembly: AssemblyTitleAttribute("Paket.Bootstrapper")]
[assembly: AssemblyProductAttribute("Paket")]
[assembly: AssemblyDescriptionAttribute("A package dependency manager for .NET with support for NuGet packages and GitHub repositories.")]
[assembly: AssemblyVersionAttribute("0.38.4")]
[assembly: AssemblyFileVersionAttribute("0.38.4")]
[assembly: AssemblyInformationalVersionAttribute("0.38.4")]
[assembly: AssemblyVersionAttribute("0.38.5")]
[assembly: AssemblyFileVersionAttribute("0.38.5")]
[assembly: AssemblyInformationalVersionAttribute("0.38.5")]
namespace System {
internal static class AssemblyVersionInformation {
internal const string Version = "0.38.4";
internal const string Version = "0.38.5";
}
}
8 changes: 4 additions & 4 deletions src/Paket.Core/AssemblyInfo.fs
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ open System.Reflection
[<assembly: AssemblyProductAttribute("Paket")>]
[<assembly: AssemblyCompanyAttribute("Paket team")>]
[<assembly: AssemblyDescriptionAttribute("A package dependency manager for .NET with support for NuGet packages and GitHub repositories.")>]
[<assembly: AssemblyVersionAttribute("0.38.4")>]
[<assembly: AssemblyFileVersionAttribute("0.38.4")>]
[<assembly: AssemblyInformationalVersionAttribute("0.38.4")>]
[<assembly: AssemblyVersionAttribute("0.38.5")>]
[<assembly: AssemblyFileVersionAttribute("0.38.5")>]
[<assembly: AssemblyInformationalVersionAttribute("0.38.5")>]
do ()

module internal AssemblyVersionInformation =
let [<Literal>] Version = "0.38.4"
let [<Literal>] Version = "0.38.5"
2 changes: 1 addition & 1 deletion src/Paket.Core/FrameworkHandling.fs
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ type FrameworkIdentifier =
| Windows v -> "win" + v
| WindowsPhoneApp v -> "wp" + v
| WindowsPhoneSilverlight v -> "wp" + v
| Silverlight v -> "sl" + v
| Silverlight v -> "sl" + v.Replace("v","").Replace(".","")


// returns a list of compatible platforms that this platform also supports
Expand Down
27 changes: 20 additions & 7 deletions src/Paket.Core/ProjectFile.fs
Original file line number Diff line number Diff line change
Expand Up @@ -474,14 +474,27 @@ type ProjectFile =
| _ -> ProjectOutputType.Library }
|> Seq.head

member this.GetTargetFramework() =
seq {for outputType in this.Document |> getDescendants "TargetFrameworkVersion" ->
member this.GetTargetFrameworkIdentifier() =
seq {for outputType in this.Document |> getDescendants "TargetFrameworkIdentifier" ->
outputType.InnerText }
|> Seq.map (fun s -> // TODO make this a separate function
s.Replace("v","net")
|> FrameworkDetection.Extract)
|> Seq.map (fun o -> o.Value)
|> Seq.head
|> Seq.firstOrDefault

member this.GetTargetFramework() =
let framework =
seq {for outputType in this.Document |> getDescendants "TargetFrameworkVersion" ->
outputType.InnerText }
|> Seq.map (fun s ->
// TODO make this a separate function
let prefix =
match this.GetTargetFrameworkIdentifier() with
| None -> "net"
| Some x -> x

prefix + s.Replace("v","")
|> FrameworkDetection.Extract)
|> Seq.map (fun o -> o.Value)
|> Seq.firstOrDefault
defaultArg framework (DotNetFramework(FrameworkVersion.V4))

member this.AddImportForPaketTargets(relativeTargetsPath) =
match this.Document
Expand Down
8 changes: 4 additions & 4 deletions src/Paket/AssemblyInfo.fs
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ open System.Reflection
[<assembly: AssemblyProductAttribute("Paket")>]
[<assembly: AssemblyCompanyAttribute("Paket team")>]
[<assembly: AssemblyDescriptionAttribute("A package dependency manager for .NET with support for NuGet packages and GitHub repositories.")>]
[<assembly: AssemblyVersionAttribute("0.38.4")>]
[<assembly: AssemblyFileVersionAttribute("0.38.4")>]
[<assembly: AssemblyInformationalVersionAttribute("0.38.4")>]
[<assembly: AssemblyVersionAttribute("0.38.5")>]
[<assembly: AssemblyFileVersionAttribute("0.38.5")>]
[<assembly: AssemblyInformationalVersionAttribute("0.38.5")>]
do ()

module internal AssemblyVersionInformation =
let [<Literal>] Version = "0.38.4"
let [<Literal>] Version = "0.38.5"
6 changes: 5 additions & 1 deletion tests/Paket.Tests/InstallModel/FrameworkIdentifierSpecs.fs
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,8 @@ let ``should understand basic silverlight``() =
let ``should serialize basic framework versions net20, net40, net45 ...``() =
DotNetFramework(FrameworkVersion.V2).ToString() |> shouldEqual "net20"
DotNetFramework(FrameworkVersion.V4_Client).ToString() |> shouldEqual "net40"
DotNetFramework(FrameworkVersion.V4_5).ToString() |> shouldEqual "net45"
DotNetFramework(FrameworkVersion.V4_5).ToString() |> shouldEqual "net45"

[<Test>]
let ``should serialize silverlight framework identifier correctly``() =
Silverlight("v5.0").ToString() |> shouldEqual "sl50"
6 changes: 5 additions & 1 deletion tests/Paket.Tests/Paket.Tests.fsproj
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
Expand Down Expand Up @@ -220,8 +220,12 @@
</None>
<None Include="ProjectFile\TestData\MaintainsOrdering.fsprojtest">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Include="ProjectFile\TestData\NewSilverlightClassLibrary.csprojtest">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<Compile Include="ProjectFile\ConditionSpecs.fs" />
<Compile Include="ProjectFile\TargetFrameworkSpecs.fs" />
<Compile Include="ProjectFile\FileBuildActionSpecs.fs" />
<Compile Include="ProjectFile\InterProjectDependencySpecs.fs" />
<Compile Include="ProjectFile\FrameworkReferencesSpecs.fs" />
Expand Down
20 changes: 20 additions & 0 deletions tests/Paket.Tests/ProjectFile/TargetFrameworkSpecs.fs
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
module Paket.ProjectFile.TargetFrameworkSpecs

open Paket
open NUnit.Framework
open FsUnit

[<Test>]
let ``should detect TargetFramework in Project2 proj file``() =
ProjectFile.Load("./ProjectFile/TestData/Project2.fsprojtest").Value.GetTargetFramework().ToString()
|> shouldEqual "net40"

[<Test>]
let ``should detect net40 in empty proj file``() =
ProjectFile.Load("./ProjectFile/TestData/Empty.fsprojtest").Value.GetTargetFramework().ToString()
|> shouldEqual "net40"

[<Test>]
let ``should detect silverlight framework in new silverlight project2``() =
ProjectFile.Load("./ProjectFile/TestData/NewSilverlightClassLibrary.csprojtest").Value.GetTargetFramework()
|> shouldEqual (Silverlight("v5.0"))
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProductVersion>8.0.50727</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{2DC62306-2201-4C2C-B1B7-C3284C3FCFEA}</ProjectGuid>
<ProjectTypeGuids>{A1591282-1198-4647-A2B1-27E5FF5F6F3B};{fae04ec0-301f-11d3-bf4b-00c04f79efbc}</ProjectTypeGuids>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>SilverlightClassLibrary1</RootNamespace>
<AssemblyName>SilverlightClassLibrary1</AssemblyName>
<TargetFrameworkIdentifier>Silverlight</TargetFrameworkIdentifier>
<TargetFrameworkVersion>v5.0</TargetFrameworkVersion>
<SilverlightVersion>$(TargetFrameworkVersion)</SilverlightVersion>
<SilverlightApplication>false</SilverlightApplication>
<ValidateXaml>true</ValidateXaml>
<ThrowErrorsInValidation>true</ThrowErrorsInValidation>
</PropertyGroup>
<!-- This property group is only here to support building this project using the
MSBuild 3.5 toolset. In order to work correctly with this older toolset, it needs
to set the TargetFrameworkVersion to v3.5 -->
<PropertyGroup Condition="'$(MSBuildToolsVersion)' == '3.5'">
<TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>Bin\Debug</OutputPath>
<DefineConstants>DEBUG;TRACE;SILVERLIGHT</DefineConstants>
<NoStdLib>true</NoStdLib>
<NoConfig>true</NoConfig>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>Bin\Release</OutputPath>
<DefineConstants>TRACE;SILVERLIGHT</DefineConstants>
<NoStdLib>true</NoStdLib>
<NoConfig>true</NoConfig>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="mscorlib" />
<Reference Include="System.Windows" />
<Reference Include="system" />
<Reference Include="System.Core">
<HintPath>$(TargetFrameworkDirectory)System.Core.dll</HintPath>
</Reference>
<Reference Include="System.Xml" />
<Reference Include="System.Net" />
<Reference Include="System.Windows.Browser" />
</ItemGroup>
<ItemGroup>
<Compile Include="Class1.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\Silverlight\$(SilverlightVersion)\Microsoft.Silverlight.CSharp.targets" />
<ProjectExtensions>
<VisualStudio>
<FlavorProperties GUID="{A1591282-1198-4647-A2B1-27E5FF5F6F3B}">
<SilverlightProjectProperties />
</FlavorProperties>
</VisualStudio>
</ProjectExtensions>
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>

0 comments on commit b71fa50

Please sign in to comment.