Fix build, version 8.0.0-alpha024

This commit is contained in:
Stephan
2017-09-27 11:35:51 +02:00
parent 05cb03af11
commit 477acb4de3
22 changed files with 23 additions and 352 deletions

View File

@@ -17,4 +17,4 @@ using System.Resources;
// these are FYI and changed automatically
[assembly: AssemblyFileVersion("8.0.0")]
[assembly: AssemblyInformationalVersion("8.0.0-alpha0024")]
[assembly: AssemblyInformationalVersion("8.0.0-alpha0025")]

View File

@@ -1,20 +0,0 @@
namespace Umbraco.Core
{
/// <summary>
/// Helper methods for Activation
/// </summary>
internal static class ActivatorHelper
{
/// <summary>
/// Creates an instance of a type using that type's default constructor.
/// </summary>
/// <typeparam name="T"></typeparam>
/// <returns></returns>
public static T CreateInstance<T>() where T : class, new()
{
return new ActivatorServiceProvider().GetService(typeof (T)) as T;
}
}
}

View File

@@ -1,12 +0,0 @@
using System;
namespace Umbraco.Core
{
internal class ActivatorServiceProvider : IServiceProvider
{
public object GetService(Type serviceType)
{
return Activator.CreateInstance(serviceType);
}
}
}

View File

@@ -21,7 +21,7 @@ namespace Umbraco.Core.Configuration
/// <summary>
/// Gets the version comment of the executing code (eg "beta").
/// </summary>
public static string CurrentComment => "alpha0024";
public static string CurrentComment => "alpha0025";
/// <summary>
/// Gets the assembly version of Umbraco.Code.dll.

View File

@@ -42,9 +42,6 @@ namespace Umbraco.Core
// *not* a singleton, don't want to keep it around
composition.Container.Register<DatabaseBuilder>();
//TODO: Don't think we'll need this when the resolvers are all container resolvers
composition.Container.RegisterSingleton<IServiceProvider, ActivatorServiceProvider>();
// register filesystems
composition.Container.Register<FileSystems>();
composition.Container.Register(factory => factory.GetInstance<FileSystems>().MediaFileSystem);

View File

@@ -1,18 +0,0 @@
// fixme - remove this file
//using System;
//namespace Umbraco.Core.Persistence
//{
// internal class ThreadStaticDatabaseScopeAccessor : IDatabaseScopeAccessor
// {
// [ThreadStatic]
// private static DatabaseScope _databaseScope;
// public DatabaseScope Scope
// {
// get { return _databaseScope; }
// set { _databaseScope = value; }
// }
// }
//}

View File

