Converted build to also work under .net 3.5

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

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

@ -15,7 +15,8 @@
<BuildOutputDirectory>$(ProjectDirectory)\build_output\$(BuildConfiguration)</BuildOutputDirectory> <BuildOutputDirectory>$(ProjectDirectory)\build_output\$(BuildConfiguration)</BuildOutputDirectory>
<!--File Paths--> <!--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> <ProtocExePath>$(LibDirectory)\protoc.exe</ProtocExePath>

@ -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