Skip to content

Commit

Permalink
Update code generation to use .NET SDK projects
Browse files Browse the repository at this point in the history
  • Loading branch information
AArnott committed Mar 12, 2017
1 parent 4ca2bbb commit d851767
Show file tree
Hide file tree
Showing 22 changed files with 33 additions and 365 deletions.
6 changes: 0 additions & 6 deletions CodeGeneration.Debugging/App.config

This file was deleted.

60 changes: 3 additions & 57 deletions CodeGeneration.Debugging/CodeGeneration.Debugging.csproj
Original file line number Diff line number Diff line change
@@ -1,60 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{C9212ECC-76F0-4658-9C89-DD506EE788B5}</ProjectGuid>
<OutputType>Exe</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>CodeGeneration.Debugging</RootNamespace>
<AssemblyName>CodeGeneration.Debugging</AssemblyName>
<TargetFrameworkVersion>v4.6</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
<TargetFramework>net46</TargetFramework>
<IsPackable>false</IsPackable>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Net.Http" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<None Include="App.config" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>
36 changes: 0 additions & 36 deletions CodeGeneration.Debugging/Properties/AssemblyInfo.cs

This file was deleted.

67 changes: 7 additions & 60 deletions CodeGeneration/CodeGeneration.csproj
Original file line number Diff line number Diff line change
@@ -1,65 +1,12 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{6598997B-9419-4CC1-84FF-9621B555E9C0}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>CodeGeneration</RootNamespace>
<AssemblyName>CodeGeneration</AssemblyName>
<TargetFrameworkVersion>v4.6</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<TargetFrameworkProfile />
<TargetFramework>netstandard1.3</TargetFramework>
<PackageTargetFallback>$(PackageTargetFallback);portable-net45+win8+wp8+wpa81;</PackageTargetFallback>
<IsPackable>false</IsPackable>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup>
<SignAssembly>true</SignAssembly>
</PropertyGroup>
<PropertyGroup>
<AssemblyOriginatorKeyFile>libgit2sharp.snk</AssemblyOriginatorKeyFile>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Net.Http" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="OfferFriendlyInteropOverloadsGenerator.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>

<ItemGroup>
<None Include="libgit2sharp.snk" />
<None Include="project.json" />
<PackageReference Include="CodeGeneration.Roslyn" Version="0.2.10" />
<PackageReference Include="Nerdbank.GitVersioning" Version="1.6.19-beta" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>
10 changes: 5 additions & 5 deletions CodeGeneration/OfferFriendlyInteropOverloadsGenerator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ private BlockSyntax CreateBodyFor(MethodDeclarationSyntax innerMethod, IEnumerab
SyntaxFactory.MemberAccessExpression(
SyntaxKind.SimpleMemberAccessExpression,
SyntaxFactory.IdentifierName(marshalerLocalName),
SyntaxFactory.IdentifierName(nameof(ICustomMarshaler.MarshalManagedToNative))))
SyntaxFactory.IdentifierName("MarshalManagedToNative")))
.AddArgumentListArguments(SyntaxFactory.Argument(SyntaxFactory.IdentifierName(parameter.OriginalParameter.Identifier)));
var localVarIdentifier = SyntaxFactory.IdentifierName(Invariant($"_{parameter.OriginalParameter.Identifier.ValueText}"));
inputMarshaling.Add(
Expand All @@ -192,7 +192,7 @@ private BlockSyntax CreateBodyFor(MethodDeclarationSyntax innerMethod, IEnumerab
SyntaxFactory.MemberAccessExpression(
SyntaxKind.SimpleMemberAccessExpression,
SyntaxFactory.IdentifierName(marshalerLocalName),
SyntaxFactory.IdentifierName(nameof(ICustomMarshaler.MarshalNativeToManaged))),
SyntaxFactory.IdentifierName("MarshalNativeToManaged")),
SyntaxFactory.ArgumentList(SyntaxFactory.SingletonSeparatedList(SyntaxFactory.Argument(
SyntaxFactory.ObjectCreationExpression(
IntPtrTypeSyntax,
Expand All @@ -209,7 +209,7 @@ private BlockSyntax CreateBodyFor(MethodDeclarationSyntax innerMethod, IEnumerab
SyntaxFactory.MemberAccessExpression(
SyntaxKind.SimpleMemberAccessExpression,
SyntaxFactory.IdentifierName(marshalerLocalName),
SyntaxFactory.IdentifierName(nameof(ICustomMarshaler.CleanUpNativeData))))
SyntaxFactory.IdentifierName("CleanUpNativeData")))
.AddArgumentListArguments(SyntaxFactory.Argument(cleanUpExpression))));
}

Expand Down Expand Up @@ -245,7 +245,7 @@ private BlockSyntax CreateBodyFor(MethodDeclarationSyntax innerMethod, IEnumerab
SyntaxFactory.MemberAccessExpression(
SyntaxKind.SimpleMemberAccessExpression,
SyntaxFactory.IdentifierName(marshalerLocalName),
SyntaxFactory.IdentifierName(nameof(ICustomMarshaler.MarshalNativeToManaged))),
SyntaxFactory.IdentifierName("MarshalNativeToManaged")),
SyntaxFactory.ArgumentList(SyntaxFactory.SingletonSeparatedList(SyntaxFactory.Argument(resultLocal)))));

invocationStatement = SyntaxFactory.ExpressionStatement(intPtrResultExpression);
Expand All @@ -256,7 +256,7 @@ private BlockSyntax CreateBodyFor(MethodDeclarationSyntax innerMethod, IEnumerab
SyntaxFactory.MemberAccessExpression(
SyntaxKind.SimpleMemberAccessExpression,
SyntaxFactory.IdentifierName(marshalerLocalName),
SyntaxFactory.IdentifierName(nameof(ICustomMarshaler.CleanUpNativeData))))
SyntaxFactory.IdentifierName("CleanUpNativeData")))
.AddArgumentListArguments(SyntaxFactory.Argument(resultLocal))));
}
else
Expand Down
5 changes: 0 additions & 5 deletions CodeGeneration/Properties/AssemblyInfo.cs

This file was deleted.

12 changes: 0 additions & 12 deletions CodeGeneration/project.json

This file was deleted.

This file was deleted.

5 changes: 0 additions & 5 deletions CodeGenerationAttributes.Net40/Properties/AssemblyInfo.cs

This file was deleted.

Binary file removed CodeGenerationAttributes.Net40/libgit2sharp.snk
Binary file not shown.
12 changes: 0 additions & 12 deletions CodeGenerationAttributes.Net40/project.json

This file was deleted.

This file was deleted.

7 changes: 0 additions & 7 deletions CodeGenerationAttributes.Portable/Properties/AssemblyInfo.cs

This file was deleted.

Binary file removed CodeGenerationAttributes.Portable/libgit2sharp.snk
Binary file not shown.
Loading

0 comments on commit d851767

Please sign in to comment.