diff options
author | ArnoldZokas <arnold.zokas@coderoom.net> | 2010-12-01 21:18:04 +0000 |
---|---|---|
committer | ArnoldZokas <arnold.zokas@coderoom.net> | 2010-12-01 21:18:04 +0000 |
commit | 8e08d4106d146e00f0255a6fa6bd123b5a52ef41 (patch) | |
tree | 28b12cf45e4255b1da523c81b81d10a0e902c876 | |
parent | 8c5121bc625552c17d79c00a1adc614ab7cf6689 (diff) | |
download | protobuf-8e08d4106d146e00f0255a6fa6bd123b5a52ef41.tar.gz protobuf-8e08d4106d146e00f0255a6fa6bd123b5a52ef41.tar.bz2 protobuf-8e08d4106d146e00f0255a6fa6bd123b5a52ef41.zip |
Migrated targets for generating benchmark source and assembly
-rw-r--r-- | build/Common.targets | 52 | ||||
-rw-r--r-- | build/build.csproj | 1 |
2 files changed, 50 insertions, 3 deletions
diff --git a/build/Common.targets b/build/Common.targets index 4ea10aa8..fc611d76 100644 --- a/build/Common.targets +++ b/build/Common.targets @@ -32,7 +32,8 @@ <Target Name="_Test" DependsOnTargets="_CompileGeneratedSource"> <Exec Command=""$(NUnitExePath)" %(TestContainer.Identity) /xml:$(BuildTempDirectory)\..\%(TestContainer.Filename).$(BuildConfiguration).xml" /> </Target> - + + <!--## Package Generation ##--> <Target Name="_PreparePackageComponent"> <Copy SourceFiles="@(DynamicPackageItem)" DestinationFolder="$(BuildOutputDirectory)\%(DynamicPackageItem.TargetDirectory)\%(DynamicPackageItem.RecursiveDir)" /> </Target> @@ -51,8 +52,53 @@ <RemoveDir Directories="@(DirectoriesToDelete)" ContinueOnError="true" /> </Target> - <Target Name="_RunBenchmarks"> - <Exec Command=""$(ProtoBenchExePath)" Google.ProtocolBuffers.ProtoBench.SizeMessage1,BenchmarkTypes $(ProjectDirectory)\benchmarks\google_message1.dat > "$(BuildTempDirectory)\..\BenchmarkResults.txt"" /> + <!--## Benchmark ##--> + <Target Name="_GenerateBenchmarkSource" DependsOnTargets="_Clean"> + <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" /> + </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)\ProtoBench\bin\$(BuildConfiguration)\ProtoBench.exe" /> + </ItemGroup> + + <Copy SourceFiles="@(BenchmarkResources)" DestinationFolder="$(BuildTempDirectory)" /> + </Target> + + <Target Name="_RunBenchmarks" DependsOnTargets="_PrepareBenchmarkEnvironment"> + <ItemGroup> + <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)" $(Args) > "$(BuildTempDirectory)\..\BenchmarkResults.txt"" WorkingDirectory="$(BuildTempDirectory)" /> </Target> </Project>
\ No newline at end of file diff --git a/build/build.csproj b/build/build.csproj index 845a85aa..5805b625 100644 --- a/build/build.csproj +++ b/build/build.csproj @@ -10,6 +10,7 @@ <SourceDirectory>$(ProjectDirectory)\src</SourceDirectory> <LibDirectory>$(ProjectDirectory)\lib</LibDirectory> <ProtosDirectory>$(ProjectDirectory)\protos</ProtosDirectory> + <BenchmarkProtosDirectory>$(ProjectDirectory)\benchmarks</BenchmarkProtosDirectory> <BuildTempDirectory>$(ProjectDirectory)\build_temp\$(BuildConfiguration)</BuildTempDirectory> <BuildOutputDirectory>$(ProjectDirectory)\build_output\$(BuildConfiguration)</BuildOutputDirectory> |