Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multi-target .NET Standard 2.0 and .NET Framework 4.5 #118

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ obj
#ide
*.pidb
*.userprefs
.vs

#packages
packages
12 changes: 10 additions & 2 deletions Migrant.sln
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@

Microsoft Visual Studio Solution File, Format Version 11.00
# Visual Studio 2010
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 15
VisualStudioVersion = 15.0.27703.2035
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Migrant", "Migrant\Migrant.csproj", "{5F87C357-09FB-4F53-BE37-41FE5BD88957}"
EndProject
Global
Expand All @@ -17,6 +19,12 @@ Global
{5F87C357-09FB-4F53-BE37-41FE5BD88957}.Release|Any CPU.ActiveCfg = Release|Any CPU
{5F87C357-09FB-4F53-BE37-41FE5BD88957}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {E35BCC8E-D806-47B1-AEC9-BE2FA761EB92}
EndGlobalSection
GlobalSection(MonoDevelopProperties) = preSolution
Policies = $0
$0.DotNetNamingPolicy = $1
Expand Down
38 changes: 0 additions & 38 deletions Migrant/AssemblyInfo.cs

This file was deleted.

9 changes: 9 additions & 0 deletions Migrant/Generators/GeneratorHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -304,6 +304,7 @@ public static void Debug_PrintValueFromStack<T>(this ILGenerator generator, stri
});
}

#if NET45
[Conditional("DEBUG")]
public static void DumpToLibrary<T>(GenerationContextBase context, Action<GenerationContextBase> generateCodeAction, string postfix = null)
{
Expand Down Expand Up @@ -341,6 +342,14 @@ public static void DumpToLibrary<T>(GenerationContextBase context, Action<Genera
}

private static int counter;
#elif NETSTANDARD2_0
[Obsolete("Not available in .NET Standard 2.0")]
[Conditional("DEBUG")]
public static void DumpToLibrary<T>(GenerationContextBase context, Action<GenerationContextBase> generateCodeAction, string postfix = null)
{
throw new NotImplementedException();
}
#endif
}
}

