build.cake: more readable way of using an enum (#7867)
authorAndres G. Aragoneses <knocte@gmail.com>
Wed, 9 Oct 2019 09:33:37 +0000 (17:33 +0800)
committerGerald Versluis <gerald.versluis@microsoft.com>
Wed, 9 Oct 2019 09:33:37 +0000 (11:33 +0200)
* build.cake: cosmetic, less verbose GetMSBuildSettings() method

* build.cake: more readable way of using an enum

I had to look up what "1" meant in the documentation!
(https://cakebuild.net/api/Cake.Common.Tools.MSBuild/MSBuildPlatform/)

build.cake

index 4ed6549..5e5e0cd 100644 (file)
@@ -302,11 +302,9 @@ RunTarget(target);
 
 MSBuildSettings GetMSBuildSettings()
 {
-    var msbuildSettings =  new MSBuildSettings();
-
-    msbuildSettings.PlatformTarget = PlatformTarget.MSIL;
-    msbuildSettings.MSBuildPlatform = (Cake.Common.Tools.MSBuild.MSBuildPlatform)1;
-    msbuildSettings.Configuration = configuration;
-    return msbuildSettings;
-
+    return new MSBuildSettings {
+        PlatformTarget = PlatformTarget.MSIL,
+        MSBuildPlatform = Cake.Common.Tools.MSBuild.MSBuildPlatform.x86,
+        Configuration = configuration,
+    };
 }