Skip to content

Commit 8fac2a5

Browse files
committed
Refactor project files to replace Paket with NuGet for package management and update documentation accordingly
1 parent 0fa1eef commit 8fac2a5

File tree

8 files changed

+58
-44
lines changed

8 files changed

+58
-44
lines changed

Content/Console/Directory.Build.targets

Lines changed: 18 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,35 @@
11
<!--
22
This file allows overriding of properties for all projects in the directory.
3-
See https://learn.microsoft.com/en-us/visualstudio/msbuild/customize-by-directory?view=vs-2022#directorybuildprops-and-directorybuildtargets
3+
See
4+
https://learn.microsoft.com/en-us/visualstudio/msbuild/customize-by-directory?view=vs-2022#directorybuildprops-and-directorybuildtargets
45
-->
56
<Project>
67

78
<PropertyGroup>
89
<_BuildProjBaseIntermediateOutputPath>$(MSBuildThisFileDirectory)build/obj/</_BuildProjBaseIntermediateOutputPath>
910
<_DotnetToolManifestFile>$(MSBuildThisFileDirectory).config/dotnet-tools.json</_DotnetToolManifestFile>
10-
<_DotnetToolRestoreOutputFile>$(_BuildProjBaseIntermediateOutputPath)/dotnet-tool-restore-$(NETCoreSdkVersion)-$(OS)</_DotnetToolRestoreOutputFile>
11-
<_DotnetFantomasOutputFile>$(BaseIntermediateOutputPath)dotnet-fantomas-msbuild-$(NETCoreSdkVersion)-$(OS)</_DotnetFantomasOutputFile>
11+
<_DotnetToolRestoreOutputFile>
12+
$(_BuildProjBaseIntermediateOutputPath)/dotnet-tool-restore-$(NETCoreSdkVersion)-$(OS)</_DotnetToolRestoreOutputFile>
13+
<_DotnetFantomasOutputFile>
14+
$(BaseIntermediateOutputPath)dotnet-fantomas-msbuild-$(NETCoreSdkVersion)-$(OS)</_DotnetFantomasOutputFile>
1215
</PropertyGroup>
1316

14-
<!-- Make sure that dotnet tools (including paket) are restored before restoring any project -->
15-
<Target Name="ToolRestore" BeforeTargets="Restore;CollectPackageReferences;PaketRestore" Inputs="$(_DotnetToolManifestFile)" Outputs="$(_DotnetToolRestoreOutputFile)">
16-
<Exec Command="dotnet tool restore" WorkingDirectory="$(MSBuildThisFileDirectory)" StandardOutputImportance="High" StandardErrorImportance="High" />
17-
<MakeDir Directories="$(_BuildProjBaseIntermediateOutputPath)"/>
17+
<!-- Make sure that dotnet tools are restored before restoring any project -->
18+
<Target Name="ToolRestore" BeforeTargets="Restore;CollectPackageReferences"
19+
Inputs="$(_DotnetToolManifestFile)" Outputs="$(_DotnetToolRestoreOutputFile)">
20+
<Exec Command="dotnet tool restore" WorkingDirectory="$(MSBuildThisFileDirectory)"
21+
StandardOutputImportance="High" StandardErrorImportance="High" />
22+
<MakeDir Directories="$(_BuildProjBaseIntermediateOutputPath)" />
1823
<Touch Files="$(_DotnetToolRestoreOutputFile)" AlwaysCreate="True" ForceTouch="True" />
1924
</Target>
2025

2126
<!-- Make sure that files are formatted before building -->
22-
<Target Name="Format" Condition=" '$(MSBuildProjectExtension)' == '.fsproj' AND '$(DesignTimeBuild)' != 'true' " BeforeTargets="BeforeBuild" Inputs="@(Compile)" Outputs="$(_DotnetFantomasOutputFile)" >
23-
<Exec Command="dotnet fantomas $(MSBuildProjectDirectory)" StandardOutputImportance="High" StandardErrorImportance="High" WorkingDirectory="$(MSBuildThisFileDirectory)" ContinueOnError="WarnAndContinue" />
27+
<Target Name="Format"
28+
Condition=" '$(MSBuildProjectExtension)' == '.fsproj' AND '$(DesignTimeBuild)' != 'true' "
29+
BeforeTargets="BeforeBuild" Inputs="@(Compile)" Outputs="$(_DotnetFantomasOutputFile)">
30+
<Exec Command="dotnet fantomas $(MSBuildProjectDirectory)" StandardOutputImportance="High"
31+
StandardErrorImportance="High" WorkingDirectory="$(MSBuildThisFileDirectory)"
32+
ContinueOnError="WarnAndContinue" />
2433
<Touch Files="$(_DotnetFantomasOutputFile)" AlwaysCreate="True" ForceTouch="True" />
2534
</Target>
2635

