Skip to content

Commit

Permalink
chore: add paket
Browse files Browse the repository at this point in the history
  • Loading branch information
Marcos Magueta authored and Marcos Magueta committed Aug 20, 2021
1 parent 64defd5 commit cfea5f5
Show file tree
Hide file tree
Showing 19 changed files with 122 additions and 53 deletions.
15 changes: 4 additions & 11 deletions .config/dotnet-tools.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,11 @@
"version": 1,
"isRoot": true,
"tools": {
"fake-cli" : {
"version": "5.20.3",
"paket": {
"version": "6.0.6",
"commands": [
"fake"
]
},
"fable": {
"version": "3.0.0-nagareyama-rc-004",
"commands": [
"fable"
"paket"
]
}
}
}

}
79 changes: 71 additions & 8 deletions .paket/Paket.Restore.targets
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@
This value should match the version in the props generated by paket
If they differ, this means we need to do a restore in order to ensure correct dependencies
-->
<PropertyGroup Condition="'$(PaketPropsVersion)' != '5.185.3' ">
<PropertyGroup Condition="'$(PaketPropsVersion)' != '6.0.0' ">
<PaketRestoreRequired>true</PaketRestoreRequired>
</PropertyGroup>

Expand Down Expand Up @@ -236,13 +236,16 @@
<PackageName>$([System.String]::Copy('%(PaketReferencesFileLines.Identity)').Split(',')[0])</PackageName>
<PackageVersion>$([System.String]::Copy('%(PaketReferencesFileLines.Identity)').Split(',')[1])</PackageVersion>
<AllPrivateAssets>$([System.String]::Copy('%(PaketReferencesFileLines.Identity)').Split(',')[4])</AllPrivateAssets>
<CopyLocal Condition="'%(PaketReferencesFileLinesInfo.Splits)' == '6'">$([System.String]::Copy('%(PaketReferencesFileLines.Identity)').Split(',')[5])</CopyLocal>
<CopyLocal Condition="%(PaketReferencesFileLinesInfo.Splits) &gt;= 6">$([System.String]::Copy('%(PaketReferencesFileLines.Identity)').Split(',')[5])</CopyLocal>
<OmitContent Condition="%(PaketReferencesFileLinesInfo.Splits) &gt;= 7">$([System.String]::Copy('%(PaketReferencesFileLines.Identity)').Split(',')[6])</OmitContent>
<ImportTargets Condition="%(PaketReferencesFileLinesInfo.Splits) &gt;= 8">$([System.String]::Copy('%(PaketReferencesFileLines.Identity)').Split(',')[7])</ImportTargets>
</PaketReferencesFileLinesInfo>
<PackageReference Include="%(PaketReferencesFileLinesInfo.PackageName)">
<Version>%(PaketReferencesFileLinesInfo.PackageVersion)</Version>
<PrivateAssets Condition=" ('%(PaketReferencesFileLinesInfo.AllPrivateAssets)' == 'true') Or ('$(PackAsTool)' == 'true') ">All</PrivateAssets>
<ExcludeAssets Condition=" '%(PaketReferencesFileLinesInfo.Splits)' == '6' And %(PaketReferencesFileLinesInfo.CopyLocal) == 'false'">runtime</ExcludeAssets>
<ExcludeAssets Condition=" '%(PaketReferencesFileLinesInfo.Splits)' != '6' And %(PaketReferencesFileLinesInfo.AllPrivateAssets) == 'exclude'">runtime</ExcludeAssets>
<ExcludeAssets Condition=" %(PaketReferencesFileLinesInfo.CopyLocal) == 'false' or %(PaketReferencesFileLinesInfo.AllPrivateAssets) == 'exclude'">runtime</ExcludeAssets>
<ExcludeAssets Condition=" %(PaketReferencesFileLinesInfo.OmitContent) == 'true'">$(ExcludeAssets);contentFiles</ExcludeAssets>
<ExcludeAssets Condition=" %(PaketReferencesFileLinesInfo.ImportTargets) == 'false'">$(ExcludeAssets);build;buildMultitargeting;buildTransitive</ExcludeAssets>
<Publish Condition=" '$(PackAsTool)' == 'true' ">true</Publish>
<AllowExplicitVersion>true</AllowExplicitVersion>
</PackageReference>
Expand Down Expand Up @@ -289,14 +292,16 @@
<PropertyGroup>
<PaketProjectFile>$(MSBuildProjectDirectory)/$(MSBuildProjectFile)</PaketProjectFile>
<ContinuePackingAfterGeneratingNuspec>true</ContinuePackingAfterGeneratingNuspec>
<UseMSBuild16_10_Pack>false</UseMSBuild16_10_Pack>
<UseMSBuild16_10_Pack Condition=" '@(MSBuildMajorVersion)' >= '16' AND '@(MSBuildMinorVersion)' > '10' ">true</UseMSBuild16_10_Pack>
<UseMSBuild16_0_Pack>false</UseMSBuild16_0_Pack>
<UseMSBuild16_0_Pack Condition=" '@(MSBuildMajorVersion)' >= '16' ">true</UseMSBuild16_0_Pack>
<UseMSBuild16_0_Pack Condition=" '@(MSBuildMajorVersion)' >= '16' AND (! $(UseMSBuild16_10_Pack)) ">true</UseMSBuild16_0_Pack>
<UseMSBuild15_9_Pack>false</UseMSBuild15_9_Pack>
<UseMSBuild15_9_Pack Condition=" '@(MSBuildMajorVersion)' == '15' AND '@(MSBuildMinorVersion)' > '8' ">true</UseMSBuild15_9_Pack>
<UseMSBuild15_8_Pack>false</UseMSBuild15_8_Pack>
<UseMSBuild15_8_Pack Condition=" '$(NuGetToolVersion)' != '4.0.0' AND (! $(UseMSBuild15_9_Pack)) AND (! $(UseMSBuild16_0_Pack)) ">true</UseMSBuild15_8_Pack>
<UseMSBuild15_8_Pack Condition=" '$(NuGetToolVersion)' != '4.0.0' AND (! $(UseMSBuild15_9_Pack)) AND (! $(UseMSBuild16_0_Pack)) AND (! $(UseMSBuild16_10_Pack)) ">true</UseMSBuild15_8_Pack>
<UseNuGet4_Pack>false</UseNuGet4_Pack>
<UseNuGet4_Pack Condition=" (! $(UseMSBuild15_8_Pack)) AND (! $(UseMSBuild15_9_Pack)) AND (! $(UseMSBuild16_0_Pack)) ">true</UseNuGet4_Pack>
<UseNuGet4_Pack Condition=" (! $(UseMSBuild15_8_Pack)) AND (! $(UseMSBuild15_9_Pack)) AND (! $(UseMSBuild16_0_Pack)) AND (! $(UseMSBuild16_10_Pack)) ">true</UseNuGet4_Pack>
<AdjustedNuspecOutputPath>$(PaketIntermediateOutputPath)\$(Configuration)</AdjustedNuspecOutputPath>
<AdjustedNuspecOutputPath Condition="@(_NuspecFilesNewLocation) == ''">$(PaketIntermediateOutputPath)</AdjustedNuspecOutputPath>
</PropertyGroup>
Expand All @@ -314,6 +319,55 @@
</ConvertToAbsolutePath>