133 changes: 22 additions & 111 deletions Migrant/Migrant.csproj
Original file line number Diff line number Diff line change
@@ -1,132 +1,43 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Project Sdk="Microsoft.NET.Sdk" DefaultTargets="Build">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProductVersion>8.0.30703</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{5F87C357-09FB-4F53-BE37-41FE5BD88957}</ProjectGuid>
<OutputType>Library</OutputType>
<RootNamespace>Antmicro.Migrant</RootNamespace>
<AssemblyName>Migrant</AssemblyName>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>True</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>False</Optimize>
<OutputPath>bin\Debug</OutputPath>
<DefineConstants>DEBUG;</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<ConsolePause>False</ConsolePause>
<TargetFrameworks>netstandard2.0;net45</TargetFrameworks>
<Description>Fast and flexible serialization framework usable on undecorated classes.</Description>
<Copyright>Copyright by Antmicro 2012 - 2016</Copyright>
<Company>Antmicro</Company>
<AssemblyVersion>0.14</AssemblyVersion>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>none</DebugType>
<Optimize>True</Optimize>
<OutputPath>bin\Release</OutputPath>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<ConsolePause>False</ConsolePause>
<DocumentationFile>bin\Release\Migrant.xml</DocumentationFile>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'DebugFormat|AnyCPU' ">
<Optimize>false</Optimize>
<OutputPath>bin\DebugFormat</OutputPath>
<WarningLevel>4</WarningLevel>
<DebugSymbols>true</DebugSymbols>
<DefineConstants>DEBUG_FORMAT; DEBUG</DefineConstants>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Xml" />
<AssemblyAttribute Include="System.Runtime.CompilerServices.InternalsVisibleTo">
<_Parameter1>Tests</_Parameter1>
</AssemblyAttribute>
</ItemGroup>
<ItemGroup>
<Compile Include="AssemblyInfo.cs" />
<Compile Include="ConstructorAttribute.cs" />
<Compile Include="Consts.cs" />
<Compile Include="Helpers.cs" />
<Compile Include="ISpeciallySerializable.cs" />
<Compile Include="ObjectIdentifier.cs" />
<Compile Include="ObjectReader.cs" />
<Compile Include="ObjectWriter.cs" />
<Compile Include="PrimitiveReader.cs" />
<Compile Include="PrimitiveWriter.cs" />
<Compile Include="Serializer.cs" />
<Compile Include="TransientAttribute.cs" />
<Compile Include="Utilities\AutoResizingList.cs" />
<Compile Include="Hooks\PreSerializationAttribute.cs" />
<Compile Include="SerializationType.cs" />
<Compile Include="Customization\Settings.cs" />
<Compile Include="Customization\Method.cs" />
<Compile Include="Generators\WriteMethodGenerator.cs" />
<Compile Include="Hooks\LatePostDeserializationAttribute.cs" />
<Compile Include="Hooks\LatePostSerializationAttribute.cs" />
<Compile Include="Hooks\PostSerializationAttribute.cs" />
<Compile Include="Hooks\PostDeserializationAttribute.cs" />
<Compile Include="Generators\ReadMethodGenerator.cs" />
<Compile Include="VersionTolerance\FieldInfoOrEntryToOmit.cs" />
<Compile Include="VersionTolerance\StampHelpers.cs" />
<Compile Include="Generators\GeneratorHelper.cs" />
<Compile Include="Customization\VersionToleranceLevel.cs" />
<Compile Include="CollectionMetaToken.cs" />
<Compile Include="BultinSurrogates\SurrogateForISerializable.cs" />
<Compile Include="DeserializationResult.cs" />
<Compile Include="VersionTolerance\TypeDescriptor.cs" />
<Compile Include="VersionTolerance\FieldDescriptor.cs" />
<Compile Include="ObjectIdentifierContext.cs" />
<Compile Include="Customization\ReferencePreservation.cs" />
<Compile Include="Utilities\PeekableStream.cs" />
<Compile Include="BultinSurrogates\SurrogateForIXmlSerializable.cs" />
<Compile Include="VersionTolerance\AssemblyDescriptor.cs" />
<Compile Include="VersionTolerance\VersionToleranceException.cs" />
<Compile Include="VersionTolerance\ModuleDescriptor.cs" />
<Compile Include="Utilities\IdentifiedElementsList.cs" />
<Compile Include="Utilities\IIdentifiedElement.cs" />
<Compile Include="VersionTolerance\MethodDescriptor.cs" />
<Compile Include="TypeOrGenericTypeArgument.cs" />
<Compile Include="Utilities\IdentifiedElementsDictionary.cs" />
<Compile Include="Utilities\SwapList.cs" />
<Compile Include="VersionTolerance\ArrayDescriptor.cs" />
<Compile Include="VersionTolerance\TypeSimpleDescriptor.cs" />
<Compile Include="VersionTolerance\TypeFullDescriptor.cs" />
<Compile Include="Utilities\TypeProvider.cs" />
<Compile Include="Utilities\OneToManyMap.cs" />
<Compile Include="BultinSurrogates\SurrogateForReadOnlyCollection.cs" />
<Compile Include="Utilities\OneToOneMap.cs" />
<Compile Include="Generators\CreateObjectGenerator.cs" />
<Compile Include="Generators\TouchInlinedObjectGenerator.cs" />
<Compile Include="Generators\ReaderGenerationContext.cs" />
<Compile Include="Generators\CompletedGenerator.cs" />
<Compile Include="Utilities\DynamicMethodProvider.cs" />
<Compile Include="Generators\DynamicMethodGenerator.cs" />
<Compile Include="Generators\WriterGenerationContext.cs" />
<Compile Include="Generators\GenerationContextBase.cs" />
<Compile Include="Generators\SurrogateObjectIfNeededMethodGenerator.cs" />
<Compile Include="Generators\HandleNewReferenceMethodGenerator.cs" />
<Compile Include="Generators\WriteReferenceMethodGenerator.cs" />
<Compile Include="Utilities\Variable.cs" />
<Compile Include="Generators\CallPostSerializationHooksMethodGenerator.cs" />
<Compile Include="Generators\DynamicWriteMethodGenerator.cs" />
<Compile Include="Generators\DynamicReadMethodGenerator.cs" />
<Compile Include="Generators\CloneContentMethodGenerator.cs" />
<Compile Include="BultinSurrogates\SurrogateForDictionary.cs" />
<Compile Include="BultinSurrogates\ISurrogateRestorer.cs" />
<Compile Include="BultinSurrogates\SurrogateForHashSet.cs" />
<Compile Include="BultinSurrogates\SurrogateForHashtable.cs" />
<Compile Include="Generators\CreateGenericSurrogateMethodGenerator.cs" />
<ItemGroup Condition=" '$(TargetFramework)' == 'netstandard2.0'">
<PackageReference Include="Microsoft.CSharp" Version="4.5.0" />
<PackageReference Include="System.Dynamic.Runtime" Version="4.3.0" />
<PackageReference Include="System.Reflection.Emit" Version="4.3.0" />
<PackageReference Include="System.Reflection.Emit.Lightweight" Version="4.3.0" />
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
<ItemGroup>
<Folder Include="Utilities\" />
<Folder Include="Hooks\" />
<Folder Include="Customization\" />
<Folder Include="Generators\" />
<Folder Include="VersionTolerance\" />
<Folder Include="BultinSurrogates\" />
<PropertyGroup Condition=" '$(TargetFramework)' == 'netstandard2.0'">
<DefineConstants>NETSTANDARD2_0</DefineConstants>
</PropertyGroup>
<ItemGroup Condition=" '$(TargetFramework)' == 'net45'">
<Reference Include="Microsoft.CSharp" />
</ItemGroup>
<PropertyGroup Condition=" '$(TargetFramework)' == 'net45'">
<DefineConstants>NET45</DefineConstants>
</PropertyGroup>
<ProjectExtensions>
<MonoDevelop>
<Properties>
Expand Down
14 changes: 11 additions & 3 deletions MigrantWithTests.sln
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@

