|
1 |
| -<?xml version="1.0" encoding="utf-8"?> |
2 |
| -<Project InitialTargets="GenerateCodeFirst"> |
3 |
| - <PropertyGroup> |
4 |
| - <CodeGenerationOutputPath>$(MSBuildProjectDirectory)\..\lkg\</CodeGenerationOutputPath> |
5 |
| - </PropertyGroup> |
| 1 | +<Project> |
6 | 2 |
|
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"> |
28 | 3 | <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> |
34 | 9 | </PropertyGroup>
|
35 |
| - </Target> |
36 | 10 |
|
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> |
63 | 45 |
|
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> |
71 | 50 |
|
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" /> |
76 | 56 |
|
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> |
82 | 63 |
|
83 |
| - <ItemGroup> |
84 |
| - <EmbeddedResource Include="$(CommitIdVersionPath)"> |
85 |
| - <LogicalName>$(RootNamespace).libgit2sharp_hash.txt</LogicalName> |
86 |
| - </EmbeddedResource> |
87 |
| - </ItemGroup> |
88 |
| - </Target> |
89 | 64 | </Project>
|
0 commit comments