ClrPlus.Scripting.MsBuild.Packaging.PackageScript.GetNugetPackage C# (CSharp) Méthode

GetNugetPackage() private méthode

private GetNugetPackage ( string name ) : NugetPackage
name string
Résultat NugetPackage
        internal NugetPackage GetNugetPackage(string name)
        {
            return _nugetPackages[name];
        }

Usage Example

Exemple #1
0
        internal void Process()
        {
            Event <Verbose> .Raise("NugetPackage.Process", "Processing nuget package [{0}].", NuspecFilename);

            switch (PkgRole)
            {
            case "default":

                break;

            case "redist":
                //copy the nuspec fields from the default project (and change what's needed)
                var defaultPkg = _packageScript.GetNugetPackage("default");
                _nuSpec = new DynamicNode(new XElement(defaultPkg._nuSpec.Element));

                _nuSpec.metadata.requireLicenseAcceptance = "false";
                _nuSpec.metadata.title        = "{0} Redist".format((string)defaultPkg._nuSpec.metadata.title);
                _nuSpec.metadata.summary      = "Redistributable components for for package '{0}'".format(defaultPkg._pkgName);
                _nuSpec.metadata.id           = _pkgName;
                _nuSpec.metadata.description  = "Redistributable components for package '{0}'. This package should only be installed as a dependency. \r\n(This is not the package you are looking for).".format(defaultPkg._pkgName);
                _nuSpec.metadata.dependencies = null;
                break;

            case "symbols":
                defaultPkg = _packageScript.GetNugetPackage("default");
                _nuSpec    = new DynamicNode(new XElement(defaultPkg._nuSpec.Element));

                _nuSpec.metadata.title = "{0} Symbols".format((string)defaultPkg._nuSpec.metadata.title);
                _nuSpec.metadata.requireLicenseAcceptance = "false";
                _nuSpec.metadata.summary      = "Symbols for for package '{0}'".format(defaultPkg._pkgName);
                _nuSpec.metadata.id           = _pkgName;
                _nuSpec.metadata.description  = "Symbols for package '{0}'. This package should not likely be installed. \r\n(This is not the package you are looking for).".format(defaultPkg._pkgName);
                _nuSpec.metadata.dependencies = null;
                break;

            default:
                defaultPkg = _packageScript.GetNugetPackage("default");
                _nuSpec    = new DynamicNode(new XElement(defaultPkg._nuSpec.Element));

                _nuSpec.metadata.requireLicenseAcceptance = "false";
                _nuSpec.metadata.id           = _pkgName;
                _nuSpec.metadata.description  = "*unknown*";
                _nuSpec.metadata.dependencies = null;
                break;
            }
        }