@@ -12,6 +12,7 @@ namespace Umbraco.Core
/// <remarks>
/// Intended as an infrastructure class.
/// </remarks>
[Obsolete("stop using, allocates")]
public class ReadLock : IDisposable
{
private readonly ReaderWriterLockSlim _rwLock;

View File

@@ -1,46 +0,0 @@
using System;
using System.Collections.Generic;
using System.Linq;
using Umbraco.Core.Logging;
using Umbraco.Core.Composing;
namespace Umbraco.Core
{
internal static class ServiceProviderExtensions
{
/// <summary>
/// Used to create instances of the specified type based on the resolved/cached plugin types
/// </summary>
/// <typeparam name="T"></typeparam>
/// <param name="serviceProvider"></param>
/// <param name="types"></param>
/// <param name="logger"></param>
/// <param name="throwException">set to true if an exception is to be thrown if there is an error during instantiation</param>
/// <returns></returns>
public static IEnumerable<T> CreateInstances<T>(this IServiceProvider serviceProvider, IEnumerable<Type> types, ILogger logger, bool throwException = false)
{
var typesAsArray = types.ToArray();
var instances = new List<T>();
foreach (var t in typesAsArray)
{
try
{
var typeInstance = (T) serviceProvider.GetService(t);
instances.Add(typeInstance);
}
catch (Exception ex)
{
logger.Error<TypeLoader>(String.Format("Error creating type {0}", t.FullName), ex);
if (throwException)
{
throw;
}
}
}
return instances;
}
}
}

View File

@@ -1,181 +0,0 @@
// fixme - remove this file
//using System;
//using System.Collections.Generic;
//namespace Umbraco.Core
//{
// /// <summary>
// /// Topological Sort algorithm for sorting items based on dependencies.
// /// Use the static method TopologicalSorter.GetSortedItems for a convenient
// /// way of sorting a list of items with dependencies between them.
// /// </summary>
// [Obsolete("Use the TopoGraph class instead, perfs are way better.", true)] // fixme remove!
// public class TopologicalSorter
// {
// private readonly int[] _vertices; // list of vertices
// private readonly int[,] _matrix; // adjacency matrix
// private int _numVerts; // current number of vertices
// private readonly int[] _sortedArray;
// public TopologicalSorter(int size)
// {
// _vertices = new int[size];
// _matrix = new int[size, size];
// _numVerts = 0;
// for (var i = 0; i < size; i++)
// for (var j = 0; j < size; j++)
// _matrix[i, j] = 0;
// _sortedArray = new int[size]; // sorted vert labels
// }
// #region Public Methods
// public int AddVertex(int vertex)
// {
// _vertices[_numVerts++] = vertex;
// return _numVerts - 1;
// }
// public void AddEdge(int start, int end)
// {
// _matrix[start, end] = 1;
// }
// public int[] Sort() // toplogical sort
// {
// while (_numVerts > 0) // while vertices remain,
// {
// // get a vertex with no successors, or -1
// var currentVertex = NoSuccessors();
// if (currentVertex == -1) // must be a cycle
// throw new Exception("Graph has cycles");
// // insert vertex label in sorted array (start at end)
// _sortedArray[_numVerts - 1] = _vertices[currentVertex];
// DeleteVertex(currentVertex); // delete vertex
// }
// // vertices all gone; return sortedArray
// return _sortedArray;
// }
// #endregion
// #region Private Helper Methods
// // returns vert with no successors (or -1 if no such verts)
// private int NoSuccessors()
// {
// for (var row = 0; row < _numVerts; row++)
// {
// var isEdge = false; // edge from row to column in adjMat
// for (var col = 0; col < _numVerts; col++)
// {
// if (_matrix[row, col] <= 0) continue;
// isEdge = true;
// break; // this vertex has a successor try another
// }
// if (isEdge == false) // if no edges, has no successors
// return row;
// }
// return -1; // no
// }
// private void DeleteVertex(int delVert)
// {
// // if not last vertex, delete from vertexList
// if (delVert != _numVerts - 1)
// {
// for (var j = delVert; j < _numVerts - 1; j++)
// _vertices[j] = _vertices[j + 1];
// for (var row = delVert; row < _numVerts - 1; row++)
// MoveRowUp(row, _numVerts);
// for (var col = delVert; col < _numVerts - 1; col++)
// MoveColLeft(col, _numVerts - 1);
// }
// _numVerts--; // one less vertex
// }
// private void MoveRowUp(int row, int length)
// {
// for (var col = 0; col < length; col++)
// _matrix[row, col] = _matrix[row + 1, col];
// }
// private void MoveColLeft(int col, int length)
// {
// for (var row = 0; row < length; row++)
// _matrix[row, col] = _matrix[row, col + 1];
// }
// #endregion
// #region Static methods
// public static IEnumerable<T> GetSortedItems<T>(List<DependencyField<T>> fields) where T : class
// {
// var sortOrder = GetTopologicalSortOrder(fields);
// var list = new List<T>();
// for (var i = 0; i < sortOrder.Length; i++)
// {
// var field = fields[sortOrder[i]];
// list.Add(field.Item.Value);
// }
// list.Reverse();
// return list;
// }
// internal static int[] GetTopologicalSortOrder<T>(List<DependencyField<T>> fields) where T : class
// {
// var g = new TopologicalSorter(fields.Count);
// var indexes = new Dictionary<string, int>();
// //add vertices
// for (var i = 0; i < fields.Count; i++)
// {
// indexes[fields[i].Alias.ToLowerInvariant()] = g.AddVertex(i);
// }
// //add edges
// for (var i = 0; i < fields.Count; i++)
// {
// if (fields[i].DependsOn == null) continue;
// for (var j = 0; j < fields[i].DependsOn.Length; j++)
// {
// if (indexes.ContainsKey(fields[i].DependsOn[j].ToLowerInvariant()) == false)
// throw new IndexOutOfRangeException(
// $"The alias '{fields[i]}' has an invalid dependency. The dependency '{fields[i].DependsOn[j]}' does not exist in the list of aliases");
// g.AddEdge(i, indexes[fields[i].DependsOn[j].ToLowerInvariant()]);
// }
// }
// var result = g.Sort();
// return result;
// }
// #endregion
// public class DependencyField<T> where T : class
// {
// public DependencyField()
// {
// }
// public DependencyField(string @alias, string[] dependsOn, Lazy<T> item)
// {
// Alias = alias;
// DependsOn = dependsOn;
// Item = item;
// }
// public string Alias { get; set; }
// public string[] DependsOn { get; set; }
// public Lazy<T> Item { get; set; }
// }
// }
//}

View File

@@ -88,8 +88,6 @@
<DependentUpon>Constants.cs</DependentUpon>
</Compile>
-->
<Compile Include="ActivatorHelper.cs" />
<Compile Include="ActivatorServiceProvider.cs" />
<Compile Include="AssemblyExtensions.cs" />
<Compile Include="AsyncLock.cs" />
<Compile Include="Attempt.cs" />
@@ -1199,7 +1197,6 @@
<Compile Include="Persistence\SqlSyntax\SqlSyntaxProviderExtensions.cs" />
<Compile Include="Persistence\SqlTemplate.cs" />
<Compile Include="Persistence\SqlTemplates.cs" />
<Compile Include="Persistence\ThreadStaticDatabaseScopeAccessor.cs" />
<Compile Include="Persistence\UmbracoDatabase.cs" />
<Compile Include="Persistence\UmbracoDatabaseExtensions.cs" />
<Compile Include="Persistence\UmbracoDatabaseFactory.cs" />
@@ -1341,7 +1338,6 @@
<Compile Include="Serialization\UdiJsonConverter.cs" />
<Compile Include="Serialization\UdiRangeJsonConverter.cs" />
<Compile Include="ServiceContextExtensions.cs" />
<Compile Include="ServiceProviderExtensions.cs" />
<Compile Include="Services\AuditService.cs" />
<Compile Include="Services\Changes\ContentTypeChange.cs" />
<Compile Include="Services\Changes\ContentTypeChangeExtensions.cs" />
@@ -1476,7 +1472,6 @@
<Compile Include="SystemUtilities.cs" />
<Compile Include="ThreadExtensions.cs" />
<Compile Include="TopoGraph.cs" />
<Compile Include="TopologicalSorter.cs" />
<Compile Include="TypeExtensions.cs" />
<Compile Include="Udi.cs" />
<Compile Include="UdiDefinitionAttribute.cs" />

View File

@@ -12,6 +12,7 @@ namespace Umbraco.Core
/// <remarks>
/// Intended as an infrastructure class.
/// </remarks>
[Obsolete("stop using, allocates")]
public class WriteLock : IDisposable
{
private readonly ReaderWriterLockSlim _rwLock;

View File

@@ -27,9 +27,9 @@ using Umbraco.Core.Strings;
using Umbraco.Tests.TestHelpers;
using Umbraco.Tests.TestHelpers.Stubs;
using Umbraco.Web;
using Umbraco.Web.DI;
using Umbraco.Web.Services;
using Umbraco.Examine;
using Umbraco.Web.Composing.CompositionRoots;
using Umbraco.Web._Legacy.Actions;
using Current = Umbraco.Core.Composing.Current;
@@ -256,7 +256,6 @@ namespace Umbraco.Tests.Testing
Container.RegisterSingleton(factory => SettingsForTests.GetDefault());
Container.RegisterSingleton(factory => settings.Content);
Container.RegisterSingleton(factory => settings.Templates);
Container.Register<IServiceProvider, ActivatorServiceProvider>();
Container.Register(factory => new MediaFileSystem(Mock.Of<IFileSystem>()));
Container.RegisterSingleton<IExamineIndexCollectionAccessor, TestIndexCollectionAccessor>();

View File

@@ -471,14 +471,14 @@
</Compile>
<Compile Include="Umbraco\Create.aspx.designer.cs">
<DependentUpon>create.aspx</DependentUpon>
</Compile>
</Compile>
<Compile Include="Umbraco\Create\xslt.ascx.cs">
<DependentUpon>xslt.ascx</DependentUpon>
<SubType>ASPXCodeBehind</SubType>
</Compile>
<Compile Include="Umbraco\Create\xslt.ascx.designer.cs">
<DependentUpon>xslt.ascx</DependentUpon>
</Compile>
</Compile>
<Compile Include="Umbraco\Dashboard\UserControlProxy.aspx.cs">
<DependentUpon>UserControlProxy.aspx</DependentUpon>
<SubType>ASPXCodeBehind</SubType>
@@ -1036,24 +1036,18 @@ xcopy "$(ProjectDir)"..\packages\SqlServerCE.4.0.0.1\x86\*.* "$(TargetDir)x86\"
<TransformXml Source="$(ProjectDir)Web.Template.config" Transform="$(ProjectDir)web.Template.$(Configuration).config" Destination="Web.$(Configuration).config.transformed" Condition="$(BuildingInsideVisualStudio) != true" />
<!-- Create ClientDependency.config file from Template if it doesn't exist -->
<Copy SourceFiles="$(ProjectDir)Config\ClientDependency.Release.config" DestinationFiles="$(ProjectDir)Config\ClientDependency.config" OverwriteReadOnlyFiles="true" SkipUnchangedFiles="false" Condition="!Exists('$(ProjectDir)Config\ClientDependency.config')" />
<!-- Only runs if the Belle build folder doesn't yet exist -->
<Message Text="Skipping BelleBuild because UmbracoBuild is '$(UmbracoBuild)', " Importance="High" Condition="'$(UmbracoBuild)' != ''" />
<Message Text="Running BelleBuild because $(ProjectDir)\..\Umbraco.Web.UI\Umbraco\lib does not exist" Importance="High" Condition="!Exists('$(ProjectDir)\..\Umbraco.Web.UI\Umbraco\lib')" />
<Message Text="Skipping BelleBuild because UmbracoBuild is '$(UmbracoBuild)', " Importance="High" Condition="'$(UmbracoBuild)' != ''" />
<Message Text="Running BelleBuild because $(ProjectDir)\..\Umbraco.Web.UI\Umbraco\lib does not exist" Importance="High" Condition="!Exists('$(ProjectDir)\..\Umbraco.Web.UI\Umbraco\lib')" />
<CallTarget Targets="BelleBuild" Condition="!Exists('$(ProjectDir)\..\Umbraco.Web.UI\Umbraco\lib') and '$(UmbracoBuild)' == ''" />
<Message Text="Skipping BelleBuild because $(ProjectDir)\..\Umbraco.Web.UI\Umbraco\lib exists or UmbracoBuild is not set" Importance="High" Condition="Exists('$(ProjectDir)\..\Umbraco.Web.UI\Umbraco\lib') and '$(UmbracoBuild)' == ''" />
<Message Text="Skipping BelleBuild because $(ProjectDir)\..\Umbraco.Web.UI\Umbraco\lib exists or UmbracoBuild is not set" Importance="High" Condition="Exists('$(ProjectDir)\..\Umbraco.Web.UI\Umbraco\lib') and '$(UmbracoBuild)' == ''" />
</Target>
<Target Name="AfterBuild">
<Copy SourceFiles="$(ProjectDir)Web.$(Configuration).config.transformed" DestinationFiles="$(ProjectDir)Web.config" OverwriteReadOnlyFiles="true" SkipUnchangedFiles="false" Condition="$(BuildingInsideVisualStudio) == true" />
</Target>
<Target Name="BelleBuild" BeforeTargets="Rebuild" Condition=" '$(UmbracoBuild)' == '' ">
<Exec WorkingDirectory="$(ProjectDir)\..\..\" Command="powershell -ExecutionPolicy RemoteSigned -Command &quot;&amp;{ $env:PSModulePath = \&quot;$pwd\build\Modules\;$env:PSModulePath\&quot; ; Import-Module Umbraco.Build -Force -DisableNameChecking ; build-umbraco compile-belle }&quot;" />
<Error Condition="!Exists('..\packages\Microsoft.Net.Compilers.2.2.0\build\Microsoft.Net.Compilers.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Microsoft.Net.Compilers.2.2.0\build\Microsoft.Net.Compilers.props'))" />
<Error Condition="!Exists('..\packages\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.1.0.5\build\net45\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.1.0.5\build\net45\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.props'))" />
</Target>
</Project>

View File

@@ -1,7 +1,7 @@
using LightInject;
using Umbraco.Web.Models.Mapping;
namespace Umbraco.Web.DI
namespace Umbraco.Web.Composing.CompositionRoots
{
public sealed class WebMappingProfilesCompositionRoot : ICompositionRoot
{

View File

@@ -1,20 +0,0 @@
// fixme remove this file
//using Umbraco.Core.Persistence;
//namespace Umbraco.Web
//{
// internal class HybridDatabaseScopeAccessor : HybridAccessorBase<DatabaseScope>, IDatabaseScopeAccessor
// {
// protected override string ItemKey => "Umbraco.Core.Persistence.HybridDatabaseScopeAccessor";
// public HybridDatabaseScopeAccessor(IHttpContextAccessor httpContextAccessor)
// : base(httpContextAccessor)
// { }
// public DatabaseScope Scope
// {
// get { return Value; }
// set { Value = value; }
// }
// }
//}

View File

@@ -151,13 +151,12 @@
<Compile Include="HealthCheck\NotificationMethods\IHealthCheckNotificationMethod.cs" />
<Compile Include="HealthCheck\NotificationMethods\NotificationMethodBase.cs" />
<Compile Include="HybridAccessorBase.cs" />
<Compile Include="HybridDatabaseScopeAccessor.cs" />
<Compile Include="HybridUmbracoContextAccessor.cs" />
<Compile Include="HttpContextUmbracoContextAccessor.cs" />
<Compile Include="HybridEventMessagesAccessor.cs" />
<Compile Include="IHttpContextAccessor.cs" />
<Compile Include="Cache\RelationTypeCacheRefresher.cs" />
<Compile Include="DI\WebMappingProfilesCompositionRoot.cs" />
<Compile Include="Composing\CompositionRoots\WebMappingProfilesCompositionRoot.cs" />
<Compile Include="Editors\BackOfficeNotificationsController.cs" />
<Compile Include="Install\InstallSteps\ConfigureMachineKey.cs" />
<Compile Include="IPublishedContentQuery.cs" />

View File

@@ -22,30 +22,8 @@ namespace Umbraco.Web.WebApi
public abstract class UmbracoAuthorizedApiController : UmbracoApiController
{
private BackOfficeUserManager<BackOfficeIdentityUser> _userManager;
private bool _userisValidated = false;
protected BackOfficeUserManager<BackOfficeIdentityUser> UserManager
=> _userManager ?? (_userManager = TryGetOwinContext().Result.GetBackOfficeUserManager());
/// <summary>
/// Returns the currently logged in Umbraco User
/// </summary>
/*
[Obsolete("This should no longer be used since it returns the legacy user object, use The Security.CurrentUser instead to return the proper user object, or Security.GetUserId() if you want to just get the user id")]
protected User UmbracoUser
{
get
{
//throw exceptions if not valid (true)
if (!_userisValidated)
{
Security.ValidateCurrentUser(true);
_userisValidated = true;
}
return new User(Security.CurrentUser);
}
}
*/ // fixme v8 remove this code
}
}

View File

@@ -25,7 +25,6 @@ using Umbraco.Core.PropertyEditors;
using Umbraco.Core.PropertyEditors.ValueConverters;
using Umbraco.Core.Services;
using Umbraco.Web.Cache;
using Umbraco.Web.DI;
using Umbraco.Web.Dictionary;
using Umbraco.Web.Editors;
using Umbraco.Web.HealthCheck;
@@ -42,6 +41,7 @@ using Umbraco.Web.UI.JavaScript;
using Umbraco.Web.WebApi;
using Umbraco.Web._Legacy.Actions;
using Umbraco.Examine;
using Umbraco.Web.Composing.CompositionRoots;
using Umbraco.Web.Search;
using Umbraco.Web.Trees;
using Current = Umbraco.Web.Composing.Current;