Skip to content

Commit fa28013

Browse files
author
Jimmy Byrd
committed
Add examples to sln
1 parent 6b7bb67 commit fa28013

File tree

2 files changed

+117
-19
lines changed

2 files changed

+117
-19
lines changed

.paket/Paket.Restore.targets

Lines changed: 70 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,8 @@
6565

6666
<!-- Disable Paket restore under NCrunch build -->
6767
<PaketRestoreDisabled Condition="'$(NCrunch)' == '1'">True</PaketRestoreDisabled>
68+
69+
<PaketIntermediateOutputPath Condition=" '$(PaketIntermediateOutputPath)' == '' ">$(BaseIntermediateOutputPath.TrimEnd('\').TrimEnd('\/'))</PaketIntermediateOutputPath>
6870
</PropertyGroup>
6971

7072
<Target Name="PaketBootstrapping" Condition="Exists('$(PaketToolsPath)paket.bootstrapper.proj')">
@@ -105,8 +107,8 @@
105107
<PaketRestoreRequired Condition=" '$(PaketRestoreLockFileHash)' == '' ">true</PaketRestoreRequired>
106108
</PropertyGroup>
107109

108-
<!--
109-
This value should match the version in the props generated by paket
110+
<!--
111+
This value should match the version in the props generated by paket
110112
If they differ, this means we need to do a restore in order to ensure correct dependencies
111113
-->
112114
<PropertyGroup Condition="'$(PaketPropsVersion)' != '5.185.3' ">
@@ -115,18 +117,18 @@
115117

116118
<!-- Do a global restore if required -->
117119
<Exec Command='$(PaketBootStrapperCommand)' Condition=" '$(PaketBootstrapperStyle)' == 'classic' AND Exists('$(PaketBootStrapperExePath)') AND !(Exists('$(PaketExePath)'))" ContinueOnError="false" />
118-
<Exec Command='$(PaketCommand) restore' Condition=" '$(PaketRestoreRequired)' == 'true' " ContinueOnError="false" />
119-
120+
<Exec Command='$(PaketCommand) restore' Condition=" '$(PaketRestoreRequired)' == 'true' AND '$(PaketDisableGlobalRestore)' != 'true' " ContinueOnError="false" />
121+
120122
<!-- Step 2 Detect project specific changes -->
121123
<ItemGroup>
122124
<MyTargetFrameworks Condition="'$(TargetFramework)' != '' " Include="$(TargetFramework)"></MyTargetFrameworks>
123125
<!-- Don't include all frameworks when msbuild explicitly asks for a single one -->
124126
<MyTargetFrameworks Condition="'$(TargetFrameworks)' != '' AND '$(TargetFramework)' == '' " Include="$(TargetFrameworks)"></MyTargetFrameworks>
125-
<PaketResolvedFilePaths Include="@(MyTargetFrameworks -> '$(MSBuildProjectDirectory)\obj\$(MSBuildProjectFile).%(Identity).paket.resolved')"></PaketResolvedFilePaths>
127+
<PaketResolvedFilePaths Include="@(MyTargetFrameworks -> '$(PaketIntermediateOutputPath)\$(MSBuildProjectFile).%(Identity).paket.resolved')"></PaketResolvedFilePaths>
126128
</ItemGroup>
127129
<Message Importance="low" Text="MyTargetFrameworks=@(MyTargetFrameworks) PaketResolvedFilePaths=@(PaketResolvedFilePaths)" />
128130
<PropertyGroup>
129-
<PaketReferencesCachedFilePath>$(MSBuildProjectDirectory)\obj\$(MSBuildProjectFile).paket.references.cached</PaketReferencesCachedFilePath>
131+
<PaketReferencesCachedFilePath>$(PaketIntermediateOutputPath)\$(MSBuildProjectFile).paket.references.cached</PaketReferencesCachedFilePath>
130132
<!-- MyProject.fsproj.paket.references has the highest precedence -->
131133
<PaketOriginalReferencesFilePath>$(MSBuildProjectFullPath).paket.references</PaketOriginalReferencesFilePath>
132134
<!-- MyProject.paket.references -->
@@ -161,8 +163,8 @@
161163

162164
<!-- Step 3 Restore project specific stuff if required -->
163165
<Message Condition=" '$(PaketRestoreRequired)' == 'true' " Importance="low" Text="Detected a change ('$(PaketRestoreRequiredReason)') in the project file '$(MSBuildProjectFullPath)', calling paket restore" />
164-
<Exec Command='$(PaketCommand) restore --project "$(MSBuildProjectFullPath)" --target-framework "$(TargetFrameworks)"' Condition=" '$(PaketRestoreRequired)' == 'true' AND '$(TargetFramework)' == '' " ContinueOnError="false" />
165-
<Exec Command='$(PaketCommand) restore --project "$(MSBuildProjectFullPath)" --target-framework "$(TargetFramework)"' Condition=" '$(PaketRestoreRequired)' == 'true' AND '$(TargetFramework)' != '' " ContinueOnError="false" />
166+
<Exec Command='$(PaketCommand) restore --project "$(MSBuildProjectFullPath)" --output-path "$(PaketIntermediateOutputPath)" --target-framework "$(TargetFrameworks)"' Condition=" '$(PaketRestoreRequired)' == 'true' AND '$(TargetFramework)' == '' " ContinueOnError="false" />
167+
<Exec Command='$(PaketCommand) restore --project "$(MSBuildProjectFullPath)" --output-path "$(PaketIntermediateOutputPath)" --target-framework "$(TargetFramework)"' Condition=" '$(PaketRestoreRequired)' == 'true' AND '$(TargetFramework)' != '' " ContinueOnError="false" />
166168

167169
<!-- This shouldn't actually happen, but just to be sure. -->
168170
<PropertyGroup>
@@ -195,7 +197,7 @@
195197
</ItemGroup>
196198

197199
<PropertyGroup>
198-
<PaketCliToolFilePath>$(MSBuildProjectDirectory)/obj/$(MSBuildProjectFile).paket.clitools</PaketCliToolFilePath>
200+
<PaketCliToolFilePath>$(PaketIntermediateOutputPath)/$(MSBuildProjectFile).paket.clitools</PaketCliToolFilePath>
199201
</PropertyGroup>
200202

201203
<ReadLinesFromFile File="$(PaketCliToolFilePath)" >
@@ -214,41 +216,43 @@
214216

215217
<!-- Disabled for now until we know what to do with runtime deps - https://github.com/fsprojects/Paket/issues/2964
216218
<PropertyGroup>
217-
<RestoreConfigFile>$(MSBuildProjectDirectory)/obj/$(MSBuildProjectFile).NuGet.Config</RestoreConfigFile>
219+
<RestoreConfigFile>$(PaketIntermediateOutputPath)/$(MSBuildProjectFile).NuGet.Config</RestoreConfigFile>
218220
</PropertyGroup> -->
219221

220222
</Target>
221223

222-
<Target Name="PaketDisableDirectPack" AfterTargets="_IntermediatePack" BeforeTargets="GenerateNuspec" Condition="('$(IsPackable)' == '' Or '$(IsPackable)' == 'true') And Exists('$(MSBuildProjectDirectory)/obj/$(MSBuildProjectFile).references')" >
224+
<Target Name="PaketDisableDirectPack" AfterTargets="_IntermediatePack" BeforeTargets="GenerateNuspec" Condition="('$(IsPackable)' == '' Or '$(IsPackable)' == 'true') And Exists('$(PaketIntermediateOutputPath)/$(MSBuildProjectFile).references')" >
223225
<PropertyGroup>
224226
<ContinuePackingAfterGeneratingNuspec>false</ContinuePackingAfterGeneratingNuspec>
225227
<DetectedMSBuildVersion>$(MSBuildVersion)</DetectedMSBuildVersion>
226228
<DetectedMSBuildVersion Condition="$(MSBuildVersion) == ''">15.8.0</DetectedMSBuildVersion>
227229
</PropertyGroup>
228230
</Target>
229231

230-
<Target Name="PaketOverrideNuspec" AfterTargets="GenerateNuspec" Condition="('$(IsPackable)' == '' Or '$(IsPackable)' == 'true') And Exists('$(MSBuildProjectDirectory)/obj/$(MSBuildProjectFile).references')" >
232+
<Target Name="PaketOverrideNuspec" AfterTargets="GenerateNuspec" Condition="('$(IsPackable)' == '' Or '$(IsPackable)' == 'true') And Exists('$(PaketIntermediateOutputPath)/$(MSBuildProjectFile).references')" >
231233
<ItemGroup>
232-
<_NuspecFilesNewLocation Include="$(BaseIntermediateOutputPath)$(Configuration)\*.nuspec"/>
234+
<_NuspecFilesNewLocation Include="$(PaketIntermediateOutputPath)\$(Configuration)\*.nuspec"/>
233235
<MSBuildMajorVersion Include="$(DetectedMSBuildVersion.Replace(`-`, `.`).Split(`.`)[0])" />
234236
<MSBuildMinorVersion Include="$(DetectedMSBuildVersion.Replace(`-`, `.`).Split(`.`)[1])" />
235237
</ItemGroup>
236238

237239
<PropertyGroup>
238240
<PaketProjectFile>$(MSBuildProjectDirectory)/$(MSBuildProjectFile)</PaketProjectFile>
239241
<ContinuePackingAfterGeneratingNuspec>true</ContinuePackingAfterGeneratingNuspec>
242+
<UseMSBuild16_0_Pack>false</UseMSBuild16_0_Pack>
243+
<UseMSBuild16_0_Pack Condition=" '@(MSBuildMajorVersion)' >= '16' ">true</UseMSBuild16_0_Pack>
240244
<UseMSBuild15_9_Pack>false</UseMSBuild15_9_Pack>
241-
<UseMSBuild15_9_Pack Condition=" '@(MSBuildMajorVersion)' > '15' OR ('@(MSBuildMajorVersion)' == '15' AND '@(MSBuildMinorVersion)' > '8') ">true</UseMSBuild15_9_Pack>
245+
<UseMSBuild15_9_Pack Condition=" '@(MSBuildMajorVersion)' == '15' AND '@(MSBuildMinorVersion)' > '8' ">true</UseMSBuild15_9_Pack>
242246
<UseMSBuild15_8_Pack>false</UseMSBuild15_8_Pack>
243-
<UseMSBuild15_8_Pack Condition=" '$(NuGetToolVersion)' != '4.0.0' AND (! $(UseMSBuild15_9_Pack)) ">true</UseMSBuild15_8_Pack>
247+
<UseMSBuild15_8_Pack Condition=" '$(NuGetToolVersion)' != '4.0.0' AND (! $(UseMSBuild15_9_Pack)) AND (! $(UseMSBuild16_0_Pack)) ">true</UseMSBuild15_8_Pack>
244248
<UseNuGet4_Pack>false</UseNuGet4_Pack>
245-
<UseNuGet4_Pack Condition=" (! $(UseMSBuild15_8_Pack)) AND (! $(UseMSBuild15_9_Pack)) ">true</UseNuGet4_Pack>
246-
<AdjustedNuspecOutputPath>$(BaseIntermediateOutputPath)$(Configuration)</AdjustedNuspecOutputPath>
247-
<AdjustedNuspecOutputPath Condition="@(_NuspecFilesNewLocation) == ''">$(BaseIntermediateOutputPath)</AdjustedNuspecOutputPath>
249+
<UseNuGet4_Pack Condition=" (! $(UseMSBuild15_8_Pack)) AND (! $(UseMSBuild15_9_Pack)) AND (! $(UseMSBuild16_0_Pack)) ">true</UseNuGet4_Pack>
250+
<AdjustedNuspecOutputPath>$(PaketIntermediateOutputPath)\$(Configuration)</AdjustedNuspecOutputPath>
251+
<AdjustedNuspecOutputPath Condition="@(_NuspecFilesNewLocation) == ''">$(PaketIntermediateOutputPath)</AdjustedNuspecOutputPath>
248252
</PropertyGroup>
249253

250254
<ItemGroup>
251-
<_NuspecFiles Include="$(AdjustedNuspecOutputPath)\*.nuspec"/>
255+
<_NuspecFiles Include="$(AdjustedNuspecOutputPath)\*.$(PackageVersion).nuspec"/>
252256
</ItemGroup>
253257

254258
<Exec Command='$(PaketCommand) fix-nuspecs files "@(_NuspecFiles)" project-file "$(PaketProjectFile)" ' Condition="@(_NuspecFiles) != ''" />
@@ -258,6 +262,53 @@
258262
</ConvertToAbsolutePath>
259263

260264
<!-- Call Pack -->
265+
<PackTask Condition="$(UseMSBuild16_0_Pack)"
266+
PackItem="$(PackProjectInputFile)"
267+
PackageFiles="@(_PackageFiles)"
268+
PackageFilesToExclude="@(_PackageFilesToExclude)"
269+
PackageVersion="$(PackageVersion)"
270+
PackageId="$(PackageId)"
271+
Title="$(Title)"
272+
Authors="$(Authors)"
273+
Description="$(Description)"
274+
Copyright="$(Copyright)"
275+
RequireLicenseAcceptance="$(PackageRequireLicenseAcceptance)"
276+
LicenseUrl="$(PackageLicenseUrl)"
277+
ProjectUrl="$(PackageProjectUrl)"
278+
IconUrl="$(PackageIconUrl)"
279+
ReleaseNotes="$(PackageReleaseNotes)"
280+
Tags="$(PackageTags)"
281+
DevelopmentDependency="$(DevelopmentDependency)"
282+
BuildOutputInPackage="@(_BuildOutputInPackage)"
283+
TargetPathsToSymbols="@(_TargetPathsToSymbols)"
284+
SymbolPackageFormat="symbols.nupkg"
285+
TargetFrameworks="@(_TargetFrameworks)"
286+
AssemblyName="$(AssemblyName)"
287+
PackageOutputPath="$(PackageOutputAbsolutePath)"
288+
IncludeSymbols="$(IncludeSymbols)"
289+
IncludeSource="$(IncludeSource)"
290+
PackageTypes="$(PackageType)"
291+
IsTool="$(IsTool)"
292+
RepositoryUrl="$(RepositoryUrl)"
293+
RepositoryType="$(RepositoryType)"
294+
SourceFiles="@(_SourceFiles->Distinct())"
295+
NoPackageAnalysis="$(NoPackageAnalysis)"
296+
MinClientVersion="$(MinClientVersion)"
297+
Serviceable="$(Serviceable)"
298+
FrameworkAssemblyReferences="@(_FrameworkAssemblyReferences)"
299+
ContinuePackingAfterGeneratingNuspec="$(ContinuePackingAfterGeneratingNuspec)"
300+
NuspecOutputPath="$(AdjustedNuspecOutputPath)"
301+
IncludeBuildOutput="$(IncludeBuildOutput)"
302+
BuildOutputFolders="$(BuildOutputTargetFolder)"
303+
ContentTargetFolders="$(ContentTargetFolders)"
304+
RestoreOutputPath="$(RestoreOutputAbsolutePath)"
305+
NuspecFile="$(NuspecFileAbsolutePath)"
306+
NuspecBasePath="$(NuspecBasePath)"
307+
NuspecProperties="$(NuspecProperties)"
308+
PackageLicenseFile="$(PackageLicenseFile)"
309+
PackageLicenseExpression="$(PackageLicenseExpression)"
310+
PackageLicenseExpressionVersion="$(PackageLicenseExpressionVersion)" />
311+
261312
<PackTask Condition="$(UseMSBuild15_9_Pack)"
262313
PackItem="$(PackProjectInputFile)"
263314
PackageFiles="@(_PackageFiles)"

FsLibLog.sln

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,14 @@ Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "FsLibLog.Adapters.Npgsql",
1717
EndProject
1818
Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "FsLibLog.Adapters.Marten", "adapters\FsLibLog.Adapters.Marten\FsLibLog.Adapters.Marten.fsproj", "{4572B725-3DB7-4010-BF26-F140A6117839}"
1919
EndProject
20+
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "examples", "examples", "{9BAA7731-9F1B-4B89-8AD8-DB546D7E816D}"
21+
EndProject
22+
Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "ConsoleExample", "examples\ConsoleExample\ConsoleExample.fsproj", "{BDF041F1-D693-4BCE-9741-C9606E901437}"
23+
EndProject
24+
Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "SerilogExample", "examples\SerilogExample\SerilogExample.fsproj", "{916E3A28-4E3D-4931-A13B-9B56E0B66B88}"
25+
EndProject
26+
Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "SomeLib", "examples\SomeLib\SomeLib.fsproj", "{B4E33887-2856-4809-B185-A80C9B093427}"
27+
EndProject
2028
Global
2129
GlobalSection(SolutionConfigurationPlatforms) = preSolution
2230
Debug|Any CPU = Debug|Any CPU
@@ -78,11 +86,50 @@ Global
7886
{4572B725-3DB7-4010-BF26-F140A6117839}.Release|x64.Build.0 = Release|Any CPU
7987
{4572B725-3DB7-4010-BF26-F140A6117839}.Release|x86.ActiveCfg = Release|Any CPU
8088
{4572B725-3DB7-4010-BF26-F140A6117839}.Release|x86.Build.0 = Release|Any CPU
89+
{BDF041F1-D693-4BCE-9741-C9606E901437}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
90+
{BDF041F1-D693-4BCE-9741-C9606E901437}.Debug|Any CPU.Build.0 = Debug|Any CPU
91+
{BDF041F1-D693-4BCE-9741-C9606E901437}.Debug|x64.ActiveCfg = Debug|Any CPU
92+
{BDF041F1-D693-4BCE-9741-C9606E901437}.Debug|x64.Build.0 = Debug|Any CPU
93+
{BDF041F1-D693-4BCE-9741-C9606E901437}.Debug|x86.ActiveCfg = Debug|Any CPU
94+
{BDF041F1-D693-4BCE-9741-C9606E901437}.Debug|x86.Build.0 = Debug|Any CPU
95+
{BDF041F1-D693-4BCE-9741-C9606E901437}.Release|Any CPU.ActiveCfg = Release|Any CPU
96+
{BDF041F1-D693-4BCE-9741-C9606E901437}.Release|Any CPU.Build.0 = Release|Any CPU
97+
{BDF041F1-D693-4BCE-9741-C9606E901437}.Release|x64.ActiveCfg = Release|Any CPU
98+
{BDF041F1-D693-4BCE-9741-C9606E901437}.Release|x64.Build.0 = Release|Any CPU
99+
{BDF041F1-D693-4BCE-9741-C9606E901437}.Release|x86.ActiveCfg = Release|Any CPU
100+
{BDF041F1-D693-4BCE-9741-C9606E901437}.Release|x86.Build.0 = Release|Any CPU
101+
{916E3A28-4E3D-4931-A13B-9B56E0B66B88}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
102+
{916E3A28-4E3D-4931-A13B-9B56E0B66B88}.Debug|Any CPU.Build.0 = Debug|Any CPU
103+
{916E3A28-4E3D-4931-A13B-9B56E0B66B88}.Debug|x64.ActiveCfg = Debug|Any CPU
104+
{916E3A28-4E3D-4931-A13B-9B56E0B66B88}.Debug|x64.Build.0 = Debug|Any CPU
105+
{916E3A28-4E3D-4931-A13B-9B56E0B66B88}.Debug|x86.ActiveCfg = Debug|Any CPU
106+
{916E3A28-4E3D-4931-A13B-9B56E0B66B88}.Debug|x86.Build.0 = Debug|Any CPU
107+
{916E3A28-4E3D-4931-A13B-9B56E0B66B88}.Release|Any CPU.ActiveCfg = Release|Any CPU
108+
{916E3A28-4E3D-4931-A13B-9B56E0B66B88}.Release|Any CPU.Build.0 = Release|Any CPU
109+
{916E3A28-4E3D-4931-A13B-9B56E0B66B88}.Release|x64.ActiveCfg = Release|Any CPU
110+
{916E3A28-4E3D-4931-A13B-9B56E0B66B88}.Release|x64.Build.0 = Release|Any CPU
111+
{916E3A28-4E3D-4931-A13B-9B56E0B66B88}.Release|x86.ActiveCfg = Release|Any CPU
112+
{916E3A28-4E3D-4931-A13B-9B56E0B66B88}.Release|x86.Build.0 = Release|Any CPU
113+
{B4E33887-2856-4809-B185-A80C9B093427}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
114+
{B4E33887-2856-4809-B185-A80C9B093427}.Debug|Any CPU.Build.0 = Debug|Any CPU
115+
{B4E33887-2856-4809-B185-A80C9B093427}.Debug|x64.ActiveCfg = Debug|Any CPU
116+
{B4E33887-2856-4809-B185-A80C9B093427}.Debug|x64.Build.0 = Debug|Any CPU
117+
{B4E33887-2856-4809-B185-A80C9B093427}.Debug|x86.ActiveCfg = Debug|Any CPU
118+
{B4E33887-2856-4809-B185-A80C9B093427}.Debug|x86.Build.0 = Debug|Any CPU
119+
{B4E33887-2856-4809-B185-A80C9B093427}.Release|Any CPU.ActiveCfg = Release|Any CPU
120+
{B4E33887-2856-4809-B185-A80C9B093427}.Release|Any CPU.Build.0 = Release|Any CPU
121+
{B4E33887-2856-4809-B185-A80C9B093427}.Release|x64.ActiveCfg = Release|Any CPU
122+
{B4E33887-2856-4809-B185-A80C9B093427}.Release|x64.Build.0 = Release|Any CPU
123+
{B4E33887-2856-4809-B185-A80C9B093427}.Release|x86.ActiveCfg = Release|Any CPU
124+
{B4E33887-2856-4809-B185-A80C9B093427}.Release|x86.Build.0 = Release|Any CPU
81125
EndGlobalSection
82126
GlobalSection(NestedProjects) = preSolution
83127
{5D30E174-2538-47AC-8443-318C8C5DC2C9} = {C397A34C-84F1-49E7-AEBC-2F9F2B196216}
84128
{1CA2E092-2320-451D-A4F0-9ED7C7C528CA} = {ACBEE43C-7A88-4FB1-9B06-DB064D22B29F}
85129
{428BFBE6-63E1-41A7-ABC1-8B22E2BA6259} = {71C9F558-4F13-48EB-83D2-F140618F7CF0}
86130
{4572B725-3DB7-4010-BF26-F140A6117839} = {71C9F558-4F13-48EB-83D2-F140618F7CF0}
131+
{BDF041F1-D693-4BCE-9741-C9606E901437} = {9BAA7731-9F1B-4B89-8AD8-DB546D7E816D}
132+
{916E3A28-4E3D-4931-A13B-9B56E0B66B88} = {9BAA7731-9F1B-4B89-8AD8-DB546D7E816D}
133+
{B4E33887-2856-4809-B185-A80C9B093427} = {9BAA7731-9F1B-4B89-8AD8-DB546D7E816D}
87134
EndGlobalSection
88135
EndGlobal

0 commit comments

Comments
 (0)