Skip to content

Commit

Permalink
versioning of assembly, file and product now exactly the same as befo…
Browse files Browse the repository at this point in the history
…re the move to new new csproj
  • Loading branch information
Mpdreamz committed Apr 11, 2017
1 parent 6b6b6a7 commit 2664300
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 9 deletions.
1 change: 1 addition & 0 deletions build.bat
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ IF NOT [%1]==[] (set TARGET=%1)

SET SKIPPAKET=0
IF /I "%TARGET%"=="inc" SET SKIPPAKET=1
IF /I "%TARGET%"=="canary" SET SKIPTESTS=1

IF "%SKIPPAKET%" neq "1" (
.paket\paket.bootstrapper.exe
Expand Down
19 changes: 13 additions & 6 deletions build/Clients.Common.targets
Original file line number Diff line number Diff line change
@@ -1,12 +1,19 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<AVersion>0.0.0-bad</AVersion>
<AFixedVersion>0.0.0</AFixedVersion>
<Version>$(AFixedVersion)</Version>
<AssemblyVersion>$(AFixedVersion)</AssemblyVersion>
<FileVersion>$(AFixedVersion).0</FileVersion>
<InformationalVersion>$(AVersion)</InformationalVersion>
<!-- Default Version numbers -->
<CurrentVersion>0.0.0-bad</CurrentVersion>
<CurrentAssemblyVersion>0.0.0</CurrentAssemblyVersion>
<CurrentAssemblyFileVersion>0.0.0.0</CurrentAssemblyFileVersion>

<!-- Version and Informational reflect actual version -->
<Version>$(CurrentVersion)</Version>
<InformationalVersion>$(CurrentVersion)</InformationalVersion>
<!-- Assembly version is sticky to MAJOR.0.0.0 to avoid binding redirects because we strong name our assemblies -->
<AssemblyVersion>$(CurrentAssemblyVersion)</AssemblyVersion>
<!-- File version reflects actual version number without prelease since that not allowed in its struct -->
<FileVersion>$(CurrentAssemblyFileVersion)</FileVersion>

<Authors></Authors>
<Company></Company>
<NeutralLanguage></NeutralLanguage>
Expand Down
15 changes: 12 additions & 3 deletions build/scripts/Building.fsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,24 @@ module Build =
if (runningSdkVersion <> pinnedSdkVersion) then failwithf "Attempting to run with dotnet.exe with %s but global.json mandates %s" runningSdkVersion pinnedSdkVersion
let incrementalFramework = DotNetFramework.Net45
let sourceLink = if not incremental && not isMono && runningRelease then "1" else ""
let properties = sprintf "/property:AVersion=%s;AFixedVersion=%s;DoSourceLink=%s" (Versioning.CurrentVersion.ToString()) (Versioning.CurrentAssemblyVersion.ToString()) sourceLink

let props =
[
"CurrentVersion", (Versioning.CurrentVersion.ToString());
"CurrentAssemblyVersion", (Versioning.CurrentAssemblyVersion.ToString());
"CurrentAssemblyFileVersion", (Versioning.CurrentAssemblyFileVersion.ToString());
"DoSourceLink", sourceLink;
]
|> List.map (fun (p,v) -> sprintf "%s=%s" p v)
|> String.concat ";"
|> sprintf "/property:%s"

DotNetCli.Build
(fun p ->
{ p with
Configuration = "Release"
Project = "src/Elasticsearch.sln"
TimeOut = TimeSpan.FromMinutes(3.)
AdditionalArgs = if incremental then ["-f"; incrementalFramework.Identifier.Nuget; properties] else [properties]
AdditionalArgs = if incremental then ["-f"; incrementalFramework.Identifier.Nuget; props] else [props]
}
) |> ignore

Expand Down
1 change: 1 addition & 0 deletions build/scripts/Versioning.fsx
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ module Versioning =
currentVersion

let CurrentAssemblyVersion = parse (sprintf "%s.0.0" (CurrentVersion.Major.ToString()))
let CurrentAssemblyFileVersion = parse (sprintf "%s.%s.%s.0" (CurrentVersion.Major.ToString()) (CurrentVersion.Minor.ToString()) (CurrentVersion.Patch.ToString()))

let ValidateArtifacts() =
let fileVersion = CurrentVersion
Expand Down

0 comments on commit 2664300

Please sign in to comment.