Skip to content

Commit

Permalink
Ease version number changes.
Browse files Browse the repository at this point in the history
Put the version number in CurrentVersion.props and use that to generate
assembly version information.
  • Loading branch information
jdhardy committed Feb 14, 2015
1 parent ee17c9d commit dca078f
Show file tree
Hide file tree
Showing 14 changed files with 89 additions and 75 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ bin/
/bin/
/Stage
/Package
/Util/References

# Temporary VS files
*.suo
Expand All @@ -16,6 +17,7 @@ bin/
# Generated files
BuildInfo.Generated.cs
CurrentVersion.Generated.cs
AssemblyVersion.Generated.cs

TestResult.xml
Solutions/TestResults/
Expand Down
28 changes: 15 additions & 13 deletions Build.proj
Original file line number Diff line number Diff line change
Expand Up @@ -4,23 +4,25 @@
<BuildFlavour Condition=" '$(BuildFlavour)' == '' ">Debug</BuildFlavour>
<Mono Condition="'$(OS)' != 'Windows_NT'">true</Mono>

<MajorVersion>1</MajorVersion>
<MinorVersion>2</MinorVersion>
<MicroVersion>0</MicroVersion>
<ReleaseLevel>alpha</ReleaseLevel>
<ReleaseSerial>0</ReleaseSerial>

<PackageVersion Condition="'$(ReleaseLevel)' == 'final'">$(MajorVersion).$(MinorVersion).$(MicroVersion)</PackageVersion>
<PackageVersion Condition="'$(ReleaseLevel)' != 'final' or '$(ReleaseSerial)' != '0'">$(MajorVersion).$(MinorVersion).$(MicroVersion)-$(ReleaseLevel)$(ReleaseSerial)</PackageVersion>

<RootDir>$(MSBuildThisFileDirectory)</RootDir>
<Solution>$(RootDir)\Dlr.sln</Solution>
<StageDir>$(RootDir)\Stage\$(BuildFlavour)\dlr-$(PackageVersion)</StageDir>
<PackageDir>$(RootDir)\Package\$(BuildFlavour)\dlr-$(PackageVersion)</PackageDir>

<UtilDir>$(RootDir)\Util</UtilDir>
<BinDir>$(RootDir)\bin</BinDir>
<BuildSysDir>$(RootDir)\Build</BuildSysDir>

</PropertyGroup>

<Import Project="$(RootDir)\CurrentVersion.props" />

<PropertyGroup>
<PackageVersion Condition="'$(ReleaseLevel)' == 'final'">$(MajorVersion).$(MinorVersion).$(MicroVersion)</PackageVersion>
<PackageVersion Condition="'$(ReleaseLevel)' != 'final' or '$(ReleaseSerial)' != '0'">$(MajorVersion).$(MinorVersion).$(MicroVersion)-$(ReleaseLevel)$(ReleaseSerial)</PackageVersion>

<StageDir>$(RootDir)\Stage\$(BuildFlavour)\dlr-$(PackageVersion)</StageDir>
<PackageDir>$(RootDir)\Package\$(BuildFlavour)\dlr-$(PackageVersion)</PackageDir>
</PropertyGroup>

<PropertyGroup>
<BuildProperties>
RootDir=$(RootDir);
Solution=$(Solution);
Expand Down Expand Up @@ -49,7 +51,7 @@
<InfoFiles Include="$(RootDir)\LICENSE" />
<InfoFiles Include="$(RootDir)\README.md" />
</ItemGroup>

<Target Name="Build">
<MSBuild
Projects="$(Solution)"
Expand Down
29 changes: 29 additions & 0 deletions Build/AssemblyVersion.targets
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(RootDir)\CurrentVersion.props" />
<PropertyGroup>
<AssemblyVersionPath>$(RootDir)\Src\AssemblyVersion.Generated.cs</AssemblyVersionPath>
</PropertyGroup>

