Converted build to also work under .net 3.5

pull/288/head
csharptest 14 years ago
parent 727107726d
commit 30d3fa3205
  1. 23
      build/Common.targets
  2. 7
      build/build.csproj
  3. 6
      build/build35.bat

@ -7,17 +7,18 @@
<MakeDir Directories="@(WorkingDirectories)" />
</Target>
<Target Name="_Compile" DependsOnTargets="_Clean">
<MSBuild Projects="$(SolutionFile)" Properties="Configuration=$(BuildConfiguration)" BuildInParallel="true" />
</Target>
<Target Name="_Compile" DependsOnTargets="_Clean">
<MSBuild Projects="$(SolutionFile)" Properties="Configuration=$(BuildConfiguration)" BuildInParallel="true" Condition=" '$(BuildTools)' == '' " />
<MSBuild Projects="$(SolutionFile)" Properties="Configuration=$(BuildConfiguration);TargetFrameworkVersion=v2.0" Condition=" '$(BuildTools)' == 'v3.5' " />
</Target>
<Target Name="_GenerateSource">
<PropertyGroup>
<ProtosList>@(Protos)</ProtosList>
<Args>$(ProtosList.Replace(`;`,` `))</Args>
</PropertyGroup>
<Target Name="_CompileGeneratedSource" DependsOnTargets="_CopyGeneratedSource">
<MSBuild Projects="$(SolutionFile)" Properties="Configuration=$(BuildConfiguration)" BuildInParallel="true" Condition=" '$(BuildTools)' == '' " />
<MSBuild Projects="$(SolutionFile)" Properties="Configuration=$(BuildConfiguration);TargetFrameworkVersion=v2.0" Condition=" '$(BuildTools)' == 'v3.5' " />
</Target>
<Exec Command="$(ProtocExePath) --proto_path=$(ProtosDirectory) --descriptor_set_out=compiled.pb $(Args)" WorkingDirectory="$(BuildTempDirectory)" />
<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)" />
</Target>
@ -25,10 +26,6 @@
<Copy SourceFiles="%(GeneratedSource.Identity)" DestinationFiles="%(GeneratedSource.TargetDirectory)\%(GeneratedSource.Filename)%(GeneratedSource.Extension)" />
</Target>
<Target Name="_CompileGeneratedSource" DependsOnTargets="_CopyGeneratedSource">
<MSBuild Projects="$(SolutionFile)" Properties="Configuration=$(BuildConfiguration)" BuildInParallel="true" />
</Target>
<Target Name="_Test" DependsOnTargets="_CompileGeneratedSource" Condition="$(BuildConfiguration)=='Debug' or $(BuildConfiguration)=='Release'">
<Exec Command="&quot;$(NUnitExePath)&quot; %(TestContainer.Identity) /xml:$(BuildTempDirectory)\..\%(TestContainer.Filename).$(BuildConfiguration).xml" />
</Target>

@ -6,7 +6,7 @@
<BuildConfiguration></BuildConfiguration>
<!--Directory Paths-->
<ProjectDirectory>$(MSBuildProjectDirectory)\..</ProjectDirectory>
<ProjectDirectory>$(MSBuildProjectDirectory)\..</ProjectDirectory>
<SourceDirectory>$(ProjectDirectory)\src</SourceDirectory>
<LibDirectory>$(ProjectDirectory)\lib</LibDirectory>
<ProtosDirectory>$(ProjectDirectory)\protos</ProtosDirectory>
@ -15,9 +15,10 @@
<BuildOutputDirectory>$(ProjectDirectory)\build_output\$(BuildConfiguration)</BuildOutputDirectory>
<!--File Paths-->
<SolutionFile>$(SourceDirectory)\ProtocolBuffers.sln</SolutionFile>
<SolutionFile Condition=" '$(BuildTools)' == '' ">$(SourceDirectory)\ProtocolBuffers.sln</SolutionFile>
<SolutionFile Condition=" '$(BuildTools)' == 'v3.5' ">$(SourceDirectory)\ProtocolBuffers2008.sln</SolutionFile>
<!--Tool Paths-->
<!--Tool Paths-->
<ProtocExePath>$(LibDirectory)\protoc.exe</ProtocExePath>
<ProtogenExePath>$(SourceDirectory)\ProtoGen\bin\$(BuildConfiguration)\protogen.exe</ProtogenExePath>
<ProtoBenchExePath>$(BuildTempDirectory)\ProtoBench.exe</ProtoBenchExePath>

@ -0,0 +1,6 @@
@echo off
SET START_DIR=%CD%
CD %~dp0
%WINDIR%\Microsoft.NET\Framework\v3.5\MSBuild.exe build.csproj /t:Build /p:BuildConfiguration=Debug /p:Platform="Any CPU" /p:TargetFramework="v2.0" /p:BuildTools="v3.5" /toolsversion:3.5
CD %START_DIR%
SET START_DIR=
Loading…
Cancel
Save