Content/Library/Directory.Build.targets

Lines changed: 18 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,35 @@
11
<!--
22
This file allows overriding of properties for all projects in the directory.
3-
See https://learn.microsoft.com/en-us/visualstudio/msbuild/customize-by-directory?view=vs-2022#directorybuildprops-and-directorybuildtargets
3+
See
4+
https://learn.microsoft.com/en-us/visualstudio/msbuild/customize-by-directory?view=vs-2022#directorybuildprops-and-directorybuildtargets
45
-->
56
<Project>
67

78
<PropertyGroup>
89
<_BuildProjBaseIntermediateOutputPath>$(MSBuildThisFileDirectory)build/obj/</_BuildProjBaseIntermediateOutputPath>
910
<_DotnetToolManifestFile>$(MSBuildThisFileDirectory).config/dotnet-tools.json</_DotnetToolManifestFile>
10-
<_DotnetToolRestoreOutputFile>$(_BuildProjBaseIntermediateOutputPath)/dotnet-tool-restore-$(NETCoreSdkVersion)-$(OS)</_DotnetToolRestoreOutputFile>
11-
<_DotnetFantomasOutputFile>$(BaseIntermediateOutputPath)dotnet-fantomas-msbuild-$(NETCoreSdkVersion)-$(OS)</_DotnetFantomasOutputFile>
11+
<_DotnetToolRestoreOutputFile>
12+
$(_BuildProjBaseIntermediateOutputPath)/dotnet-tool-restore-$(NETCoreSdkVersion)-$(OS)</_DotnetToolRestoreOutputFile>
13+
<_DotnetFantomasOutputFile>
14+
$(BaseIntermediateOutputPath)dotnet-fantomas-msbuild-$(NETCoreSdkVersion)-$(OS)</_DotnetFantomasOutputFile>
1215
</PropertyGroup>
1316

14-
<!-- Make sure that dotnet tools (including paket) are restored before restoring any project -->
15-
<Target Name="ToolRestore" BeforeTargets="Restore;CollectPackageReferences;PaketRestore" Inputs="$(_DotnetToolManifestFile)" Outputs="$(_DotnetToolRestoreOutputFile)">
16-
<Exec Command="dotnet tool restore" WorkingDirectory="$(MSBuildThisFileDirectory)" StandardOutputImportance="High" StandardErrorImportance="High" />
17-
<MakeDir Directories="$(_BuildProjBaseIntermediateOutputPath)"/>
17+
<!-- Make sure that dotnet tools are restored before restoring any project -->
18+
<Target Name="ToolRestore" BeforeTargets="Restore;CollectPackageReferences"
19+
Inputs="$(_DotnetToolManifestFile)" Outputs="$(_DotnetToolRestoreOutputFile)">
20+
<Exec Command="dotnet tool restore" WorkingDirectory="$(MSBuildThisFileDirectory)"
21+
StandardOutputImportance="High" StandardErrorImportance="High" />
22+
<MakeDir Directories="$(_BuildProjBaseIntermediateOutputPath)" />
1823
<Touch Files="$(_DotnetToolRestoreOutputFile)" AlwaysCreate="True" ForceTouch="True" />
1924
</Target>
2025

2126
<!-- Make sure that files are formatted before building -->
22-
<Target Name="Format" Condition=" '$(MSBuildProjectExtension)' == '.fsproj' AND '$(DesignTimeBuild)' != 'true' " BeforeTargets="BeforeBuild" Inputs="@(Compile)" Outputs="$(_DotnetFantomasOutputFile)" >
23-
<Exec Command="dotnet fantomas $(MSBuildProjectDirectory)" StandardOutputImportance="High" StandardErrorImportance="High" WorkingDirectory="$(MSBuildThisFileDirectory)" ContinueOnError="WarnAndContinue" />
27+
<Target Name="Format"
28+
Condition=" '$(MSBuildProjectExtension)' == '.fsproj' AND '$(DesignTimeBuild)' != 'true' "
29+
BeforeTargets="BeforeBuild" Inputs="@(Compile)" Outputs="$(_DotnetFantomasOutputFile)">
30+
<Exec Command="dotnet fantomas $(MSBuildProjectDirectory)" StandardOutputImportance="High"
31+
StandardErrorImportance="High" WorkingDirectory="$(MSBuildThisFileDirectory)"
32+
ContinueOnError="WarnAndContinue" />
2433
<Touch Files="$(_DotnetFantomasOutputFile)" AlwaysCreate="True" ForceTouch="True" />
2534
</Target>
2635

