Exemplo n.º 1
0
        public void DefaultSettings_Are_As_Expected()
        {
            //Arrange
            var versionModel = new Services.VersionModel()
            {
                AssemblyVersion = new Version("1.2.3.4"), NuGetPackageVersion = "1.2.3+4", Version = "1.2.3.4"
            };

            //Act
            var msBuildSettings = MsBuildSettings.Default(versionModel);

            //Assert
            msBuildSettings.Properties.Should().BeEquivalentTo(new Dictionary <string, ICollection <string> >()
            {
                { "Version", new List <string> {
                      "1.2.3.4"
                  } },
                { "AssemblyVersion", new List <string> {
                      "1.2.3.4"
                  } },
                { "FileVersion", new List <string> {
                      "1.2.3.4"
                  } }
            });
        }
Exemplo n.º 2
0
        /// <summary>
        /// Sets the following properties: Configuration, MsBuildSettings (Uses MsBuildSettings.Default),
        ///   Additional Properties (Version, Copyright)
        /// </summary>
        public static DotNetCoreBuildSettings Default(VersionModel versionModel, string configuration = "Release")
        {
            var msBuildSettings = MsBuildSettings.Default(versionModel);

            return(new DotNetCoreBuildSettings
            {
                Configuration = configuration,
                MSBuildSettings = msBuildSettings,
            });
        }
Exemplo n.º 3
0
        /// <summary>
        /// Creates default publish settings for a folder publish operation. This builds for all runtimes and does not include DotNetCore.
        /// Sets the following properties: Configuration, NoBuild, NoRestore,  MsBuildSettings (Uses MsBuildSettings.Default),
        ///   Additional Properties (Version, Copyright)
        /// </summary>
        /// <remarks>
        /// - It is assumed that publish is called from a Build Task in which build was not called first, so NoBuild is set to false by default.
        /// </remarks>
        public static DotNetCorePublishSettings Default(VersionModel versionModel, string configuration = "Release", bool noBuild = false)
        {
            var msBuildSettings = MsBuildSettings.Default(versionModel);

            return(new DotNetCorePublishSettings
            {
                Configuration = configuration,
                MSBuildSettings = msBuildSettings,
                NoBuild = noBuild,
                NoRestore = noBuild
            });
        }
Exemplo n.º 4
0
        /// <summary>
        /// Sets the following properties: Configuration, NoBuild, NoRestore,  MsBuildSettings (Uses MsBuildSettings.Default),
        ///   Additional Properties (Version, Copyright)
        /// </summary>
        public static DotNetCorePackSettings Default(VersionModel versionModel, string companyName, string configuration = "Release", bool noBuild = false)
        {
            //NoBuild is defaulted to false because we pack first, then unit test.

            var msBuildSettings = MsBuildSettings.Default(versionModel);

            return(new DotNetCorePackSettings
            {
                Configuration = configuration,
                NoBuild = noBuild,
                NoRestore = noBuild,
                MSBuildSettings = msBuildSettings,
                ArgumentCustomization = args => args
                                        .Append($"/p:Version={versionModel.NuGetPackageVersion}")
                                        .Append($"/p:Copyright=\"Copyright {DateTime.UtcNow.Year} {companyName}\"")
            });
        }