Skip to content

Commit

Permalink
Version and Build Conditions
Browse files Browse the repository at this point in the history
  • Loading branch information
rmsantos committed Mar 6, 2015
1 parent ca4a4da commit eabdfee
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 13 deletions.
8 changes: 4 additions & 4 deletions src/BuildScripts/build.proj
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>

<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003" DefaultTargets="ci" ToolsVersion="4.0">
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003" DefaultTargets="ci" ToolsVersion="12.0">

<Import Project="common.props"/>
<Import Project="$(MSBuildCommunityTasksPath)\MSBuild.Community.Tasks.targets"/>
Expand Down Expand Up @@ -54,19 +54,19 @@
<UnitTestAssemblies Include="$(OutputPath)\.Tests.dll"/>
</ItemGroup>

<Target Name="unittest" DependsOnTargets="build">
<Target Name="unittest" Condition="'$(UnitTest)'" DependsOnTargets="build">
<Message Text="Running Unit Tests..."/>



</Target>

<Target Name="publish" DependsOnTargets="unittest">
<Target Name="publish" Condition="'$(Publish)'" DependsOnTargets="unittest">
<Message Text="Publishing..."/>

</Target>

<Target Name="archive" DependsOnTargets="publish">
<Target Name="archive" Condition="'$(Archive)'" DependsOnTargets="publish">
<Message Text="Archiving..."/>

</Target>
Expand Down
36 changes: 27 additions & 9 deletions src/BuildScripts/common.props
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,37 @@
<MSBuildCommunityTasksPath>$(SolutionPath).build</MSBuildCommunityTasksPath>

</PropertyGroup>


<PropertyGroup>

<Publish Condition="'$(PUBLISH)' == ''" >true</Publish>
<Publish Condition="'$(PUBLISH)' != ''" >$(PUBLISH)</Publish>

<Archive Condition="'$(ARQUIVE)' == ''">true</Archive>
<Archive Condition="'$(ARQUIVE)' != ''">$(ARQUIVE)</Archive>

<UnitTest Condition="'$(UNIT_TEST)' == ''">false</UnitTest>
<UnitTest Condition="'$(UNIT_TEST)' != ''">$(UNIT_TEST)</UnitTest>

</PropertyGroup>

<!-- Version Number -->
<PropertyGroup Condition=" '$(BUILD_NUMBER)' == '' ">
<Version>1.0.0.0</Version>
<FileVersion>1.0.0.0</FileVersion>
<InformationalVersion>1.0.0.0</InformationalVersion>
<PropertyGroup Condition="'$(APPVEYOR)' != '' And '$(APPVEYOR)'">
<Version>$(APPVEYOR_BUILD_VERSION)</Version>
<FileVersion>$(APPVEYOR_BUILD_VERSION)</FileVersion>
<InformationalVersion>$(APPVEYOR_BUILD_VERSION)</InformationalVersion>
</PropertyGroup>

<PropertyGroup Condition=" '$(BUILD_NUMBER)' != '' ">
<!-- Build Server Number -->
<PropertyGroup Condition="('$(APPVEYOR)' == '' Or !'$(APPVEYOR)') And '$(BUILD_VERSION)' != '' ">
<Version>$(BUILD_VERSION)</Version>
<FileVersion>$(BUILD_VERSION)</FileVersion>
<InformationalVersion>$(BUILD_VERSION)</InformationalVersion>
</PropertyGroup>

<PropertyGroup Condition="('$(APPVEYOR)' == '' Or !'$(APPVEYOR)') And '$(BUILD_VERSION)' == '' ">
<Version>1.0.0.0</Version>
<FileVersion>$(BUILD_NUMBER)</FileVersion>
<InformationalVersion>$(BUILD_NUMBER)</InformationalVersion>
<FileVersion>1.0.0.0</FileVersion>
<InformationalVersion>1.0.0.0</InformationalVersion>
</PropertyGroup>


Expand Down

0 comments on commit eabdfee

Please sign in to comment.