Skip to content

Commit

Permalink
Change TypeInfo to Type.
Browse files Browse the repository at this point in the history
  • Loading branch information
charlesbetros committed Oct 18, 2017
1 parent ec41cc0 commit c840978
Show file tree
Hide file tree
Showing 15 changed files with 167 additions and 151 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ protected virtual Type GetMapType(Type entityType)
select type).SingleOrDefault();
};

Type result = getType(entityType.GetTypeInfo().Assembly);
Type result = getType(entityType.Assembly);
if (result != null)
{
return result;
Expand All @@ -113,7 +113,7 @@ protected virtual Type GetMapType(Type entityType)
}
}

return getType(entityType.GetTypeInfo().Assembly);
return getType(entityType.Assembly);
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public static class ReflectionHelper
typeof(DateTimeOffset),
typeof(byte[])
};

public static MemberInfo GetProperty(LambdaExpression lambda)
{
Expression expr = lambda;
Expand Down Expand Up @@ -84,7 +84,7 @@ public static string AppendStrings(this IEnumerable<string> list, string seperat
public static bool IsSimpleType(Type type)
{
Type actualType = type;
if (type.GetTypeInfo().IsGenericType && type.GetGenericTypeDefinition() == typeof(Nullable<>))
if (type.IsGenericType && type.GetGenericTypeDefinition() == typeof(Nullable<>))
{
actualType = type.GetGenericArguments()[0];
}
Expand All @@ -104,4 +104,4 @@ public static string SetParameterName(this IDictionary<string, object> parameter
return name;
}
}
}
}
2 changes: 1 addition & 1 deletion Tests/Cosmos.TestRunner.Core/Engine.Helpers.cs
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@ private void RunIL2CPU(string kernelFileName, string outputFile)
xArgs.Insert(0, "run");
xArgs.Insert(1, "--no-build");
xArgs.Insert(2, " -- ");
RunProcess("dotnet", xIL2CPUPath, xArgs, true);
RunProcess("dotnet", xIL2CPUPath, xArgs);
}
}
}
Expand Down
6 changes: 2 additions & 4 deletions Tests/Cosmos.TestRunner.Core/Engine.cs
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
using Cosmos.Build.Common;
using System;
using System.Collections.Generic;
using System.IO;
using System.Reflection;

using Cosmos.Build.Common;

namespace Cosmos.TestRunner.Core
{
Expand Down Expand Up @@ -59,7 +57,7 @@ public bool Execute()
{
foreach (var xAssemblyFile in KernelsToRun)
{
mBaseWorkingDirectory = Path.Combine(Path.GetDirectoryName(typeof(Engine).GetTypeInfo().Assembly.Location), "WorkingDirectory");
mBaseWorkingDirectory = Path.Combine(Path.GetDirectoryName(typeof(Engine).Assembly.Location), "WorkingDirectory");
if (Directory.Exists(mBaseWorkingDirectory))
{
Directory.Delete(mBaseWorkingDirectory, true);
Expand Down
4 changes: 2 additions & 2 deletions Tests/Cosmos.TestRunner.Core/TestKernelSets.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ public static class TestKernelSets
// Kernel types to run: the ones that will run in test runners that use the default engine configuration.
public static IEnumerable<Type> GetKernelTypesToRun()
{
yield return typeof(KernelGen3.Boot);
//return GetStableKernelTypes();
//yield return typeof(KernelGen3.Boot);
return GetStableKernelTypes();
}

// Stable kernel types: the ones that are stable and will run in AppVeyor
Expand Down
13 changes: 5 additions & 8 deletions Tests/Cosmos.TestRunner.UnitTest/MyEngine.cs
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
using System;
using System.IO;
using System.Reflection;

using Cosmos.Build.Common;
using Cosmos.Build.Common;
using Cosmos.TestRunner.Core;

using NUnit.Framework;
using System;
using System.IO;

namespace Cosmos.TestRunner.UnitTest
{
Expand All @@ -19,7 +16,7 @@ public void Test(Type kernelToRun)
{
try
{
Directory.SetCurrentDirectory(Path.GetDirectoryName(typeof(RunKernels).GetTypeInfo().Assembly.Location));
Directory.SetCurrentDirectory(Path.GetDirectoryName(typeof(RunKernels).Assembly.Location));

var xEngine = new Engine();

Expand All @@ -41,7 +38,7 @@ public void Test(Type kernelToRun)
xEngine.StackCorruptionChecksLevel = StackCorruptionDetectionLevel.MethodFooters;

// Select kernels to be tested by adding them to the engine
xEngine.AddKernel(kernelToRun.GetTypeInfo().Assembly.Location);
xEngine.AddKernel(kernelToRun.Assembly.Location);

xEngine.OutputHandler = new TestOutputHandler();

Expand Down
2 changes: 1 addition & 1 deletion Tests/Cosmos.TestRunner/Cosmos.TestRunner.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@

<PropertyGroup>
<TargetFramework>netcoreapp2.0</TargetFramework>
<OutputType>Exe</OutputType>
<RuntimeIdentifier>win7-x86</RuntimeIdentifier>
<DebugType>Full</DebugType>
<SignAssembly>True</SignAssembly>
<AssemblyOriginatorKeyFile>..\..\Cosmos.snk</AssemblyOriginatorKeyFile>
<OutputType>Exe</OutputType>
</PropertyGroup>

<ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion Tools/Cosmos.IL2CPU.Profiler/Cosmos.IL2CPU.Profiler.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<TargetFramework>netcoreapp2.0</TargetFramework>
<RuntimeIdentifiers>win7-x86</RuntimeIdentifiers>
<RuntimeIdentifier>win7-x86</RuntimeIdentifier>
<DebugType>Full</DebugType>
<SignAssembly>True</SignAssembly>
<AssemblyOriginatorKeyFile>..\..\Cosmos.snk</AssemblyOriginatorKeyFile>
Expand Down
4 changes: 2 additions & 2 deletions Tools/PlugsInspector/PlugsInspector.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<TargetFramework>net462</TargetFramework>
<RuntimeIdentifiers>win7-x86</RuntimeIdentifiers>
<RuntimeIdentifier>win7-x86</RuntimeIdentifier>
<DebugType>Full</DebugType>
<SignAssembly>True</SignAssembly>
<AssemblyOriginatorKeyFile>..\..\Cosmos.snk</AssemblyOriginatorKeyFile>
Expand Down Expand Up @@ -36,4 +36,4 @@
</Compile>
</ItemGroup>

</Project>
</Project>
7 changes: 2 additions & 5 deletions source/Cosmos.Build.Common/EnumValue.cs
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using System.Text;
using System.ComponentModel;

namespace Cosmos.Build.Common
{
Expand All @@ -24,7 +21,7 @@ public static T Parse<T>(string value, T @default)
T result = @default;

Type valueType = typeof(T);
if (valueType.GetTypeInfo().IsEnum == false)
if (valueType.IsEnum == false)
{
throw new ArgumentException("Enum types only supported.", "T");
}
Expand Down Expand Up @@ -55,7 +52,7 @@ public static EnumValue Find(System.Collections.IEnumerable items, Enum value)

public static EnumValue[] GetEnumValues(Type enumType, bool aSort)
{
if (!enumType.GetTypeInfo().IsEnum)
if (!enumType.IsEnum)
{
throw new Exception("Invalid type, only enum types allowed.");
}
Expand Down
Loading

0 comments on commit c840978

Please sign in to comment.