<!-- Call Pack -->
<PackTask Condition="$(UseMSBuild16_10_Pack)"
PackItem="$(PackProjectInputFile)"
PackageFiles="@(_PackageFiles)"
PackageFilesToExclude="@(_PackageFilesToExclude)"
PackageVersion="$(PackageVersion)"
PackageId="$(PackageId)"
Title="$(Title)"
Authors="$(Authors)"
Description="$(Description)"
Copyright="$(Copyright)"
RequireLicenseAcceptance="$(PackageRequireLicenseAcceptance)"
LicenseUrl="$(PackageLicenseUrl)"
ProjectUrl="$(PackageProjectUrl)"
IconUrl="$(PackageIconUrl)"
ReleaseNotes="$(PackageReleaseNotes)"
Tags="$(PackageTags)"
DevelopmentDependency="$(DevelopmentDependency)"
BuildOutputInPackage="@(_BuildOutputInPackage)"
TargetPathsToSymbols="@(_TargetPathsToSymbols)"
SymbolPackageFormat="$(SymbolPackageFormat)"
TargetFrameworks="@(_TargetFrameworks)"
AssemblyName="$(AssemblyName)"
PackageOutputPath="$(PackageOutputAbsolutePath)"
IncludeSymbols="$(IncludeSymbols)"
IncludeSource="$(IncludeSource)"
PackageTypes="$(PackageType)"
IsTool="$(IsTool)"
RepositoryUrl="$(RepositoryUrl)"
RepositoryType="$(RepositoryType)"
SourceFiles="@(_SourceFiles->Distinct())"
NoPackageAnalysis="$(NoPackageAnalysis)"
MinClientVersion="$(MinClientVersion)"
Serviceable="$(Serviceable)"
FrameworkAssemblyReferences="@(_FrameworkAssemblyReferences)"
ContinuePackingAfterGeneratingNuspec="$(ContinuePackingAfterGeneratingNuspec)"
NuspecOutputPath="$(AdjustedNuspecOutputPath)"
IncludeBuildOutput="$(IncludeBuildOutput)"
BuildOutputFolders="$(BuildOutputTargetFolder)"
ContentTargetFolders="$(ContentTargetFolders)"
RestoreOutputPath="$(RestoreOutputAbsolutePath)"
NuspecFile="$(NuspecFileAbsolutePath)"
NuspecBasePath="$(NuspecBasePath)"
NuspecProperties="$(NuspecProperties)"
PackageLicenseFile="$(PackageLicenseFile)"
PackageLicenseExpression="$(PackageLicenseExpression)"
PackageLicenseExpressionVersion="$(PackageLicenseExpressionVersion)"
Readme="$(PackageReadmeFile)"
NoDefaultExcludes="$(NoDefaultExcludes)"/>

