Protocol Buffers - Google's data interchange format (grpc依赖)
https://developers.google.com/protocol-buffers/
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
86 lines
4.4 KiB
86 lines
4.4 KiB
15 years ago
|
<?xml version="1.0" encoding="utf-8"?>
|
||
|
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||
|
|
||
|
<Target Name="_Clean">
|
||
|
<RemoveDir Directories="@(WorkingDirectories)" Condition="Exists(%(WorkingDirectories.Identity))" />
|
||
|
<MakeDir Directories="@(WorkingDirectories)" />
|
||
|
</Target>
|
||
|
|
||
|
<Target Name="_Compile">
|
||
|
<MSBuild Projects="%(Solution.Identity)" Properties="Configuration=%(Solution.Configuration);Platform=%(Solution.Platform)"
|
||
15 years ago
|
Targets="%(Solution.BuildTarget)" BuildInParallel="true" Condition="%(Solution.CompileGroup) == $(CompileGroup)" ToolsVersion="4.0" />
|
||
15 years ago
|
</Target>
|
||
|
|
||
|
<Target Name="_EnsureEnvironment">
|
||
|
<Error Text="Tool "Protoc" could not be found at path $(ProtocExePath)" Condition="!Exists($(ProtocExePath))" />
|
||
|
<Error Text="Tool "Protogen" could not be found at path $(ProtogenExePath)" Condition="!Exists($(ProtogenExePath))" />
|
||
|
</Target>
|
||
|
|
||
15 years ago
|
<Target Name="_GenerateSource" DependsOnTargets="_Clean;_Compile;_Compile">
|
||
15 years ago
|
<PropertyGroup>
|
||
|
<ProtosList>@(Protos)</ProtosList>
|
||
|
<Args>$(ProtosList.Replace(`;`,` `))</Args>
|
||
|
</PropertyGroup>
|
||
|
|
||
|
<Exec Command="$(ProtocExePath) --proto_path=$(ProtosDirectory) --descriptor_set_out=compiled.pb $(Args)" WorkingDirectory="$(BuildTempDirectory)" />
|
||
|
<Exec Command="$(ProtogenExePath) compiled.pb" WorkingDirectory="$(BuildTempDirectory)" />
|
||
|
</Target>
|
||
|
|
||
15 years ago
|
<Target Name="_CopyGeneratedSource" DependsOnTargets="_GenerateSource">
|
||
15 years ago
|
<Copy SourceFiles="%(GeneratedSource.Identity)" DestinationFiles="%(GeneratedSource.TargetDirectory)\%(GeneratedSource.Filename)%(GeneratedSource.Extension)" />
|
||
|
</Target>
|
||
|
|
||
15 years ago
|
<Target Name="_CompileGeneratedSource" DependsOnTargets="_CopyGeneratedSource">
|
||
|
<MSBuild Projects="%(Solution.Identity)" Properties="Configuration=%(Solution.Configuration);Platform=%(Solution.Platform)"
|
||
|
Targets="%(Solution.BuildTarget)" BuildInParallel="true" Condition="%(Solution.CompileGroup) == $(CompileGroup)" />
|
||
|
</Target>
|
||
|
|
||
|
<Target Name="_Test" DependsOnTargets="_CompileGeneratedSource">
|
||
15 years ago
|
<Exec Command=""$(NUnitExePath)" %(NUnitTests.Identity) /xml=%(NUnitTests.Filename)%(NUnitTests.Extension).xml" WorkingDirectory="$(BuildTempDirectory)" />
|
||
|
</Target>
|
||
|
|
||
15 years ago
|
<Target Name="_Package" DependsOnTargets="_CopyGeneratedSource">
|
||
15 years ago
|
<Copy SourceFiles="@(PackageContents)" DestinationFolder="$(PackageOutputDirectory)\%(PackageContents.TargetDirectory)\%(PackageContents.RecursiveDir)" />
|
||
|
</Target>
|
||
|
|
||
|
<!--
|
||
15 years ago
|
BENCHMARK - this needs optimising
|
||
15 years ago
|
-->
|
||
|
<Target Name="_GenerateBenchmarkSource">
|
||
|
<PropertyGroup>
|
||
|
<Args>$(BenchmarkProtosDirectory)\google_size.proto $(BenchmarkProtosDirectory)\google_speed.proto</Args>
|
||
|
</PropertyGroup>
|
||
|
|
||
|
<Exec Command="$(ProtocExePath) --proto_path=$(BenchmarkProtosDirectory);$(ProtosDirectory) --include_imports=compiled.pb --descriptor_set_out=compiled.pb $(Args)" WorkingDirectory="$(BenchmarkTempDirectory)" />
|
||
|
<Exec Command="$(ProtogenExePath) compiled.pb" WorkingDirectory="$(BenchmarkTempDirectory)" />
|
||
|
</Target>
|
||
|
|
||
|
<Target Name="_CompileBenchmarkAssembly">
|
||
|
<ItemGroup>
|
||
|
<BenchmarkSources Include="$(BenchmarkTempDirectory)\GoogleSizeProtoFile.cs" />
|
||
|
<BenchmarkSources Include="$(BenchmarkTempDirectory)\GoogleSpeedProtoFile.cs" />
|
||
|
</ItemGroup>
|
||
|
|
||
|
<Csc TargetType="library" OutputAssembly="$(BenchmarkTempDirectory)\BenchmarkTypes.dll" Optimize="true" Sources="@(BenchmarkSources)"
|
||
|
References="$(SourceDirectory)\ProtocolBuffers\bin\$(BuildConfiguration)\Google.ProtocolBuffers.dll" />
|
||
|
</Target>
|
||
|
|
||
|
<Target Name="_PrepareBenchmarkEnvironment">
|
||
|
<ItemGroup>
|
||
|
<BenchmarkResources Include="$(BenchmarkProtosDirectory)\google_message1.dat" />
|
||
|
<BenchmarkResources Include="$(BenchmarkProtosDirectory)\google_message2.dat" />
|
||
|
<BenchmarkResources Include="$(SourceDirectory)\ProtoBench\bin\$(BuildConfiguration)\ProtoBench.exe" />
|
||
|
</ItemGroup>
|
||
|
|
||
|
<Copy SourceFiles="@(BenchmarkResources)" DestinationFolder="$(BenchmarkTempDirectory)" />
|
||
|
</Target>
|
||
|
|
||
|
<Target Name="_RunBenchmark">
|
||
|
<PropertyGroup>
|
||
|
<Args>Google.ProtocolBuffers.ProtoBench.SizeMessage1,BenchmarkTypes google_message1.dat Google.ProtocolBuffers.ProtoBench.SpeedMessage1,BenchmarkTypes google_message1.dat Google.ProtocolBuffers.ProtoBench.SizeMessage2,BenchmarkTypes google_message2.dat Google.ProtocolBuffers.ProtoBench.SpeedMessage2,BenchmarkTypes google_message2.dat</Args>
|
||
|
</PropertyGroup>
|
||
|
|
||
|
<Exec Command="ProtoBench.exe $(Args)" WorkingDirectory="$(BenchmarkTempDirectory)" />
|
||
|
</Target>
|
||
|
|
||
|
</Project>
|