<Target Name="GenerateAssemblyFileVersion"
Inputs="$(MSBuildThisFileFullPath);$(RootDir)\CurrentVersion.props"
Outputs="$(AssemblyVersionPath)"
BeforeTargets="BeforeBuild">
<PropertyGroup>
<AssemblyFileVersion Condition="'$(ReleaseLevel)' == 'alpha'">000$(ReleaseSerial)</AssemblyFileVersion>
<AssemblyFileVersion Condition="'$(ReleaseLevel)' == 'beta'">00$(ReleaseSerial)0</AssemblyFileVersion>
<AssemblyFileVersion Condition="'$(ReleaseLevel)' == 'candidate'">0$(ReleaseSerial)00</AssemblyFileVersion>
<AssemblyFileVersion Condition="'$(ReleaseLevel)' == 'final'">1000</AssemblyFileVersion>
</PropertyGroup>
<ItemGroup>
<VersionLines Include="/* Generated file. Do not edit. Edit CurrentVersion.props instead. */" />
<VersionLines Include="[assembly: System.Reflection.AssemblyVersion(&quot;$(MajorVersion).$(MinorVersion).0.0&quot;)]" />
<VersionLines Include="[assembly: System.Reflection.AssemblyFileVersion(&quot;$(MajorVersion).$(MinorVersion).$(MicroVersion).$(AssemblyFileVersion)&quot;)]" />
<VersionLines Include="[assembly: System.Reflection.AssemblyInformationalVersion(&quot;$(MajorVersion).$(MinorVersion).$(MicroVersion) $(ReleaseLevel) $(ReleaseSerial)&quot;)]" />
</ItemGroup>
<WriteLinesToFile File="$(AssemblyVersionPath)"
Lines="@(VersionLines)"
Overwrite="true" />
</Target>
</Project>

2 changes: 2 additions & 0 deletions Build/Common.proj
Original file line number Diff line number Diff line change
Expand Up @@ -109,5 +109,7 @@
<CheckForOverflowUnderflow>false</CheckForOverflowUnderflow>
<DefineConstants>$(Features);$(SignedSym);$(PlatformSymbols);DEBUG;TRACE</DefineConstants>
</PropertyGroup>

<Import Project="$(BuildSysDir)\AssemblyVersion.targets" />
</Project>

45 changes: 0 additions & 45 deletions Build/Versioning.targets

This file was deleted.

10 changes: 10 additions & 0 deletions CurrentVersion.props
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<MajorVersion>1</MajorVersion>
<MinorVersion>2</MinorVersion>
<MicroVersion>0</MicroVersion>
<ReleaseLevel>alpha</ReleaseLevel>
<ReleaseSerial>1</ReleaseSerial>
</PropertyGroup>
</Project>
2 changes: 1 addition & 1 deletion DynamicLanguageRuntime.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<metadata xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
<id>DynamicLanguageRuntime</id>
<title>Dynamic Language Runtime</title>
<version>1.5.0</version>
<version>1.2.0</version>
<authors>DLR Contributors,Microsoft</authors>
<owners>DLR Community</owners>
<projectUrl>http://ironpython.net</projectUrl>
Expand Down
4 changes: 0 additions & 4 deletions Src/AssemblyVersion.cs → Src/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,6 @@
[assembly: AssemblyConfiguration("RELEASE")]
#endif

[assembly: AssemblyVersion("1.2.0.0")]
[assembly: AssemblyFileVersion("1.2.0.0")]
[assembly: AssemblyInformationalVersion("1.2")]

[assembly: AssemblyCompany("DLR Open Source Team")]
[assembly: AssemblyCopyright("© DLR Contributors.")]

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,11 @@
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'v45Release|AnyCPU' ">
</PropertyGroup>
<ItemGroup>
<Compile Include="..\..\..\AssemblyVersion.cs">
<Link>Properties\AssemblyVersion.cs</Link>
<Compile Include="..\..\..\AssemblyInfo.cs">
<Link>Properties\AssemblyInfo.cs</Link>
</Compile>
<Compile Include="..\..\..\AssemblyVersion.Generated.cs">
<Link>Properties\AssemblyVersion.Generated.cs</Link>
</Compile>
<Compile Include="MembersInjectors\DictionaryMembersInjector.cs" />
<Compile Include="MembersInjectors\DataRowViewMembersInjector.cs" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,11 @@
<AssemblyName>Microsoft.Scripting.Silverlight</AssemblyName>
</PropertyGroup>
<ItemGroup>
<Compile Include="..\..\..\AssemblyVersion.cs">
<Link>Properties\AssemblyVersion.cs</Link>
<Compile Include="..\..\..\AssemblyInfo.cs">
<Link>Properties\AssemblyInfo.cs</Link>
</Compile>
<Compile Include="..\..\..\AssemblyVersion.Generated.cs">
<Link>Properties\AssemblyVersion.Generated.cs</Link>
</Compile>
<Compile Include="BrowserVirtualFilesystem.cs" />
<Compile Include="BrowserScriptHost.cs" />
Expand Down
7 changes: 5 additions & 2 deletions Src/Microsoft.Dynamic/Microsoft.Dynamic.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,11 @@
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'AndroidRelease|AnyCPU' ">
</PropertyGroup>
<ItemGroup>
<Compile Include="..\AssemblyVersion.cs">
<Link>Properties\AssemblyVersion.cs</Link>
<Compile Include="..\AssemblyInfo.cs">
<Link>Properties\AssemblyInfo.cs</Link>
</Compile>
<Compile Include="..\AssemblyVersion.Generated.cs">
<Link>Properties\AssemblyVersion.Generated.cs</Link>
</Compile>
<Compile Include="Actions\Calls\ActualArguments.cs" />
<Compile Include="Actions\Calls\ApplicableCandidate.cs" />
Expand Down
7 changes: 5 additions & 2 deletions Src/Microsoft.Scripting.Core/Microsoft.Scripting.Core.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,11 @@
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'v2Release|AnyCPU' ">
</PropertyGroup>
<ItemGroup>
<Compile Include="..\AssemblyVersion.cs">
<Link>Properties\AssemblyVersion.cs</Link>
<Compile Include="..\AssemblyInfo.cs">
<Link>Properties\AssemblyInfo.cs</Link>
</Compile>
<Compile Include="..\AssemblyVersion.Generated.cs">
<Link>Properties\AssemblyVersion.Generated.cs</Link>
</Compile>
<Compile Include="Actions\CallInfo.cs" />
<Compile Include="Actions\CallSiteOps.cs" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,11 @@
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'v45Release|AnyCPU' ">
</PropertyGroup>
<ItemGroup>
<Compile Include="..\AssemblyVersion.cs">
<Link>Properties\AssemblyVersion.cs</Link>
<Compile Include="..\AssemblyInfo.cs">
<Link>Properties\AssemblyInfo.cs</Link>
</Compile>
<Compile Include="..\AssemblyVersion.Generated.cs">
<Link>Properties\AssemblyVersion.Generated.cs</Link>
</Compile>
<Compile Include="MemoryMapping.V4.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
Expand Down
7 changes: 5 additions & 2 deletions Src/Microsoft.Scripting/Microsoft.Scripting.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,11 @@
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'AndroidRelease|AnyCPU' ">
</PropertyGroup>
<ItemGroup>
<Compile Include="..\AssemblyVersion.cs">
<Link>Properties\AssemblyVersion.cs</Link>
<Compile Include="..\AssemblyInfo.cs">
<Link>Properties\AssemblyInfo.cs</Link>
</Compile>
<Compile Include="..\AssemblyVersion.Generated.cs">
<Link>Properties\AssemblyVersion.Generated.cs</Link>
</Compile>
<Compile Include="ArgumentTypeException.cs" />
<Compile Include="AssemblyLoadedEventArgs.cs" />
Expand Down

0 comments on commit dca078f

Please sign in to comment.