Esempio n. 1
0
        IEnumerable <ICommandOutput> Package()
        {
            var packageName = Name ?? _environment.Descriptor.Name;

            var currentPackageDescriptor      = GetCurrentPackageDescriptor();
            var packageDescriptorForEmbedding = new PackageDescriptor(currentPackageDescriptor);

            packageDescriptorForEmbedding.SemanticVersion = _generatedVersion;
            packageDescriptorForEmbedding.Name            = packageName;

#pragma warning disable 612,618
            if (currentPackageDescriptor.IncludeLegacyVersion)
            {
                packageDescriptorForEmbedding.Version = _generatedVersion.ToVersion();
            }
#pragma warning restore 612,618

            var packageFilePath = _destinationPath.GetFile(
                PackageNameUtility.PackageFileName(packageName, _generatedVersion.ToString()));

            var packageContent = GeneratePackageContent(_buildResults)
                                 .Concat(
                GenerateVersionFile(_generatedVersion),
                GenerateDescriptorFile(packageDescriptorForEmbedding)
                ).ToList();
            foreach (var item in packageContent)
            {
                yield return(new Info(string.Format("Copying: {0}/{1}{2}", item.RelativePath, item.FileName, FormatBytes(item.Size))));
            }

            Packager.NewFromFiles(packageFilePath, packageContent);
            yield return(new PackageBuilt(packageFilePath, _generatedVersion));
        }
Esempio n. 2
0
 public void SemanticVersionConvertShortVersionWithZeros()
 {
     SemanticVersion semVersion = new SemanticVersion("2.1.0.0");
     Version convertedVersion = semVersion.ToVersion();
     Assert.That(convertedVersion.Major, Is.EqualTo(2));
     Assert.That(convertedVersion.Minor, Is.EqualTo(1));
     Assert.That(convertedVersion.Build, Is.EqualTo(0));
     Assert.That(convertedVersion.Revision, Is.EqualTo(0));
 }
Esempio n. 3
0
 public void SemanticVersionConvertFullVersionWithSpecial()
 {
     SemanticVersion semVersion = new SemanticVersion(new Version("2.1.3.4"), "56789");
     Version convertedVersion = semVersion.ToVersion();
     Assert.That(convertedVersion.Major, Is.EqualTo(2));
     Assert.That(convertedVersion.Minor, Is.EqualTo(1));
     Assert.That(convertedVersion.Build, Is.EqualTo(3));
     Assert.That(convertedVersion.Revision, Is.EqualTo(4));
 }
        public void SemanticVersionConvertFullVersionWithSpecial()
        {
            SemanticVersion semVersion       = new SemanticVersion(new Version("2.1.3.4"), "56789");
            Version         convertedVersion = semVersion.ToVersion();

            Assert.That(convertedVersion.Major, Is.EqualTo(2));
            Assert.That(convertedVersion.Minor, Is.EqualTo(1));
            Assert.That(convertedVersion.Build, Is.EqualTo(3));
            Assert.That(convertedVersion.Revision, Is.EqualTo(4));
        }
        public void SemanticVersionConvertShortVersionWithZeros()
        {
            SemanticVersion semVersion       = new SemanticVersion("2.1.0.0");
            Version         convertedVersion = semVersion.ToVersion();

            Assert.That(convertedVersion.Major, Is.EqualTo(2));
            Assert.That(convertedVersion.Minor, Is.EqualTo(1));
            Assert.That(convertedVersion.Build, Is.EqualTo(0));
            Assert.That(convertedVersion.Revision, Is.EqualTo(0));
        }
Esempio n. 6
0
        public void ConvertToClassicalVersion()
        {
            // Setup
            var version = new SemanticVersion("4.15.26-beta6");

            // Execute
            var result = version.ToVersion();

            // Assert
            Assert.AreEqual(4, result.Major);
            Assert.AreEqual(15, result.Minor);
            Assert.AreEqual(26, result.Build);
            Assert.AreEqual(-1, result.Revision);
        }
Esempio n. 7
0
        public void ConvertToClassicalVersion()
        {
            // Setup
            var version = new SemanticVersion("4.15.26-beta6");

            // Execute
            var result = version.ToVersion();

            // Assert
            Assert.AreEqual(4, result.Major);
            Assert.AreEqual(15, result.Minor);
            Assert.AreEqual(26, result.Build);
            Assert.AreEqual(-1, result.Revision);
        }