/// <summary> /// Adds a framework to target. /// </summary> /// <param name="settings">The settings.</param> /// <param name="targetFramework">The framework to target.</param> /// <returns>The same <see cref="DotNetMSBuildSettings"/> instance so that multiple calls can be chained.</returns> /// <remarks> /// For list of target frameworks see https://docs.microsoft.com/en-us/dotnet/standard/frameworks. /// </remarks> public static DotNetMSBuildSettings SetTargetFramework(this DotNetMSBuildSettings settings, string targetFramework) => settings.WithProperty("TargetFrameworks", targetFramework);
/// <summary> /// Sets a target operating systems where the application or assembly will run. /// </summary> /// <param name="settings">The settings.</param> /// <param name="runtimeId">The runtime id of the operating system.</param> /// <returns>The same <see cref="DotNetMSBuildSettings"/> instance so that multiple calls can be chained.</returns> /// <remarks> /// For list of runtime ids see https://docs.microsoft.com/en-us/dotnet/core/rid-catalog. /// </remarks> public static DotNetMSBuildSettings SetRuntime(this DotNetMSBuildSettings settings, string runtimeId) => settings.WithProperty("RuntimeIdentifiers", runtimeId);
/// <summary> /// Suppress warning CS7035. /// This is useful when using semantic versioning and either the file or informational version /// doesn't match the recommended format. /// The recommended format is: major.minor.build.revision where /// each is an integer between 0 and 65534 (inclusive). /// </summary> /// <param name="settings">The settings.</param> /// <returns>The same <see cref="DotNetMSBuildSettings"/> instance so that multiple calls can be chained.</returns> public static DotNetMSBuildSettings SuppressVersionRecommendedFormatWarning(this DotNetMSBuildSettings settings) => settings.WithProperty("nowarn", "7035");
/// <summary> /// Sets the version Suffix. /// </summary> /// <param name="settings">The settings.</param> /// <param name="versionSuffix">The version prefix.</param> /// <returns>The same <see cref="DotNetMSBuildSettings"/> instance so that multiple calls can be chained.</returns> public static DotNetMSBuildSettings SetVersionSuffix(this DotNetMSBuildSettings settings, string versionSuffix) => settings.WithProperty("VersionSuffix", versionSuffix);
/// <summary> /// Sets the package version. /// </summary> /// <param name="settings">The settings.</param> /// <param name="packageVersion">The package version.</param> /// <returns>The same <see cref="DotNetMSBuildSettings"/> instance so that multiple calls can be chained.</returns> public static DotNetMSBuildSettings SetPackageVersion(this DotNetMSBuildSettings settings, string packageVersion) => settings.WithProperty("PackageVersion", packageVersion);
/// <summary> /// Sets the package release notes. /// </summary> /// <param name="settings">The settings.</param> /// <param name="packageReleaseNotes">The package release notes.</param> /// <returns>The same <see cref="DotNetMSBuildSettings"/> instance so that multiple calls can be chained.</returns> public static DotNetMSBuildSettings SetPackageReleaseNotes(this DotNetMSBuildSettings settings, string packageReleaseNotes) => settings.WithProperty("PackageReleaseNotes", packageReleaseNotes);
/// <summary> /// Sets the informational version. /// </summary> /// <param name="settings">The settings.</param> /// <param name="informationalVersion">The informational version.</param> /// <returns>The same <see cref="DotNetMSBuildSettings"/> instance so that multiple calls can be chained.</returns> public static DotNetMSBuildSettings SetInformationalVersion(this DotNetMSBuildSettings settings, string informationalVersion) => settings.WithProperty("InformationalVersion", informationalVersion);
/// <summary> /// Sets the assembly version. /// </summary> /// <param name="settings">The settings.</param> /// <param name="assemblyVersion">The assembly version.</param> /// <returns>The same <see cref="DotNetMSBuildSettings"/> instance so that multiple calls can be chained.</returns> public static DotNetMSBuildSettings SetAssemblyVersion(this DotNetMSBuildSettings settings, string assemblyVersion) => settings.WithProperty("AssemblyVersion", assemblyVersion);
/// <summary> /// Sets the file version. /// </summary> /// <param name="settings">The settings.</param> /// <param name="fileVersion">The file version.</param> /// <returns>The same <see cref="DotNetMSBuildSettings"/> instance so that multiple calls can be chained.</returns> public static DotNetMSBuildSettings SetFileVersion(this DotNetMSBuildSettings settings, string fileVersion) => settings.WithProperty("FileVersion", fileVersion);
/// <summary> /// Sets the version. /// </summary> /// <param name="settings">The settings.</param> /// <param name="version">The version.</param> /// <returns>The same <see cref="DotNetMSBuildSettings"/> instance so that multiple calls can be chained.</returns> /// <remarks> /// Version will override VersionPrefix and VersionSuffix if set. /// This may also override version settings during packaging. /// </remarks> public static DotNetMSBuildSettings SetVersion(this DotNetMSBuildSettings settings, string version) => settings.WithProperty("Version", version);
/// <summary> /// Sets the configuration. /// </summary> /// <param name="settings">The settings.</param> /// <param name="configuration">The configuration.</param> /// <returns>The same <see cref="DotNetMSBuildSettings"/> instance so that multiple calls can be chained.</returns> public static DotNetMSBuildSettings SetConfiguration(this DotNetMSBuildSettings settings, string configuration) => settings.WithProperty("configuration", configuration);