public NugetPackageTool(string solutionFolder, string packageName, string packageVersion, string packageTargetFramework)
        {
            _packagesFolder         = System.IO.Path.Combine(solutionFolder, "packages");
            _packageName            = packageName;
            _packageVersion         = packageVersion;
            _version                = new ReferenceVersion(_packageVersion);
            _packageTargetFramework = packageTargetFramework;

            var packageFolderName = $"{_packageName}.{_packageVersion}";

            _packageFolderPath = System.IO.Path.Combine(_packagesFolder, packageFolderName);
            var packageFileName = $"{_packageName}.{_packageVersion}.nupkg";

            _packagePath = System.IO.Path.Combine(_packageFolderPath, packageFileName);

            _packageLibPath = System.IO.Path.Combine(_packageFolderPath, "lib");
        }
Beispiel #2
0
        public int CompareReleaseVersion(ReferenceVersion obj)
        {
            var b = (ReferenceVersion)obj;

            var major = Major.CompareTo(b.Major);

            if (major != 0)
            {
                return(major);
            }

            var minor = (Minor ?? 0).CompareTo((b.Minor ?? 0));

            if (minor != 0)
            {
                return(minor);
            }

            return(0);
        }