Permalink
Browse files

[#449] [9.1] Initial project updates for 9.1 to get things building /…

… running

* Updated target framework
* updated PackageReference's to use new nuget feed
  * No NoReference packages
  * New versioning
  * Included script for converting PackageReference in projects
  * Organized / cleaned up other nuget-related scripts
  * Script to add NoWarn tags for NU1603, which pops up from the new nuget structure
* Allow for conditional local assembly references (for development against internal Sitecore previews)
* Other tweaks / upgrades to references (e.g. MVC, DI, Owin, Logging, Newtonsoft versions)
* Added many missing references that were broken previous to 9.0 and then fixed, likely being saved by CopyLocal?
* Some minor breaking API changes
* Updated CopyLocal on test projects to make assemblies available
* Added some missing runtime dependencies to unit tests
  • Loading branch information...
nickwesselman committed Sep 18, 2018
1 parent eca6ab0 commit 4f15bc623e473badb001f17294a7b8f68ca74d05
Showing with 2,888 additions and 1,155 deletions.
  1. +1 −0 .gitignore
  2. +90 −0 scripts/NuGet/AddLocalReferences.ps1
  3. +24 −0 scripts/NuGet/AddNoWarnNu1603.ps1
  4. +95 −0 scripts/NuGet/ConvertToNewNuget.ps1
  5. +0 −92 scripts/NuGet/CreateLocalNugetFeed.ps1
  6. +0 −92 scripts/NuGet/nugetify.ps1
  7. +0 −1 src/Feature/Accounts/Tests/AccountTrackerServiceTests.cs
  8. +88 −26 src/Feature/Accounts/Tests/Sitecore.Feature.Accounts.Tests.csproj
  9. +6 −1 src/Feature/Accounts/code/Infrastructure/Pipelines/IdentityProviders/Facebook.cs
  10. +82 −30 src/Feature/Accounts/code/Sitecore.Feature.Accounts.csproj
  11. +1 −1 src/Feature/Accounts/code/Web.config
  12. +184 −39 src/Feature/Demo/code/Sitecore.Feature.Demo.csproj
  13. +1 −1 src/Feature/Demo/code/Web.config
  14. +99 −29 src/Feature/Demo/tests/Sitecore.Feature.Demo.Tests.csproj
  15. +29 −13 src/Feature/Identity/code/Sitecore.Feature.Identity.csproj
  16. +1 −1 src/Feature/Identity/code/Web.config
  17. +51 −22 src/Feature/Language/Tests/Sitecore.Feature.Language.Tests.csproj
  18. +29 −13 src/Feature/Language/code/Sitecore.Feature.Language.csproj
  19. +1 −1 src/Feature/Language/code/Web.config
  20. +39 −14 src/Feature/Maps/code/Sitecore.Feature.Maps.csproj
  21. +1 −1 src/Feature/Maps/code/Web.config
  22. +54 −22 src/Feature/Maps/tests/Sitecore.Feature.Maps.Tests.csproj
  23. +55 −21 src/Feature/Media/Tests/Sitecore.Feature.Media.Tests.csproj
  24. +34 −13 src/Feature/Media/code/Sitecore.Feature.Media.csproj
  25. +1 −1 src/Feature/Media/code/Web.config
  26. +34 −13 src/Feature/Metadata/code/Sitecore.Feature.Metadata.csproj
  27. +1 −1 src/Feature/Metadata/code/Web.config
  28. +29 −13 src/Feature/Multisite/code/Sitecore.Feature.Multisite.csproj
  29. +1 −1 src/Feature/Multisite/code/Web.config
  30. +49 −21 src/Feature/Multisite/tests/Sitecore.Feature.Multisite.Tests.csproj
  31. +34 −13 src/Feature/Navigation/code/Sitecore.Feature.Navigation.csproj
  32. +1 −1 src/Feature/Navigation/code/Web.config
  33. +64 −24 src/Feature/News/Tests/Sitecore.Feature.News.Tests.csproj
  34. +39 −13 src/Feature/News/code/Sitecore.Feature.News.csproj
  35. +1 −1 src/Feature/News/code/Web.config
  36. +34 −13 src/Feature/PageContent/code/Sitecore.Feature.PageContent.csproj
  37. +1 −1 src/Feature/PageContent/code/Web.config
  38. +39 −13 src/Feature/Person/code/Sitecore.Feature.Person.csproj
  39. +1 −1 src/Feature/Person/code/Web.config
  40. +53 −21 src/Feature/Person/tests/Sitecore.Feature.Person.Tests.csproj
  41. +45 −16 src/Feature/Search/code/Sitecore.Feature.Search.csproj
  42. +1 −1 src/Feature/Search/code/Web.config
  43. +29 −13 src/Feature/Social/code/Sitecore.Feature.Social.csproj
  44. +1 −1 src/Feature/Social/code/Web.config
  45. +34 −13 src/Feature/Teasers/code/Sitecore.Feature.Teasers.csproj
  46. +1 −1 src/Feature/Teasers/code/Web.config
  47. +39 −9 src/Feature/Teasers/tests/Sitecore.Feature.Teasers.Tests.csproj
  48. +29 −13 src/Feature/faq/code/Sitecore.Feature.FAQ.csproj
  49. +1 −1 src/Feature/faq/code/Web.config
  50. +136 −29 src/Foundation/Accounts/code/Sitecore.Foundation.Accounts.csproj
  51. +1 −1 src/Foundation/Accounts/code/Web.config
  52. +103 −29 src/Foundation/Accounts/tests/Sitecore.Foundation.Accounts.Tests.csproj
  53. +34 −13 src/Foundation/Alerts/code/Sitecore.Foundation.Alerts.csproj
  54. +1 −1 src/Foundation/Alerts/code/Web.config
  55. +49 −21 src/Foundation/Alerts/tests/Sitecore.Foundation.Alerts.Tests.csproj
  56. +34 −14 src/Foundation/Assets/code/Sitecore.Foundation.Assets.csproj
  57. +30 −14 src/Foundation/DependencyInjection/code/Sitecore.Foundation.DependencyInjection.csproj
  58. +1 −1 src/Foundation/DependencyInjection/code/Web.config
  59. +28 −8 src/Foundation/Dictionary/code/Sitecore.Foundation.Dictionary.csproj
  60. +1 −1 src/Foundation/Dictionary/code/Web.config
  61. +52 −19 src/Foundation/Dictionary/tests/Sitecore.Foundation.Dictionary.Tests.csproj
  62. +34 −14 src/Foundation/FieldEditor/code/Sitecore.Foundation.FieldEditor.csproj
  63. +1 −1 src/Foundation/FieldEditor/code/Web.config
  64. +56 −23 src/Foundation/FieldEditor/tests/Sitecore.Foundation.FieldEditor.Tests.csproj
  65. +65 −24 src/Foundation/Indexing/Tests/Sitecore.Foundation.Indexing.Tests.csproj
  66. +45 −14 src/Foundation/Indexing/code/Sitecore.Foundation.Indexing.csproj
  67. +39 −23 src/Foundation/Installer/code/Sitecore.Foundation.Installer.csproj
  68. +45 −20 src/Foundation/Installer/tests/Sitecore.Foundation.Installer.Tests.csproj
  69. +34 −13 src/Foundation/LocalDatasource/code/Sitecore.Foundation.LocalDatasource.csproj
  70. +34 −8 src/Foundation/LocalDatasource/tests/Sitecore.Foundation.LocalDatasource.Tests.csproj
  71. +40 −14 src/Foundation/Multisite/code/Sitecore.Foundation.Multisite.csproj
  72. +1 −1 src/Foundation/Multisite/code/Web.config
  73. +50 −21 src/Foundation/Multisite/tests/Sitecore.Foundation.Multisite.Tests.csproj
  74. +29 −13 src/Foundation/Serialization/code/Sitecore.Foundation.Serialization.csproj
  75. +1 −1 src/Foundation/Serialization/code/Web.config
  76. +125 −37 src/Foundation/SitecoreExtensions/Tests/Sitecore.Foundation.SitecoreExtensions.Tests.csproj
  77. +101 −29 src/Foundation/SitecoreExtensions/code/Sitecore.Foundation.SitecoreExtensions.csproj
  78. +18 −17 src/Foundation/Testing/tests/Sitecore.Foundation.Testing.csproj
  79. +34 −13 src/Foundation/Theming/code/Sitecore.Foundation.Theming.csproj
  80. +1 −1 src/Foundation/Theming/code/Web.config
  81. +50 −21 src/Foundation/Theming/tests/Sitecore.Foundation.Theming.Tests.csproj
  82. +32 −16 src/Project/Common/code/Sitecore.Common.Website.csproj
  83. +56 −28 src/Project/Habitat/code/Sitecore.Habitat.Website.csproj
@@ -244,3 +244,4 @@ results
npm-debug.log
.DS_Store
/BuildConfiguration.csproj
@@ -0,0 +1,90 @@
$ns = @{x = 'http://schemas.microsoft.com/developer/msbuild/2003'}
function Add-XMLAttribute([System.Xml.XmlNode] $Node, $Name, $Value)
{
$attrib = $Node.OwnerDocument.CreateAttribute($Name)
$attrib.Value = $Value
$node.Attributes.Append($attrib)
}
function Create-XMLElement([System.Xml.XmlNode] $Node, $Name)
{
$Node.OwnerDocument.CreateElement($Name, $ns.x)
}
Get-ChildItem *.csproj -recurse | % {
New-Object psobject -Property @{
File = $_
ProjectXml = [xml](gc $_ -Raw)
}
} | % {
$_.ProjectXml.Project.ItemGroup | % {
$itemGroup = $_
$projectNode = $itemGroup.ParentNode
$packageReferences = @()
# collect the package references
if ($itemGroup.PackageReference.Count -lt 1) {
return
}
$itemGroup.PackageReference | ? {
$_.Include.StartsWith("Sitecore") -and -not $_.Include.Contains("FakeDb")
} | % {
$packageReferences += $_
}
if ($packageReferences.Count -lt 1) {
return
}
# remove package references from existing item group
$packageReferences | % {
$itemGroup.RemoveChild($_)
}
# add the build config import
$import = Create-XMLElement -Node $projectNode -Name Import
Add-XMLAttribute -Node $import -Name Project -Value '$(SolutionDir)\BuildConfiguration.csproj' | out-null
Add-XMLAttribute -Node $import -Name Condition -Value 'Exists(''$(SolutionDir)\BuildConfiguration.csproj'')' | out-null
$projectNode.PrependChild($import)
# create the choose which will replace existing item group, and the conditional
$choose = Create-XMLElement -Node $projectNode -Name Choose
$when = Create-XMLElement -Node $projectNode -Name When
Add-XMLAttribute -Node $when -Name Condition -Value '''$(LocalReferences)'' == ''true''' | out-null
$choose.AppendChild($when)
# create the new item group to go in the conditional
$localReferenceGroup = Create-XMLElement -Node $_ -Name ItemGroup
$packageReferences | % {
$assembly = $_.Include.Replace('.NoReferences', '')
$reference = Create-XMLElement -Node $_ -Name Reference
Add-XMLAttribute -Node $reference -Name Include -Value $assembly | out-null
$hintPath = Create-XMLElement -Node $_ -Name HintPath
$hintPath.InnerText = "`$(SitecorePath)\bin\$assembly.dll"
$reference.AppendChild($hintPath)
$private = Create-XMLElement -Node $_ -Name Private
$private.InnerText = "False"
$reference.AppendChild($private)
$localReferenceGroup.AppendChild($reference)
}
$when.AppendChild($localReferenceGroup)
# add the package reference item group as default
$otherwise = Create-XMLElement -Node $projectNode -Name Otherwise
$choose.AppendChild($otherwise)
$packageReferenceGroup = Create-XMLElement -Node $_ -Name ItemGroup
$otherwise.AppendChild($packageReferenceGroup)
$packageReferences | % {
$packageReferenceGroup.AppendChild($_)
}
# add the choose
$projectNode.InsertAfter($choose, $itemGroup)
# remove the original item group if empty
if (-not $itemGroup.HasChildNodes) {
$projectNode.RemoveChild($itemGroup)
}
}
$_.ProjectXml.Save($_.File)
}
@@ -0,0 +1,24 @@
$ns = @{x = 'http://schemas.microsoft.com/developer/msbuild/2003'}
$noWarn = "NU1603"
function Create-XMLElement([System.Xml.XmlNode] $Node, $Name)
{
$Node.OwnerDocument.CreateElement($Name, $ns.x)
}
## Find all Visual Studio projects and parse their XML
Get-ChildItem *.csproj -recurse | % {
New-Object psobject -Property @{
File = $_
ProjectXml = [xml](gc $_ -Raw)
}
} | % {
$propertyGroup = $_.ProjectXml.Project.PropertyGroup[0]
if (-not $propertyGroup) {
return
}
$noWarnElement = Create-XMLElement -Node $propertyGroup -Name NoWarn
$noWarnElement.InnerText = $noWarn
$propertyGroup.AppendChild($noWarnElement) | out-null
$_.ProjectXml.Save($_.File)
}

Large diffs are not rendered by default.

Oops, something went wrong.

This file was deleted.

Oops, something went wrong.

This file was deleted.

Oops, something went wrong.
@@ -8,7 +8,6 @@
using Ploeh.AutoFixture.Xunit2;
using Sitecore.Analytics;
using Sitecore.Analytics.Data.Items;
using Sitecore.Analytics.Outcome.Extensions;
using Sitecore.Analytics.Tracking;
using Sitecore.Data;
using Sitecore.Data.Items;
Oops, something went wrong.

0 comments on commit 4f15bc6

Please sign in to comment.