<PackTask Condition="$(UseMSBuild16_0_Pack)"
PackItem="$(PackProjectInputFile)"
PackageFiles="@(_PackageFiles)"
Expand Down Expand Up @@ -343,6 +397,8 @@
IsTool="$(IsTool)"
RepositoryUrl="$(RepositoryUrl)"
RepositoryType="$(RepositoryType)"
RepositoryBranch="$(RepositoryBranch)"
RepositoryCommit="$(RepositoryCommit)"
SourceFiles="@(_SourceFiles->Distinct())"
NoPackageAnalysis="$(NoPackageAnalysis)"
MinClientVersion="$(MinClientVersion)"
Expand All @@ -359,7 +415,8 @@
NuspecProperties="$(NuspecProperties)"
PackageLicenseFile="$(PackageLicenseFile)"
PackageLicenseExpression="$(PackageLicenseExpression)"
PackageLicenseExpressionVersion="$(PackageLicenseExpressionVersion)" />
PackageLicenseExpressionVersion="$(PackageLicenseExpressionVersion)"
NoDefaultExcludes="$(NoDefaultExcludes)" />

<PackTask Condition="$(UseMSBuild15_9_Pack)"
PackItem="$(PackProjectInputFile)"
Expand Down Expand Up @@ -390,6 +447,8 @@
IsTool="$(IsTool)"
RepositoryUrl="$(RepositoryUrl)"
RepositoryType="$(RepositoryType)"
RepositoryBranch="$(RepositoryBranch)"
RepositoryCommit="$(RepositoryCommit)"
SourceFiles="@(_SourceFiles->Distinct())"
NoPackageAnalysis="$(NoPackageAnalysis)"
MinClientVersion="$(MinClientVersion)"
Expand Down Expand Up @@ -433,6 +492,8 @@
IsTool="$(IsTool)"
RepositoryUrl="$(RepositoryUrl)"
RepositoryType="$(RepositoryType)"
RepositoryBranch="$(RepositoryBranch)"
RepositoryCommit="$(RepositoryCommit)"
SourceFiles="@(_SourceFiles->Distinct())"
NoPackageAnalysis="$(NoPackageAnalysis)"
MinClientVersion="$(MinClientVersion)"
Expand Down Expand Up @@ -475,6 +536,8 @@
IsTool="$(IsTool)"
RepositoryUrl="$(RepositoryUrl)"
RepositoryType="$(RepositoryType)"
RepositoryBranch="$(RepositoryBranch)"
RepositoryCommit="$(RepositoryCommit)"
SourceFiles="@(_SourceFiles->Distinct())"
NoPackageAnalysis="$(NoPackageAnalysis)"
MinClientVersion="$(MinClientVersion)"
Expand Down
2 changes: 1 addition & 1 deletion Fuchu.CSharpTests/Fuchu.CSharpTests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,5 @@
<!-- <ItemGroup> -->
<!-- <PackageReference Include="FSharp.Core" Version="4.6.2" /> -->
<!-- </ItemGroup> -->
<Import Project="..\..\.paket\Paket.Restore.targets" />
<Import Project="..\.paket\Paket.Restore.targets" />
</Project>
3 changes: 2 additions & 1 deletion Fuchu.FableTests/Fuchu.FableTests.fsproj
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
<DefineConstants Condition=" '$(Configuration)' == 'Fable'">$(DefineConstants);FABLE_COMPILER</DefineConstants>
</PropertyGroup>
<ItemGroup>
<None Include="paket.references" />
<Compile Include="Prelude.fs" />
<Compile Include="Tests.fs" />
<Compile Include="Main.fs" />
Expand All @@ -26,5 +27,5 @@
<!-- <PackageReference Include="Fable.Promise" Version="2.1.0" /> -->
<!-- <PackageReference Include="Fable.Fetch" Version="2.2.0" /> -->
<!-- </ItemGroup> -->
<Import Project="..\..\.paket\Paket.Restore.targets" />
<Import Project="..\.paket\Paket.Restore.targets" />
</Project>
Empty file.
47 changes: 24 additions & 23 deletions Fuchu.FsCheck/FsCheck.fs
Original file line number Diff line number Diff line change
Expand Up @@ -16,43 +16,44 @@ module FuchuFsCheck =
| :? IgnoreException as e -> Some e
| _ -> None