Content/Library/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ src/MyLib.1/bin/
7979
- `GenerateAssemblyInfo` - Generates [AssemblyInfo](https://docs.microsoft.com/en-us/dotnet/api/microsoft.visualbasic.applicationservices.assemblyinfo?view=netframework-4.8) for libraries.
8080
- `DotnetPack` - Runs [dotnet pack](https://docs.microsoft.com/en-us/dotnet/core/tools/dotnet-pack). This includes running [Source Link](https://github.com/dotnet/sourcelink).
8181
- `SourceLinkTest` - Runs a Source Link test tool to verify Source Links were properly generated.
82-
- `PublishToNuGet` - Publishes the NuGet packages generated in `DotnetPack` to NuGet via [paket push](https://fsprojects.github.io/Paket/paket-push.html). Runs only from `Github Actions`.
82+
- `PublishToNuGet` - Publishes the NuGet packages generated in `DotnetPack` to NuGet via [nuget push](https://learn.microsoft.com/en-us/dotnet/core/tools/dotnet-nuget-push). Runs only from `Github Actions`.
8383
- `GitRelease` - Creates a commit message with the [Release Notes](https://fake.build/apidocs/v5/fake-core-releasenotes.html) and a git tag via the version in the `Release Notes`.
8484
- `GitHubRelease` - Publishes a [GitHub Release](https://help.github.com/en/articles/creating-releases) with the Release Notes and any NuGet packages. Runs only from `Github Actions`.
8585
- `FormatCode` - Runs [Fantomas](https://github.com/fsprojects/fantomas) on the solution file.

Directory.Build.targets

Lines changed: 18 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,35 @@
11
<!--
22
This file allows overriding of properties for all projects in the directory.
3-
See https://learn.microsoft.com/en-us/visualstudio/msbuild/customize-by-directory?view=vs-2022#directorybuildprops-and-directorybuildtargets
3+
See
4+
https://learn.microsoft.com/en-us/visualstudio/msbuild/customize-by-directory?view=vs-2022#directorybuildprops-and-directorybuildtargets
45
-->
56
<Project>
67

78
<PropertyGroup>
89
<_BuildProjBaseIntermediateOutputPath>$(MSBuildThisFileDirectory)build/obj/</_BuildProjBaseIntermediateOutputPath>
910
<_DotnetToolManifestFile>$(MSBuildThisFileDirectory).config/dotnet-tools.json</_DotnetToolManifestFile>
10-
<_DotnetToolRestoreOutputFile>$(_BuildProjBaseIntermediateOutputPath)/dotnet-tool-restore-$(NETCoreSdkVersion)-$(OS)</_DotnetToolRestoreOutputFile>
11-
<_DotnetFantomasOutputFile>$(BaseIntermediateOutputPath)dotnet-fantomas-msbuild-$(NETCoreSdkVersion)-$(OS)</_DotnetFantomasOutputFile>
11+
<_DotnetToolRestoreOutputFile>
12+
$(_BuildProjBaseIntermediateOutputPath)/dotnet-tool-restore-$(NETCoreSdkVersion)-$(OS)</_DotnetToolRestoreOutputFile>
13+
<_DotnetFantomasOutputFile>
14+
$(BaseIntermediateOutputPath)dotnet-fantomas-msbuild-$(NETCoreSdkVersion)-$(OS)</_DotnetFantomasOutputFile>
1215
</PropertyGroup>
1316

14-
<!-- Make sure that dotnet tools (including paket) are restored before restoring any project -->
15-
<Target Name="ToolRestore" BeforeTargets="Restore;CollectPackageReferences;PaketRestore" Inputs="$(_DotnetToolManifestFile)" Outputs="$(_DotnetToolRestoreOutputFile)">
16-
<Exec Command="dotnet tool restore" WorkingDirectory="$(MSBuildThisFileDirectory)" StandardOutputImportance="High" StandardErrorImportance="High" />
17-
<MakeDir Directories="$(_BuildProjBaseIntermediateOutputPath)"/>
17+
<!-- Make sure that dotnet tools are restored before restoring any project -->
18+
<Target Name="ToolRestore" BeforeTargets="Restore;CollectPackageReferences"
19+
Inputs="$(_DotnetToolManifestFile)" Outputs="$(_DotnetToolRestoreOutputFile)">
20+
<Exec Command="dotnet tool restore" WorkingDirectory="$(MSBuildThisFileDirectory)"
21+
StandardOutputImportance="High" StandardErrorImportance="High" />
22+
<MakeDir Directories="$(_BuildProjBaseIntermediateOutputPath)" />
1823
<Touch Files="$(_DotnetToolRestoreOutputFile)" AlwaysCreate="True" ForceTouch="True" />
1924
</Target>
2025

2126
<!-- Make sure that files are formatted before building -->
22-
<Target Name="Format" Condition=" '$(MSBuildProjectExtension)' == '.fsproj' AND '$(DesignTimeBuild)' != 'true' " BeforeTargets="BeforeBuild" Inputs="@(Compile)" Outputs="$(_DotnetFantomasOutputFile)" >
23-
<Exec Command="dotnet fantomas $(MSBuildProjectDirectory)" StandardOutputImportance="High" StandardErrorImportance="High" WorkingDirectory="$(MSBuildThisFileDirectory)" ContinueOnError="WarnAndContinue" />
27+
<Target Name="Format"
28+
Condition=" '$(MSBuildProjectExtension)' == '.fsproj' AND '$(DesignTimeBuild)' != 'true' "
29+
BeforeTargets="BeforeBuild" Inputs="@(Compile)" Outputs="$(_DotnetFantomasOutputFile)">
30+
<Exec Command="dotnet fantomas $(MSBuildProjectDirectory)" StandardOutputImportance="High"
31+
StandardErrorImportance="High" WorkingDirectory="$(MSBuildThisFileDirectory)"
32+
ContinueOnError="WarnAndContinue" />
2433
<Touch Files="$(_DotnetFantomasOutputFile)" AlwaysCreate="True" ForceTouch="True" />
2534
</Target>
2635

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ This takes away the ambiguity that developers face when creating an OSS project.
2828

2929
- [Standard project structure](https://docs.microsoft.com/en-us/dotnet/core/porting/project-structure) for your dotnet application
3030
- [Build Automation](https://en.wikipedia.org/wiki/Build_automation) tool via [FAKE](https://fake.build/)
31-
- [Package management](https://en.wikipedia.org/wiki/Package_manager) tool via [Paket](https://fsprojects.github.io/Paket/)
31+
- [Package management](https://en.wikipedia.org/wiki/Package_manager) tool via [Nuget](https://learn.microsoft.com/en-us/nuget/)
3232
- [Unit Testing](https://en.wikipedia.org/wiki/Unit_testing) via [Expecto](https://github.com/haf/expecto)
3333
- [Code Coverage](https://en.wikipedia.org/wiki/Code_coverage) via [Altcover](https://github.com/SteveGilham/altcover)
3434
- Also builds an html report with [ReportGenerator](https://github.com/danielpalme/ReportGenerator)
@@ -148,7 +148,7 @@ Appveyor's conventions around generating URLs based on the project name has some
148148

149149
#### This project uses the following projects:
150150
* Heavily inspired by [Project Scaffold](https://github.com/fsprojects/ProjectScaffold)
151-
* [Paket](https://fsprojects.github.io/Paket/)
151+
* [Nuget](https://learn.microsoft.com/en-us/nuget/)
152152
* [FAKE](https://fsharp.github.io/FAKE/)
153153
* [Expecto](https://github.com/haf/expecto)
154154
* [Buildstats.info](https://github.com/dustinmoris/CI-BuildStats)

docsSrc/Reference/Library_Output.md

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ When you do an initial scaffold, your folder will be filled with this set of fil
1212
├── build
1313
│   ├── build.fs
1414
│   ├── build.fsproj
15-
│   └── paket.references
1615
├── build.cmd
1716
├── build.sh
1817
├── docsSrc
@@ -42,7 +41,6 @@ When you do an initial scaffold, your folder will be filled with this set of fil
4241
│   ├── README.md
4342
│   ├── WebServer.fs
4443
│   ├── docsTool.fsproj
45-
│   ├── paket.references
4644
│   └── templates
4745
│   ├── helpers.fs
4846
│   ├── master.fs
@@ -53,23 +51,19 @@ When you do an initial scaffold, your folder will be filled with this set of fil
5351
│   ├── partNested.fs
5452
│   └── types.fs
5553
├── global.json
56-
├── paket.dependencies
57-
├── paket.lock
5854
├── src
5955
│   ├── Directory.Build.props
6056
│   └── MyLib.1
6157
│   ├── AssemblyInfo.fs
6258
│   ├── Library.fs
6359
│   ├── MyLib.1.fsproj
64-
│   └── paket.references
6560
└── tests
6661
├── Directory.Build.props
6762
└── MyLib.1.Tests
6863
├── AssemblyInfo.fs
6964
├── Main.fs
7065
├── MyLib.1.Tests.fsproj
7166
├── Tests.fs
72-
└── paket.references
7367

7468
- `.config\dotnet-tools.json` - Holds [dotnet tools](https://docs.microsoft.com/en-us/dotnet/core/tools/dotnet-tool-install) manifest.
7569
- `.devcontainer\` - Holds all files necessary for [VSCode Dev Container](https://code.visualstudio.com/docs/remote/containers) feature.
@@ -88,7 +82,5 @@ When you do an initial scaffold, your folder will be filled with this set of fil
8882
- `build\` - Build script for building the repository. See [FAKE Docs](https://fake.build/) for more info.
8983
- `docsSrc\` - Contains the source files for your [GitHub documentation](https://help.github.com/en/github/working-with-github-pages/configuring-a-publishing-source-for-your-github-pages-site).
9084
- `docsTool\` - Contains the tool for generating your [GitHub documentation](https://help.github.com/en/github/working-with-github-pages/configuring-a-publishing-source-for-your-github-pages-site).
91-
- `paket.dependencies` - File containing your repositories dependencies. See [Paket Docs](https://fsprojects.github.io/Paket/dependencies-file.html) for more info.
92-
- `paket.lock` - File containing the full dependency graph of your repository. See [Paket Docs](https://fsprojects.github.io/Paket/lock-file.html) for more info.
9385
- `src\` - Folder containing your repository's [project files](https://docs.microsoft.com/en-us/aspnet/web-forms/overview/deployment/web-deployment-in-the-enterprise/understanding-the-project-file) and code.
9486
- `tests\` - Folder containing tests running against your code in `src`.

docsSrc/Tutorials/Getting_Started_With_Libraries.md

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,6 @@ This will generate a structure similar to this
4444
│   ├── FsDocs.fs
4545
│   ├── build.fs
4646
│   ├── build.fsproj
47-
│   └── paket.references
4847
├── build.cmd
4948
├── build.sh
5049
├── docsSrc
@@ -68,22 +67,18 @@ This will generate a structure similar to this
6867
│   └── index.md
6968
├── global.json
7069
├── MyCoolNewLib.sln
71-
├── paket.dependencies
72-
├── paket.lock
7370
├── src
7471
│   ├── Directory.Build.props
7572
│   └── MyCoolNewLib
7673
│   ├── AssemblyInfo.fs
7774
│   ├── Library.fs
7875
│   ├── MyCoolNewLib.fsproj
79-
│   └── paket.references
8076
└── tests
8177
├── Directory.Build.props
8278
└── MyCoolNewLib.Tests
8379
├── Main.fs
8480
├── Tests.fs
8581
├── MyCoolNewLib.Tests.fsproj
86-
└── paket.references
8782

8883
This may look overwhelming, but we don't have to worry about all of these yet. Let's just focus on the real important ones for this tutorial.
8984

docsSrc/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ This takes away the ambiguity that developers face when creating an OSS project.
3232

3333
- [Standard project structure](https://docs.microsoft.com/en-us/dotnet/core/porting/project-structure) for your dotnet application
3434
- [Build Automation](https://en.wikipedia.org/wiki/Build_automation) tool via [FAKE](https://fake.build/)
35-
- [Package management](https://en.wikipedia.org/wiki/Package_manager) tool via [Paket](https://fsprojects.github.io/Paket/)
35+
- [Package management](https://en.wikipedia.org/wiki/Package_manager) tool via [Nuget](https://learn.microsoft.com/en-us/nuget/)
3636
- [Unit Testing](https://en.wikipedia.org/wiki/Unit_testing) via [Expecto](https://github.com/haf/expecto)
3737
- [Code Coverage](https://en.wikipedia.org/wiki/Code_coverage) via [Altcover](https://github.com/SteveGilham/altcover)
3838
- Also builds an html report with [ReportGenerator](https://github.com/danielpalme/ReportGenerator)

0 commit comments

Comments
 (0)