Skip to content
This repository has been archived by the owner on Jan 24, 2021. It is now read-only.

Migrate to the new project system #2720

Merged
merged 48 commits into from
Jun 2, 2017

Conversation

thecodejunkie
Copy link
Member

@thecodejunkie thecodejunkie commented Mar 22, 2017

This pull-request will handle the parts of the #2719 Migrate to new project system epic, which are related to the main Nancy repository.

Todo

  • Perform a dotnet migrate and clean up things like solutions files and *.MSBuild folders
  • Update NuGet.config and remove all sources except https://api.nuget.org/v3/index.json
  • Make Nancy.ViewEngines.Razor and Nancy.ViewEngines.Razor.BuildProviders compile again
  • Make Nancy.Validation.DateAnnotations compile again
  • Make Nancy.Validation.DateAnnotations.Tests compile again
  • Update all test projects to use xunit 2.2.0, xunit.runners.visualstudio 2.2.0 and Microsoft.NET.Test.Sdk 15.0.0
  • Add Directory.build.props file for projects in test/
  • Add Directory.build.props file for projects in src/
  • Add a .csproj for Nancy.ViewEngines.Spark.Tests
  • Add base package tags in Directory.build.props for projects in src/
  • Add all projects in samples/ to Nancy.sln (will be done as a separate pull-request)
  • Clean up *.csproj files for projects in samples/ (will be done as a separate pull-request)
  • Update *.csproj files
  • Make all tests pass again

Steps for updating the *.csproj files

  • Update *.csproj files to take an implicit dependency on NETStandard.Library instead of explicitly cherry-pick packages
  • Add DisableImplicitFrameworkReferences element and set it to true for net452 (see gist and Allow projects to override implicit PackageReference items with item Include syntax dotnet/sdk#633 (comment))
  • Remove all uses of the RuntimeFrameworkVersion element
  • Remove all explicit references of NETStandard.Library and Microsoft.NETCore.App
  • Update all references of Microsoft.Extensions.PlatformAbstractions to 1.1.0
  • Update all references of Microsoft.Extensions.DependencyModel to 1.1.1 (or 1.1.0 ?)
  • Investigate (and if possible remove) the use of Microsoft.NETCore.Platforms package in the test projects
  • Bump all uses of netcoreapp1.0 to netcoreapp1.1
  • Investigate (and if possible remove) the use of PackageTargetFallback
  • Remove explicit use of PackageId (will fallback to AssemblyName)
  • General clean up of elements (test projects don't need a version, sort the elements, order target frameworks)
  • Remove use of AssemblyName (will fallback to the name of the .csproj)
  • Update all System.* and Microsoft.* package reference to latest for netstandard
  • Migrate back to netstandard1.3 now that Microsoft.Extensions.DependencyModel supports it again (will have an API impact on Stream for methods such as Begin/EndRead and Begin/EndWrite which are not available on netstandard1.3) (will be done as a separate pull-request)

See dotnet/sdk#633 for discussions on config options in *.csproj

See Additions to the csproj format for .NET Core on MSDN for *.csproj recommendations

Build scripts

build.sh

  • Update CAKE_VERSION=0.19.1
  • Update DOTNET_VERSION=1.0.1
  • Update DOTNET_INSTRALL_URI=https://raw.githubusercontent.com/dotnet/cli/rel/1.0.1/scripts/obtain/dotnet-install.sh
  • Update to support running on Mono with the new project SDK (Migrate to new project system #2719 for details)

MSBuild wrapper for macOS

build.ps1

  • Update $CakeVersion = "0.19.1"
  • Update $DotNetVersion = "1.0.1";
  • Update $DotNetInstallerUri = "https://raw.githubusercontent.com/dotnet/cli/rel/1.0.1/scripts/obtain/dotnet-install.ps1";

build.cake

  • Update all references of netstandard1.6 to netstandard1.3 (will be done as a separate pull-request)
  • Update Restore-NuGet-Packages task to use NuGet.config
  • Investigate if we can move Mono specific build configurations (MonoDebug and MonoRelease)
  • Update so that we do not run net452 builds on *nix
  • Change the UpdateProjectJsonVersion method so that it updates the VersionPrefix element of *.csproj files instead of project.json (should be done after adding Directory.build.props)

Changes performed in this pull-request (will be updated as more commits are added)

  • Removed all *.MSBuild folders in src/ and test/
  • Removed Nancy.sln and Nancy.sln.DotSettings
  • Renamed Nancy.Next.sln and Nancy.Next.sln.DotSettings to Nancy.sln and Nancy.sln.DotSettings
  • Ran dotnet migrate on the entire repository
  • Updated references of xunit to 2.2.0
  • Updated references of xunit.runners.visualstudio to 2.2.0
  • Updated references of Microsoft.NET.Test.Sdk to 15.0.0
  • Removed unused sources in NuGet.config
  • Updated build.sh (see above for list of changes)
  • Updated build.ps1 (see above for list of changes)
  • Removed all uses of the RuntimeFrameworkVersion element
  • Added DisableImplicitFrameworkReferences for all net452 targets
  • Updated *.csproj files to take an implicit dependency on NETStandard.Library and Microsoft.NETCore.App
  • Updated all references of Microsoft.Extensions.PlatformAbstractions to 1.1.0
  • Updated all references of Microsoft.Extensions.DependencyModel to 1.1.1
  • Removed all references of the Microsoft.NETCore.Platforms package in the test projects
  • Removed all uses of the RuntimeFrameworkVersion element
  • Updated all uses of netcoreapp1.0 to netcoreapp1.1
  • Removed use of PackageTargetFallback in all projects
  • Removed explicit use of PackageId
  • Sorted elements in *.csproj files
  • Sorted TFMs in TargetFrameworks elements
  • Removed explicit use of the AssemblyName element
  • Updated all System.* and Microsoft.* package reference to latest for netstandard
  • Added Directory.build.props file for projects in test/
  • Added Directory.build.props file for projects in src/
  • Added base package tags in Directory.build.props for projects in src/
  • Added .csproj for Nancy.ViewEngines.Spark.Tests and added it to Nancy.sln
  • Changed VersionPrefix to Version in src/Directory.build.props
  • Cleaned up Build.cake
  • Fixed broken tests on all tfms
  • Updated Nancy.sln build configurations

@@ -26,12 +26,12 @@

<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.0.0-preview-20170106-08" />
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can't we drop -preview-20170106-08 here?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh shit I thought I did that yesterday. I must've forgotten to push that commit.. If you check the Changes performed in this pull-request section above, I even added it after my last commit :D I'll push that out. Well spotted 👍

@thecodejunkie thecodejunkie force-pushed the migrate-project-format branch 2 times, most recently from 08e7cf2 to 75259ad Compare June 1, 2017 21:31
@thecodejunkie thecodejunkie force-pushed the migrate-project-format branch 3 times, most recently from 2f6322f to 8a49d83 Compare June 2, 2017 08:28
@thecodejunkie thecodejunkie changed the title [WIP] Migrate to the new project system Migrate to the new project system Jun 2, 2017
@jchannon jchannon merged commit 3263bdf into NancyFx:master Jun 2, 2017
@khellang
Copy link
Member

khellang commented Jun 2, 2017

awww yeah

@thecodejunkie
Copy link
Member Author

thecodejunkie commented Jun 2, 2017

image

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet