From 04961da7755f0ba75ba228d6638c3c1c4da7aee0 Mon Sep 17 00:00:00 2001 From: Mihai Codoban Date: Tue, 9 May 2017 15:02:30 -0700 Subject: [PATCH 1/2] Update msbuild's property functions @msbuild-maintainers --- docs/msbuild/property-functions.md | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/docs/msbuild/property-functions.md b/docs/msbuild/property-functions.md index abc197e7d8f..3c45d147a5c 100644 --- a/docs/msbuild/property-functions.md +++ b/docs/msbuild/property-functions.md @@ -94,6 +94,10 @@ In the .NET Framework versions 4 and 4.5, property functions can be used to eval - System.Math +- System.Runtime.InteropServices.OSPlatform + +- System.Runtime.InteropServices.RuntimeInformation + - System.UInt16 - System.UInt32 @@ -190,6 +194,15 @@ In the .NET Framework versions 4 and 4.5, property functions can be used to eval |int BitwiseAnd(int first, int second)|Perform a bitwise `AND` on the first and second (first & second).| |int BitwiseXor(int first, int second)|Perform a bitwise `XOR` on the first and second (first ^ second).| |int BitwiseNot(int first)|Perform a bitwise `NOT` (~first).| +|bool IsOsPlatform(string platformString)|Specify whether the current OS platform is `platformString`. `platformString` must be a member of `OSPlatform`.| +|bool IsOSUnixLike|True if current OS is a Unix system.| +|string NormalizePath(params string[] path)|Gets the canonicalized full path of the provided path and ensures it contains the correct directory separator characters for the current operating system.| +|string NormalizeDirectory(params string[] path)|Gets the canonicalized full path of the provided directory and ensures it contains the correct directory separator characters for the current operating system while ensuring it has a trailing slash.| +|string EnsureTrailingSlash(string path)|If the given path doesn't have a trailing slash then add one. If the path is an empty string, does not modify it.| +|string GetPathOfFileAbove(string file, string startingDirectory)|Searches for a file based on the current build file's location, or based on `startingDirectory`, if specified| +|GetDirectoryNameOfFileAbove(string startingDirectory, string fileName)|Locate a file in either the directory specified or a location in the directory structure above that directory.| +|string MakeRelative(string basePath, string path)|Attach `path` to `basePath`. `basePath` must be an absolute directory. Similar to `Path.Combine`.| +|string ValueOrDefault(string conditionValue, string defaultValue)|Return the string in parameter 'defaultValue' only if parameter 'conditionValue' is empty, else, return the value conditionValue| ## Nested Property Functions You can combine property functions to form more complex functions, as the following example shows. From 4889f6b5f98e87c147290c57eafa9867c36ac0a9 Mon Sep 17 00:00:00 2001 From: Mihai Codoban Date: Thu, 25 May 2017 12:37:44 -0700 Subject: [PATCH 2/2] Update property-functions.md --- docs/msbuild/property-functions.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/msbuild/property-functions.md b/docs/msbuild/property-functions.md index 3c45d147a5c..40c8267f56e 100644 --- a/docs/msbuild/property-functions.md +++ b/docs/msbuild/property-functions.md @@ -199,10 +199,10 @@ In the .NET Framework versions 4 and 4.5, property functions can be used to eval |string NormalizePath(params string[] path)|Gets the canonicalized full path of the provided path and ensures it contains the correct directory separator characters for the current operating system.| |string NormalizeDirectory(params string[] path)|Gets the canonicalized full path of the provided directory and ensures it contains the correct directory separator characters for the current operating system while ensuring it has a trailing slash.| |string EnsureTrailingSlash(string path)|If the given path doesn't have a trailing slash then add one. If the path is an empty string, does not modify it.| -|string GetPathOfFileAbove(string file, string startingDirectory)|Searches for a file based on the current build file's location, or based on `startingDirectory`, if specified| +|string GetPathOfFileAbove(string file, string startingDirectory)|Searches for a file based on the current build file's location, or based on `startingDirectory`, if specified.| |GetDirectoryNameOfFileAbove(string startingDirectory, string fileName)|Locate a file in either the directory specified or a location in the directory structure above that directory.| -|string MakeRelative(string basePath, string path)|Attach `path` to `basePath`. `basePath` must be an absolute directory. Similar to `Path.Combine`.| -|string ValueOrDefault(string conditionValue, string defaultValue)|Return the string in parameter 'defaultValue' only if parameter 'conditionValue' is empty, else, return the value conditionValue| +|string MakeRelative(string basePath, string path)|Makes `path` relative to `basePath`. `basePath` must be an absolute directory. If `path` cannot be made relative, it is returned verbatim. Similar to `Uri.MakeRelativeUri`.| +|string ValueOrDefault(string conditionValue, string defaultValue)|Return the string in parameter 'defaultValue' only if parameter 'conditionValue' is empty, else, return the value conditionValue.| ## Nested Property Functions You can combine property functions to form more complex functions, as the following example shows.