let internal wrapRunner (r : IRunner) =
let internal wrapRunner (r: IRunner) =
{ new IRunner with
member x.OnStartFixture t = r.OnStartFixture t
member x.OnArguments (ntest, args, every) = r.OnArguments (ntest, args, every)
member x.OnArguments(ntest, args, every) = r.OnArguments(ntest, args, every)
member x.OnShrink(args, everyShrink) = r.OnShrink(args, everyShrink)
member x.OnFinished(name,testResult) =

member x.OnFinished(name, testResult) =
let msg = onFinishedToString name testResult

match testResult with
| FsCheck.TestResult.True _ -> ()
| FsCheck.TestResult.False (_,_,_, Outcome.Exception (Ignored e),_) -> raise e
| _ -> failtest msg
}
| FsCheck.TestResult.False (_, _, _, Outcome.Exception (Ignored e), _) -> raise e
| _ -> failtest msg }

let internal config =
let internal config =
{ Config.Default with
Runner = wrapRunner Config.Default.Runner }
Runner = wrapRunner Config.Default.Runner }

let testPropertyWithConfig (config: Config) name property =
let testPropertyWithConfig (config: Config) name property =
let config =
{ config with
Runner = wrapRunner config.Runner }
testCase name <|
fun _ ->
ignore Runner.init.Value
FsCheck.Check.One(name, config, property)

