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.
115 lines
6.7 KiB
115 lines
6.7 KiB
<?xml version="1.0" encoding="utf-8"?> |
|
|
|
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> |
|
|
|
<Target Name="_BuildSolution"> |
|
<Message Text="Running $(SolutionTarget) $(BuildConfiguration) with $(BuildTools) on $(SolutionFile)" Importance="normal" /> |
|
<MSBuild Targets="$(SolutionTarget)" Projects="$(SolutionFile)" ToolsVersion="$(BuildTools)" |
|
Properties="Configuration=$(BuildConfiguration);$(ForcedFrameworkVersion)TreatWarningsAsErrors=true;" |
|
/> |
|
</Target> |
|
|
|
<Target Name="_Clean"> |
|
<RemoveDir Directories="@(WorkingDirectories)" Condition="Exists(%(WorkingDirectories.Identity))" /> |
|
<MakeDir Directories="@(WorkingDirectories)" /> |
|
|
|
<MSBuild Projects="$(MSBuildProjectFullPath)" Properties="SolutionTarget=Clean;BuildConfiguration=$(BuildConfiguration)" Targets="_BuildSolution" ContinueOnError="true" /> |
|
</Target> |
|
|
|
<Target Name="_Compile"> |
|
<MSBuild Projects="$(MSBuildProjectFullPath)" Properties="SolutionTarget=Rebuild;BuildConfiguration=$(BuildConfiguration)" Targets="_BuildSolution" /> |
|
</Target> |
|
|
|
<Target Name="_CompileGeneratedSource" DependsOnTargets="_CopyGeneratedSource"> |
|
<MSBuild Projects="$(MSBuildProjectFullPath)" Properties="Step=Two;SolutionTarget=Build;BuildConfiguration=$(BuildConfiguration)" Targets="_BuildSolution" /> |
|
</Target> |
|
|
|
<Target Name="_GenerateSource"> |
|
<Exec Command="$(ProtocExePath) --proto_path=$(ProtosDirectory) --descriptor_set_out=compiled.pb @(Protos->'%(RelativeDir)%(Filename)%(Extension)', ' ')" WorkingDirectory="$(BuildTempDirectory)" /> |
|
<Exec Command="$(ProtogenExePath) compiled.pb" WorkingDirectory="$(BuildTempDirectory)" /> |
|
<!-- Generate the AddressBookProtos.cs directly --> |
|
<Exec Command="$(ProtogenExePath) --protoc_dir=$(LibDirectory) --proto_path=$(ProtosDirectory) $(ProtosDirectory)\tutorial\addressbook.proto -namespace=Google.ProtocolBuffers.Examples.AddressBook -umbrella_classname=AddressBookProtos" WorkingDirectory="$(BuildTempDirectory)" /> |
|
</Target> |
|
|
|
<Target Name="_CopyGeneratedSource" DependsOnTargets="_GenerateSource"> |
|
<Copy SourceFiles="%(GeneratedSource.Identity)" DestinationFiles="%(GeneratedSource.TargetDirectory)\%(GeneratedSource.Filename)%(GeneratedSource.Extension)" /> |
|
</Target> |
|
|
|
<Target Name="_Test" DependsOnTargets="_CompileGeneratedSource" Condition="$(BuildConfiguration)=='Debug' or $(BuildConfiguration)=='Release'"> |
|
<CallTarget Targets="_RunTests" /> |
|
</Target> |
|
|
|
<Target Name="_RunTests"> |
|
<Exec Command=""$(NUnitExePath)" /noshadow %(TestContainer.Identity) /xml:$(BuildTempDirectory)\..\%(TestContainer.Filename).$(BuildConfiguration).xml" /> |
|
</Target> |
|
|
|
<!--## Package Generation ##--> |
|
<Target Name="_CleanOutputDirectory"> |
|
<RemoveDir Directories="$(ProjectDirectory)\build_output\Package" ContinueOnError="true" /> |
|
<RemoveDir Directories="$(ProjectDirectory)\build_output" ContinueOnError="true" /> |
|
<MakeDir Directories="$(ProjectDirectory)\build_output" ContinueOnError="true" /> |
|
</Target> |
|
|
|
<Target Name="_PreparePackageComponent"> |
|
<Copy SourceFiles="@(DynamicPackageItem)" DestinationFolder="$(ProjectDirectory)\build_output\Package\$(BuildConfiguration)\%(DynamicPackageItem.TargetDirectory)\%(DynamicPackageItem.RecursiveDir)" /> |
|
</Target> |
|
|
|
<Target Name="_GeneratePackage"> |
|
<Copy SourceFiles="@(StaticPackageItem)" DestinationFolder="$(ProjectDirectory)\build_output\Package\%(StaticPackageItem.TargetDirectory)\%(StaticPackageItem.RecursiveDir)" /> |
|
<Exec Command=""$(ZipExePath)" a -tzip ..\$(PackageName) * -r" WorkingDirectory="$(ProjectDirectory)\build_output\Package" /> |
|
</Target> |
|
|
|
<!--## Benchmark ##--> |
|
<Target Name="_GenerateBenchmarkSource" DependsOnTargets="_Clean;_Compile"> |
|
<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="$(BuildTempDirectory)" /> |
|
<Exec Command="$(ProtogenExePath) compiled.pb" WorkingDirectory="$(BuildTempDirectory)" /> |
|
</Target> |
|
|
|
<Target Name="_CompileBenchmarkAssembly" DependsOnTargets="_GenerateBenchmarkSource"> |
|
<ItemGroup> |
|
<BenchmarkSources Include="$(BuildTempDirectory)\GoogleSizeProtoFile.cs" /> |
|
<BenchmarkSources Include="$(BuildTempDirectory)\GoogleSpeedProtoFile.cs" /> |
|
<BenchmarkSources Include="$(SourceDirectory)\ProtoBench\Properties\AssemblyInfo.cs" /> |
|
</ItemGroup> |
|
|
|
<Csc TargetType="library" OutputAssembly="$(BuildTempDirectory)\BenchmarkTypes.dll" Optimize="true" Sources="@(BenchmarkSources)" References="$(SourceDirectory)\ProtocolBuffers\bin\$(BuildConfiguration)\Google.ProtocolBuffers.dll" /> |
|
</Target> |
|
|
|
<Target Name="_PrepareBenchmarkEnvironment" DependsOnTargets="_CompileBenchmarkAssembly"> |
|
<ItemGroup> |
|
<BenchmarkResources Include="$(BenchmarkProtosDirectory)\google_message1.dat" /> |
|
<BenchmarkResources Include="$(BenchmarkProtosDirectory)\google_message2.dat" /> |
|
<BenchmarkResources Include="$(SourceDirectory)\ProtocolBuffers\bin\$(BuildConfiguration)\Google.ProtocolBuffers.dll" /> |
|
<BenchmarkResources Include="$(SourceDirectory)\ProtocolBuffers.Serialization\bin\$(BuildConfiguration)\Google.ProtocolBuffers.Serialization.dll" /> |
|
<BenchmarkResources Include="$(SourceDirectory)\ProtoBench\bin\$(BuildConfiguration)\ProtoBench.exe" /> |
|
</ItemGroup> |
|
|
|
<Copy SourceFiles="@(BenchmarkResources)" DestinationFolder="$(BuildTempDirectory)" /> |
|
</Target> |
|
|
|
<Target Name="_RunBenchmarks" DependsOnTargets="_PrepareBenchmarkEnvironment"> |
|
<ItemGroup> |
|
<BenchmarkParameter Include="/v2" /> |
|
<BenchmarkParameter Include="Google.ProtocolBuffers.ProtoBench.SizeMessage1,BenchmarkTypes" /> |
|
<BenchmarkParameter Include="google_message1.dat" /> |
|
<BenchmarkParameter Include="Google.ProtocolBuffers.ProtoBench.SpeedMessage1,BenchmarkTypes" /> |
|
<BenchmarkParameter Include="google_message1.dat" /> |
|
<BenchmarkParameter Include="Google.ProtocolBuffers.ProtoBench.SizeMessage2,BenchmarkTypes" /> |
|
<BenchmarkParameter Include="google_message2.dat" /> |
|
<BenchmarkParameter Include="Google.ProtocolBuffers.ProtoBench.SpeedMessage2,BenchmarkTypes" /> |
|
<BenchmarkParameter Include="google_message2.dat" /> |
|
</ItemGroup> |
|
|
|
<PropertyGroup> |
|
<BenchmarkParameterList>@(BenchmarkParameter)</BenchmarkParameterList> |
|
<Args>$(BenchmarkParameterList.Replace(`;`,` `))</Args> |
|
</PropertyGroup> |
|
|
|
<Exec Command=""$(ProtoBenchExePath)" @(BenchmarkParameter->'%(Identity)', ' ') > "$(BuildTempDirectory)\..\BenchmarkResults.txt"" WorkingDirectory="$(BuildTempDirectory)" /> |
|
</Target> |
|
|
|
</Project> |