move PathUtilities into toolkit (#532)

This commit is contained in:
Jesse Plamondon-Willard 2018-05-25 02:06:28 -04:00
parent 33760fa56b
commit 69b17f1db8
11 changed files with 21 additions and 19 deletions

View File

@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="..\packages\NUnit.3.10.1\build\NUnit.props" Condition="Exists('..\packages\NUnit.3.10.1\build\NUnit.props')" />
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
@ -56,7 +56,7 @@
<Compile Include="..\..\build\GlobalAssemblyInfo.cs">
<Link>Properties\GlobalAssemblyInfo.cs</Link>
</Compile>
<Compile Include="Core\PathUtilitiesTests.cs" />
<Compile Include="Toolkit\PathUtilitiesTests.cs" />
<Compile Include="Utilities\SemanticVersionTests.cs" />
<Compile Include="Utilities\SDateTests.cs" />
<Compile Include="Core\TranslationTests.cs" />
@ -73,6 +73,10 @@
<Project>{f1a573b0-f436-472c-ae29-0b91ea6b9f8f}</Project>
<Name>StardewModdingAPI</Name>
</ProjectReference>
<ProjectReference Include="..\StardewModdingAPI.Toolkit\StardewModdingAPI.Toolkit.csproj">
<Project>{ea5cfd2e-9453-4d29-b80f-8e0ea23f4ac6}</Project>
<Name>StardewModdingAPI.Toolkit</Name>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />

View File

@ -1,7 +1,7 @@
using NUnit.Framework;
using StardewModdingAPI.Framework.Utilities;
using StardewModdingAPI.Toolkit.Utilities;
namespace StardewModdingAPI.Tests.Core
namespace StardewModdingAPI.Tests.Toolkit
{
/// <summary>Unit tests for <see cref="PathUtilities"/>.</summary>
[TestFixture]

View File

@ -4,8 +4,8 @@ using System.Diagnostics.Contracts;
using System.Linq;
using Microsoft.Xna.Framework;
using StardewModdingAPI.Framework.Reflection;
using StardewModdingAPI.Framework.Utilities;
using StardewModdingAPI.Internal;
using StardewModdingAPI.Toolkit.Utilities;
using StardewValley;
namespace StardewModdingAPI.Framework.Content

View File

@ -9,10 +9,9 @@ using Microsoft.Xna.Framework.Graphics;
using StardewModdingAPI.Framework.Content;
using StardewModdingAPI.Framework.ContentManagers;
using StardewModdingAPI.Framework.Reflection;
using StardewModdingAPI.Framework.Utilities;
using StardewModdingAPI.Metadata;
using StardewModdingAPI.Toolkit.Utilities;
using StardewValley;
using xTile;
namespace StardewModdingAPI.Framework
{

View File

@ -3,7 +3,7 @@ using System.IO;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.Graphics;
using StardewModdingAPI.Framework.Serialisation;
using StardewModdingAPI.Framework.Utilities;
using StardewModdingAPI.Toolkit.Utilities;
using xTile;
namespace StardewModdingAPI.Framework

View File

@ -9,7 +9,7 @@ using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.Graphics;
using StardewModdingAPI.Framework.ContentManagers;
using StardewModdingAPI.Framework.Exceptions;
using StardewModdingAPI.Framework.Utilities;
using StardewModdingAPI.Toolkit.Utilities;
using StardewValley;
using xTile;
using xTile.Format;

View File

@ -4,7 +4,7 @@ using System.IO;
using System.Linq;
using StardewModdingAPI.Framework.Models;
using StardewModdingAPI.Framework.Serialisation;
using StardewModdingAPI.Framework.Utilities;
using StardewModdingAPI.Toolkit.Utilities;
namespace StardewModdingAPI.Framework.ModHelpers
{
@ -157,13 +157,13 @@ namespace StardewModdingAPI.Framework.ModHelpers
this.DeprecationManager.Warn($"{nameof(IModHelper)}.{nameof(IModHelper.CreateTransitionalContentPack)}", "2.5", DeprecationLevel.Notice);
// validate
if(string.IsNullOrWhiteSpace(directoryPath))
if (string.IsNullOrWhiteSpace(directoryPath))
throw new ArgumentNullException(nameof(directoryPath));
if(string.IsNullOrWhiteSpace(id))
if (string.IsNullOrWhiteSpace(id))
throw new ArgumentNullException(nameof(id));
if(string.IsNullOrWhiteSpace(name))
if (string.IsNullOrWhiteSpace(name))
throw new ArgumentNullException(nameof(name));
if(!Directory.Exists(directoryPath))
if (!Directory.Exists(directoryPath))
throw new ArgumentException($"Can't create content pack for directory path '{directoryPath}' because no such directory exists.");
// create manifest

View File

@ -7,7 +7,7 @@ using StardewModdingAPI.Framework.Exceptions;
using StardewModdingAPI.Framework.ModData;
using StardewModdingAPI.Framework.Models;
using StardewModdingAPI.Framework.Serialisation;
using StardewModdingAPI.Framework.Utilities;
using StardewModdingAPI.Toolkit.Utilities;
namespace StardewModdingAPI.Framework.ModLoading
{

View File

@ -25,9 +25,9 @@ using StardewModdingAPI.Framework.ModHelpers;
using StardewModdingAPI.Framework.ModLoading;
using StardewModdingAPI.Framework.Reflection;
using StardewModdingAPI.Framework.Serialisation;
using StardewModdingAPI.Framework.Utilities;
using StardewModdingAPI.Internal;
using StardewModdingAPI.Internal.Models;
using StardewModdingAPI.Toolkit.Utilities;
using StardewValley;
using Monitor = StardewModdingAPI.Framework.Monitor;
using SObject = StardewValley.Object;

View File

@ -157,7 +157,6 @@
<Compile Include="Framework\StateTracking\LocationTracker.cs" />
<Compile Include="Framework\StateTracking\PlayerTracker.cs" />
<Compile Include="Framework\Utilities\ContextHash.cs" />
<Compile Include="Framework\Utilities\PathUtilities.cs" />
<Compile Include="IContentPack.cs" />
<Compile Include="IManifestContentPackFor.cs" />
<Compile Include="IMultiplayerHelper.cs" />

View File

@ -3,10 +3,10 @@ using System.Diagnostics.Contracts;
using System.IO;
using System.Linq;
namespace StardewModdingAPI.Framework.Utilities
namespace StardewModdingAPI.Toolkit.Utilities
{
/// <summary>Provides utilities for normalising file paths.</summary>
internal static class PathUtilities
public static class PathUtilities
{
/*********
** Properties