Runner = wrapRunner config.Runner }

testCase name
<| fun _ ->
ignore Runner.init.Value
FsCheck.Check.One(name, config, property)

let testProperty name = testPropertyWithConfig config name

type FsCheck =
static member Property(name, property: Func<_,bool>) =
testProperty name property.Invoke
static member Property(name, property: Func<_, bool>) = testProperty name property.Invoke

static member Property(name, property: Func<_,_,bool>) =
testProperty name (fun a b -> property.Invoke(a,b))
static member Property(name, property: Func<_, _, bool>) =
testProperty name (fun a b -> property.Invoke(a, b))

static member Property(name, property: Func<_,_,_,bool>) =
testProperty name (fun a b c -> property.Invoke(a,b,c))
static member Property(name, property: Func<_, _, _, bool>) =
testProperty name (fun a b c -> property.Invoke(a, b, c))

static member Property(name, property: Func<_,_,_,_,bool>) =
testProperty name (fun a b c d -> property.Invoke(a,b,c,d))
static member Property(name, property: Func<_, _, _, _, bool>) =
testProperty name (fun a b c d -> property.Invoke(a, b, c, d))
3 changes: 2 additions & 1 deletion Fuchu.FsCheck/Fuchu.FsCheck.fsproj
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
<Version Condition=" '$(VersionSuffix)' == '' ">$(VersionPrefix)</Version>
</PropertyGroup>
<ItemGroup>
<None Include="paket.references" />
<Compile Include="AssemblyInfo.fs" />
<Compile Include="FsCheck.fs" />
</ItemGroup>
Expand All @@ -23,5 +24,5 @@
<!-- <PackageReference Update="FSharp.Core" Version="4.6.2" /> -->
<!-- <PackageReference Include="FsCheck" Version="2.14.0" /> -->
<!-- </ItemGroup> -->
<Import Project="..\..\.paket\Paket.Restore.targets" />
<Import Project="..\.paket\Paket.Restore.targets" />
</Project>
Empty file added Fuchu.FsCheck/paket.references
Empty file.
6 changes: 4 additions & 2 deletions Fuchu.MbUnit/Fuchu.MbUnit.fsproj
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<OutputType>Library</OutputType>
<RootNamespace>Fuchu.MbUnit</RootNamespace>
<AssemblyName>Fuchu.MbUnit</AssemblyName>
<TargetFrameworks>net452;netstandard2.0</TargetFrameworks>
<TargetFrameworks>net5.0</TargetFrameworks>
<Name>Fuchu.MbUnit</Name>
<Authors>Mauricio Scheffer</Authors>
<Description>Converts Fuchu tests to MbUnit tests</Description>
Expand All @@ -13,6 +13,7 @@
<Version Condition=" '$(VersionSuffix)' == '' ">$(VersionPrefix)</Version>
</PropertyGroup>
<ItemGroup>
<None Include="paket.references" />
<Compile Include="AssemblyInfo.fs" />
<Compile Include="FuchuTestToMbUnit.fs" />
</ItemGroup>
Expand All @@ -25,4 +26,5 @@
<ItemGroup>
<PackageReference Include="Gallio_MbUnit" Version="3.4.14.0" />
</ItemGroup>
</Project>
<Import Project="..\.paket\Paket.Restore.targets" />
</Project>
Empty file added Fuchu.MbUnit/paket.references
Empty file.
6 changes: 4 additions & 2 deletions Fuchu.PerfUtil.Charting/Fuchu.PerfUtil.Charting.fsproj
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,12 @@
<OutputType>Library</OutputType>
<RootNamespace>Fuchu.PerfUtil.Charting</RootNamespace>
<AssemblyName>Fuchu.PerfUtil.Charting</AssemblyName>
<TargetFrameworks>net452</TargetFrameworks>
<TargetFrameworks>net5.0</TargetFrameworks>
<Name>Fuchu.PerfUtil.Charting</Name>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
</PropertyGroup>
<ItemGroup>
<None Include="paket.references" />
<Compile Include="Charting.fs" />
</ItemGroup>
<ItemGroup>
Expand All @@ -27,4 +28,5 @@
<ItemGroup>
<PackageReference Include="FSharp.Charting" Version="2.1.0" />
</ItemGroup>
</Project>
<Import Project="..\.paket\Paket.Restore.targets" />
</Project>
2 changes: 2 additions & 0 deletions Fuchu.PerfUtil/Fuchu.PerfUtil.fsproj
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@