Microsoft Visual Studio Solution File, Format Version 11.00
# Visual Studio 2010
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 15
VisualStudioVersion = 15.0.27703.2035
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Migrant", "Migrant\Migrant.csproj", "{5F87C357-09FB-4F53-BE37-41FE5BD88957}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Tests", "Tests\Tests.csproj", "{6109E322-4AC0-496C-89A2-012232A047E3}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TestsSecondModule", "Tests\SecondModule\TestsSecondModule.csproj", "{560B93C1-E336-47DA-A879-4E9C5B75A927}"
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TestsSecondModule", "TestsSecondModule\TestsSecondModule.csproj", "{560B93C1-E336-47DA-A879-4E9C5B75A927}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PerformanceTester", "PerformanceTester\PerformanceTester.csproj", "{72492444-329C-42B1-B1E7-7A9B3BCA0953}"
EndProject
Expand Down Expand Up @@ -41,6 +43,12 @@ Global
{72492444-329C-42B1-B1E7-7A9B3BCA0953}.Release|Any CPU.ActiveCfg = Release|Any CPU
{72492444-329C-42B1-B1E7-7A9B3BCA0953}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {90FE339D-D30D-4C48-9124-23DE8B705572}
EndGlobalSection
GlobalSection(MonoDevelopProperties) = preSolution
Policies = $0
$0.StandardHeader = $1
Expand Down
67 changes: 8 additions & 59 deletions PerformanceTester/PerformanceTester.csproj
Original file line number Diff line number Diff line change
@@ -1,74 +1,23 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProductVersion>8.0.30703</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{72492444-329C-42B1-B1E7-7A9B3BCA0953}</ProjectGuid>
<OutputType>Exe</OutputType>
<RootNamespace>Antmicro.Migrant.PerformanceTester</RootNamespace>
<AssemblyName>PerformanceTester</AssemblyName>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug</OutputPath>
<DefineConstants>DEBUG;</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<Externalconsole>true</Externalconsole>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>full</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release</OutputPath>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<Externalconsole>true</Externalconsole>
<Copyright>houen</Copyright>
<AssemblyVersion>1.0.*</AssemblyVersion>
<TargetFramework>net45</TargetFramework>
<Deterministic>False</Deterministic>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="protobuf-net">
<HintPath>..\packages\protobuf-net.2.0.0.668\lib\net40\protobuf-net.dll</HintPath>
</Reference>
<Reference Include="System.Xml" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="CommandLine">
<HintPath>..\packages\CommandLineParser.1.9.71\lib\net45\CommandLine.dll</HintPath>
</Reference>
</ItemGroup>
<ItemGroup>
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="TestType.cs" />
<Compile Include="SerializerType.cs" />
<Compile Include="Serializers\MigrantSerializer.cs" />
<Compile Include="Serializers\ProtobufSerializer.cs" />
<Compile Include="Serializers\ISerializer.cs" />
<Compile Include="Tests\SimpleClassTest.cs" />
<Compile Include="Tests\SimpleStructTest.cs" />
<Compile Include="Tests\ITest.cs" />
<Compile Include="TestRunner.cs" />
<Compile Include="Serializers\SerializerFactory.cs" />
<Compile Include="Helpers.cs" />
<Compile Include="TestResult.cs" />
<Compile Include="Options.cs" />
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
<ItemGroup>
<Folder Include="Serializers\" />
<Folder Include="Tests\" />
</ItemGroup>
<ItemGroup>
<None Include="packages.config" />
<PackageReference Include="CommandLineParser" Version="1.9.71" />
<PackageReference Include="protobuf-net" Version="2.0.0.668" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Migrant\Migrant.csproj">
<Project>{5F87C357-09FB-4F53-BE37-41FE5BD88957}</Project>
<Name>Migrant</Name>
</ProjectReference>
<ProjectReference Include="..\Migrant\Migrant.csproj" />
</ItemGroup>
</Project>
Loading