From 6558f1c2812f0aec057c4cbd8eda80b196c79d39 Mon Sep 17 00:00:00 2001 From: moozzyk Date: Wed, 29 Apr 2015 21:29:44 -0700 Subject: [PATCH] Consistent versioning of native binaries * Adding an MSBuild target file that generates a header containing file and product versions which will be used in .rc files in native projects across all repos. Note that keeping header generation in MSBuild is cleaner than generating it in a .shade file since the entire project is being built within a single build subsystem and therefore you can build the project directly (i.e. just with MSBuild) without having to do it with Sake (if the file did not exist) * Updating native-compile target in _k-standard-goals.shade to pass version numbers. --- build/Common.Native.targets | 23 +++++++++++++++++++++++ build/_k-standard-goals.shade | 10 ++++++++-- 2 files changed, 31 insertions(+), 2 deletions(-) create mode 100644 build/Common.Native.targets diff --git a/build/Common.Native.targets b/build/Common.Native.targets new file mode 100644 index 0000000000..e4d7a67ec4 --- /dev/null +++ b/build/Common.Native.targets @@ -0,0 +1,23 @@ + + + + + 0.0.0 + 0 + $(ProductVersion).$(FileRevision) + -$(BuildVersion) + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/build/_k-standard-goals.shade b/build/_k-standard-goals.shade index fb65af238c..5dd1943212 100644 --- a/build/_k-standard-goals.shade +++ b/build/_k-standard-goals.shade @@ -104,10 +104,16 @@ default Configuration='${E("Configuration")}' var msbuildPath = Path.Combine(programFilesX86, "MSBuild", msbuildVersions[i], "Bin", "MSBuild.exe"); if (File.Exists(msbuildPath)) { + var commonParameters = + " /p:Configuration=" + Configuration + + " /p:ProductVersion=1.0.0" + + " /p:FileRevision=" + E("DNX_ASSEMBLY_FILE_VERSION") + + " /p:BuildVersion=" + E("DNX_BUILD_VERSION"); + foreach (var project in nativeProjects) { - Exec(msbuildPath, project + " /p:Configuration=" + Configuration + ";Platform=Win32"); - Exec(msbuildPath, project + " /p:Configuration=" + Configuration + ";Platform=x64"); + Exec(msbuildPath, project + " /p:Configuration=Platform=Win32" + commonParameters); + Exec(msbuildPath, project + " /p:Configuration=Platform=x64" + commonParameters); } break;