</PropertyGroup>
<ItemGroup>
<None Include="paket.references" />
<Compile Include="AssemblyInfo.fs" />
<Compile Include="PerfUtil.fs" />
</ItemGroup>
Expand All @@ -25,4 +26,5 @@
<!-- <PackageReference Update="FSharp.Core" Version="4.6.2" /> -->
<!-- <PackageReference Include="PerfUtil" Version="0.1.8" /> -->
</ItemGroup>
<Import Project="..\.paket\Paket.Restore.targets" />
</Project>
Empty file added Fuchu.PerfUtil/paket.references
Empty file.
6 changes: 4 additions & 2 deletions Fuchu.TeamCity/Fuchu.TeamCity.fsproj
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,11 @@
<OutputType>Library</OutputType>
<RootNamespace>Fuchu.TeamCity</RootNamespace>
<AssemblyName>Fuchu.TeamCity</AssemblyName>
<TargetFrameworks>net452</TargetFrameworks>
<TargetFrameworks>net5.0</TargetFrameworks>
<Name>Fuchu.TeamCity</Name>
</PropertyGroup>
<ItemGroup>
<None Include="paket.references" />
<Compile Include="Runner.fs" />
</ItemGroup>
<ItemGroup>
Expand All @@ -24,4 +25,5 @@
<ItemGroup>
<PackageReference Update="FSharp.Core" Version="4.6.2" />
</ItemGroup>
</Project>
<Import Project="..\.paket\Paket.Restore.targets" />
</Project>
Empty file added Fuchu.TeamCity/paket.references
Empty file.
3 changes: 2 additions & 1 deletion Fuchu.Tests/Fuchu.Tests.fsproj
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
<DefineConstants Condition=" '$(Configuration)' == 'Fable'">$(DefineConstants);FABLE_COMPILER</DefineConstants>
</PropertyGroup>
<ItemGroup>
<None Include="paket.references" />
<Compile Include="Prelude.fs" />
<Compile Include="NUnitTestTypes.fs" />
<Compile Include="NUnitTests.fs" />
Expand All @@ -35,5 +36,5 @@
<!-- <PackageReference Update="FSharp.Core" Version="4.6.2" /> -->
<!-- <PackageReference Include="NUnit" Version="3.12.0" /> -->
<!-- </ItemGroup> -->
<Import Project="..\..\.paket\Paket.Restore.targets" />
<Import Project="..\.paket\Paket.Restore.targets" />
</Project>
Empty file added Fuchu.Tests/paket.references
Empty file.
3 changes: 2 additions & 1 deletion Fuchu/Fuchu.fsproj
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@

</PropertyGroup>
<ItemGroup>
<None Include="paket.references" />
<Compile Include="Fuchu.fs" />
<Compile Include="xUnitHelpers.fs" />
<Compile Include="Fuchu.NUnit.fs" />
Expand All @@ -35,5 +36,5 @@
<ItemGroup>
<Content Include="*.fsproj; *.fs" PackagePath="fable/" />
</ItemGroup>

<Import Project="..\.paket\Paket.Restore.targets" />
</Project>
Empty file added Fuchu/paket.references
Empty file.

0 comments on commit cfea5f5

Please sign in to comment.