Skip to content

Commit 12550d6

Browse files
committed
Remove CodeGeneration
1 parent 49542c1 commit 12550d6

10 files changed

+61
-471
lines changed

CodeGeneration/CodeGeneration.csproj

Lines changed: 0 additions & 12 deletions
This file was deleted.

CodeGeneration/OfferFriendlyInteropOverloadsGenerator.cs

Lines changed: 0 additions & 312 deletions
This file was deleted.

CodeGenerationAttributes/CodeGenerationAttributes.csproj

Lines changed: 0 additions & 12 deletions
This file was deleted.

CodeGenerationAttributes/CustomMarshalerAttribute.cs

Lines changed: 0 additions & 21 deletions
This file was deleted.

CodeGenerationAttributes/OfferFriendlyInteropOverloadsAttribute.cs

Lines changed: 0 additions & 16 deletions
This file was deleted.

LibGit2Sharp.sln

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,10 @@
1-
21
Microsoft Visual Studio Solution File, Format Version 12.00
32
# Visual Studio 15
4-
VisualStudioVersion = 15.0.26407.1
3+
VisualStudioVersion = 15.0.26724.1
54
MinimumVisualStudioVersion = 10.0.40219.1
6-
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LibGit2Sharp", "LibGit2Sharp\LibGit2Sharp.csproj", "{EE6ED99F-CB12-4683-B055-D28FC7357A34}"
5+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LibGit2Sharp", "LibGit2Sharp\LibGit2Sharp.csproj", "{EE6ED99F-CB12-4683-B055-D28FC7357A34}"
76
EndProject
8-
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LibGit2Sharp.Tests", "LibGit2Sharp.Tests\LibGit2Sharp.Tests.csproj", "{286E63EB-04DD-4ADE-88D6-041B57800761}"
9-
EndProject
10-
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CodeGenerationAttributes", "CodeGenerationAttributes\CodeGenerationAttributes.csproj", "{E1A8B99F-B2F6-4A38-9DF6-8792056D70FF}"
7+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LibGit2Sharp.Tests", "LibGit2Sharp.Tests\LibGit2Sharp.Tests.csproj", "{286E63EB-04DD-4ADE-88D6-041B57800761}"
118
EndProject
129
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{0CA739FD-DA4D-4F64-9834-DA14A3ECD04B}"
1310
ProjectSection(SolutionItems) = preProject
@@ -17,8 +14,6 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution
1714
EndProjectSection
1815
EndProject
1916
Global
20-
GlobalSection(SharedMSBuildProjectFiles) = preSolution
21-
EndGlobalSection
2217
GlobalSection(SolutionConfigurationPlatforms) = preSolution
2318
Debug|Any CPU = Debug|Any CPU
2419
Release|Any CPU = Release|Any CPU
@@ -32,12 +27,11 @@ Global
3227
{286E63EB-04DD-4ADE-88D6-041B57800761}.Debug|Any CPU.Build.0 = Debug|Any CPU
3328
{286E63EB-04DD-4ADE-88D6-041B57800761}.Release|Any CPU.ActiveCfg = Release|Any CPU
3429
{286E63EB-04DD-4ADE-88D6-041B57800761}.Release|Any CPU.Build.0 = Release|Any CPU
35-
{E1A8B99F-B2F6-4A38-9DF6-8792056D70FF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
36-
{E1A8B99F-B2F6-4A38-9DF6-8792056D70FF}.Debug|Any CPU.Build.0 = Debug|Any CPU
37-
{E1A8B99F-B2F6-4A38-9DF6-8792056D70FF}.Release|Any CPU.ActiveCfg = Release|Any CPU
38-
{E1A8B99F-B2F6-4A38-9DF6-8792056D70FF}.Release|Any CPU.Build.0 = Release|Any CPU
3930
EndGlobalSection
4031
GlobalSection(SolutionProperties) = preSolution
4132
HideSolutionNode = FALSE
4233
EndGlobalSection
34+
GlobalSection(ExtensibilityGlobals) = postSolution
35+
SolutionGuid = {9BD5F77D-E47D-4621-9AA0-8598766902B9}
36+
EndGlobalSection
4337
EndGlobal

LibGit2Sharp/CodeGenerator.targets

Lines changed: 55 additions & 80 deletions
Original file line numberDiff line numberDiff line change
@@ -1,89 +1,64 @@
1-
<?xml version="1.0" encoding="utf-8"?>
2-
<Project InitialTargets="GenerateCodeFirst">
3-
<PropertyGroup>
4-
<CodeGenerationOutputPath>$(MSBuildProjectDirectory)\..\lkg\</CodeGenerationOutputPath>
5-
</PropertyGroup>
1+
<Project>
62

7-
<ItemGroup>
8-
<GeneratorAssemblySearchPaths Include="$(CodeGenerationOutputPath)">
9-
<Visible>false</Visible>
10-
</GeneratorAssemblySearchPaths>
11-
</ItemGroup>
12-
<!-- Related to https://github.com/dotnet/sdk/issues/939, this carefully written ProjectReference
13-
allows MSBuild to get the build order right without given nuget grief at the command line.
14-
Sadly, it still causes failures when run in VS or Travis CI: https://travis-ci.org/libgit2/libgit2sharp/jobs/220381005#L788
15-
So instead, we control build ordering in VS via a project dependency expressed in the SLN file,
16-
and a preliminary build of the project referenced below in Travis and AppVeyor.
17-
<ItemGroup>
18-
<ProjectReference Include="..\CodeGeneration\CodeGeneration.csproj">
19-
<ReferenceOutputAssembly>false</ReferenceOutputAssembly>
20-
<SkipGetTargetFrameworkProperties>true</SkipGetTargetFrameworkProperties>
21-
<UndefineProperties>TargetFramework</UndefineProperties>
22-
<Properties>Configuration=$(CodeGeneratorConfiguration);Platform=AnyCPU</Properties>
23-
</ProjectReference>
24-
</ItemGroup>
25-
-->
26-
27-
<Target Name="GenerateCodeFirst">
283
<PropertyGroup>
29-
<CoreCompileDependsOn>$(CoreCompileDependsOn);GenerateNativeDllNameCs</CoreCompileDependsOn>
30-
<PrepareResourceNamesDependsOn>GenerateCommitIdVersion;$(PrepareResourceNamesDependsOn)</PrepareResourceNamesDependsOn>
31-
<NativeDllNamePath>$(IntermediateOutputPath)NativeDllName.cs</NativeDllNamePath>
32-
<UniqueIdentifierPath>$(IntermediateOutputPath)UniqueIdentifier.cs</UniqueIdentifierPath>
33-
<CommitIdVersionPath>$(IntermediateOutputPath)libgit2sharp_hash.txt</CommitIdVersionPath>
4+
<CoreCompileDependsOn>$(CoreCompileDependsOn);GenerateNativeDllNameCs</CoreCompileDependsOn>
5+
<PrepareResourceNamesDependsOn>GenerateCommitIdVersion;$(PrepareResourceNamesDependsOn)</PrepareResourceNamesDependsOn>
6+
<NativeDllNamePath>$(IntermediateOutputPath)NativeDllName.cs</NativeDllNamePath>
7+
<UniqueIdentifierPath>$(IntermediateOutputPath)UniqueIdentifier.cs</UniqueIdentifierPath>
8+
<CommitIdVersionPath>$(IntermediateOutputPath)libgit2sharp_hash.txt</CommitIdVersionPath>
349
</PropertyGroup>
35-
</Target>
3610

37-
<Target Name="GenerateNativeDllNameCs"
38-
Inputs="@(EmbeddedResource)"
39-
Outputs="$(NativeDllNamePath)">
40-
<ReadLinesFromFile File="@(EmbeddedResource)"
41-
Condition=" '%(Filename)%(Extension)' == 'libgit2_filename.txt' ">
42-
<Output TaskParameter="Lines" PropertyName="libgit2FileName" />
43-
</ReadLinesFromFile>
44-
<PropertyGroup>
45-
<NativeDllNameSourceLines>
46-
namespace LibGit2Sharp.Core
47-
{
48-
internal static class NativeDllName
49-
{
50-
public const string Name = "$(libgit2FileName)"%3b
51-
}
52-
}
53-
</NativeDllNameSourceLines>
54-
</PropertyGroup>
55-
<WriteLinesToFile File="$(NativeDllNamePath)"
56-
Lines="$(NativeDllNameSourceLines)"
57-
Overwrite="true" />
58-
<ItemGroup>
59-
<Compile Include="$(NativeDllNamePath)" />
60-
<FileWrites Include="$(NativeDllNamePath)" />
61-
</ItemGroup>
62-
</Target>
11+
<Target Name="GenerateNativeDllNameCs"
12+
Inputs="@(EmbeddedResource)"
13+
Outputs="$(NativeDllNamePath)">
14+
<ReadLinesFromFile File="@(EmbeddedResource)"
15+
Condition=" '%(Filename)%(Extension)' == 'libgit2_filename.txt' ">
16+
<Output TaskParameter="Lines" PropertyName="libgit2FileName" />
17+
</ReadLinesFromFile>
18+
<PropertyGroup>
19+
<NativeDllNameSourceLines>
20+
namespace LibGit2Sharp.Core
21+
{
22+
internal static class NativeDllName
23+
{
24+
public const string Name = "$(libgit2FileName)"%3b
25+
}
26+
}
27+
</NativeDllNameSourceLines>
28+
</PropertyGroup>
29+
<WriteLinesToFile File="$(NativeDllNamePath)"
30+
Lines="$(NativeDllNameSourceLines)"
31+
Overwrite="true" />
32+
<ItemGroup>
33+
<Compile Include="$(NativeDllNamePath)" />
34+
<FileWrites Include="$(NativeDllNamePath)" />
35+
</ItemGroup>
36+
</Target>
37+
38+
<Target Name="AddNativeDllCommitShaToBuildMetadata"
39+
BeforeTargets="GetBuildVersion"
40+
Condition=" '$(IsCrossTargetingBuild)' != 'true' ">
41+
<ReadLinesFromFile File="@(EmbeddedResource)"
42+
Condition=" '%(Filename)%(Extension)' == 'libgit2_hash.txt' ">
43+
<Output TaskParameter="Lines" PropertyName="libgit2hash" />
44+
</ReadLinesFromFile>
6345

64-
<Target Name="AddNativeDllCommitShaToBuildMetadata"
65-
BeforeTargets="GetBuildVersion"
66-
Condition=" '$(IsCrossTargetingBuild)' != 'true' ">
67-
<ReadLinesFromFile File="@(EmbeddedResource)"
68-
Condition=" '%(Filename)%(Extension)' == 'libgit2_hash.txt' ">
69-
<Output TaskParameter="Lines" PropertyName="libgit2hash" />
70-
</ReadLinesFromFile>
46+
<ItemGroup>
47+
<BuildMetadata Include="LibGit2-$(libgit2hash.Substring(0,7))" />
48+
</ItemGroup>
49+
</Target>
7150

72-
<ItemGroup>
73-
<BuildMetadata Include="LibGit2-$(libgit2hash.Substring(0,7))" />
74-
</ItemGroup>
75-
</Target>
51+
<Target Name="GenerateCommitIdVersion"
52+
DependsOnTargets="GetBuildVersion">
53+
<WriteLinesToFile File="$(CommitIdVersionPath)"
54+
Lines="$(GitCommitId)"
55+
Overwrite="true" />
7656

77-
<Target Name="GenerateCommitIdVersion"
78-
DependsOnTargets="GetBuildVersion">
79-
<WriteLinesToFile File="$(CommitIdVersionPath)"
80-
Lines="$(GitCommitId)"
81-
Overwrite="true" />
57+
<ItemGroup>
58+
<EmbeddedResource Include="$(CommitIdVersionPath)">
59+
<LogicalName>$(RootNamespace).libgit2sharp_hash.txt</LogicalName>
60+
</EmbeddedResource>
61+
</ItemGroup>
62+
</Target>
8263

83-
<ItemGroup>
84-
<EmbeddedResource Include="$(CommitIdVersionPath)">
85-
<LogicalName>$(RootNamespace).libgit2sharp_hash.txt</LogicalName>
86-
</EmbeddedResource>
87-
</ItemGroup>
88-
</Target>
8964
</Project>

LibGit2Sharp/LibGit2Sharp.csproj

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,16 +27,10 @@
2727
<DependentUpon>Objects.tt</DependentUpon>
2828
</Compile>
2929
</ItemGroup>
30-
<ItemGroup>
31-
<ProjectReference Include="..\CodeGenerationAttributes\CodeGenerationAttributes.csproj" PrivateAssets="all" />
32-
</ItemGroup>
3330
<ItemGroup>
3431
<PackageReference Include="LibGit2Sharp.NativeBinaries" Version="[1.0.185]" PrivateAssets="contentFiles" />
3532
<PackageReference Include="SourceLink.Create.GitHub" Version="2.1.2" PrivateAssets="all" />
3633
<DotNetCliToolReference Include="dotnet-sourcelink-git" Version="2.1.2" />
37-
38-
<PackageReference Include="CodeGeneration.Roslyn.BuildTime" Version="$(CodeGenerationRoslynVersion)" PrivateAssets="all" />
39-
<DotNetCliToolReference Include="dotnet-codegen" Version="$(CodeGenerationRoslynVersion)" />
4034
</ItemGroup>
4135
<ItemGroup Condition=" '$(TargetFramework)' == 'netstandard1.3' ">
4236
<PackageReference Include="System.Security.SecureString" Version="4.0.0" />

lkg/CodeGeneration.dll

-20.5 KB
Binary file not shown.

lkg/CodeGeneration.pdb

-3.79 KB
Binary file not shown.

0 commit comments

Comments
 (0)