本文整理汇总了C#中PackageDescriptor类的典型用法代码示例。如果您正苦于以下问题:C# PackageDescriptor类的具体用法?C# PackageDescriptor怎么用?C# PackageDescriptor使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
PackageDescriptor类属于命名空间,在下文中一共展示了PackageDescriptor类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: when_finding_packages
protected void when_finding_packages(string dependency)
{
var dep = new PackageDescriptor();
((IPackageDescriptor)dep).Dependencies.Add(DependsParser.ParseDependsLine(dependency));
FoundPackage = Repository.PackagesByName.FindAll(dep.Dependencies.First()).FirstOrDefault();
}
开发者ID:simonlaroche,项目名称:openwrap,代码行数:7,代码来源:current_directory_repository.cs
示例2: when_finding_packages
protected void when_finding_packages(string dependency)
{
var dep = new PackageDescriptor();
new DependsParser().Parse(dependency, dep);
FoundPackage = Repository.FindAll(dep.Dependencies.First()).FirstOrDefault();
}
开发者ID:gdalgas,项目名称:openwrap,代码行数:7,代码来源:current_directory_repository.cs
示例3: Parse
public void Parse(string line, PackageDescriptor descriptor)
{
var match = _regex.Match(line);
if (!match.Success)
return;
ParseContent(match.Groups["content"].Value, descriptor);
}
开发者ID:andrewdavey,项目名称:openwrap,代码行数:7,代码来源:AbstractDescriptorParser.cs
示例4: GetAssemblyReferences
public static IEnumerable<IAssemblyReferenceExportItem> GetAssemblyReferences(this IPackageResolver resolver,
bool includeContentOnly,
ExecutionEnvironment exec,
PackageDescriptor descriptor,
params IPackageRepository[] repositories)
{
return GetAssemblyReferences(resolver.TryResolveDependencies(descriptor, repositories), exec, includeContentOnly);
}
开发者ID:adymitruk,项目名称:openwrap,代码行数:8,代码来源:AssemblyReferences.cs
示例5: CleanProjectPackages
public IPackageCleanResult CleanProjectPackages(PackageDescriptor packages, IPackageRepository projectRepository, string name, PackageCleanOptions options = PackageCleanOptions.Default)
{
if (packages == null) throw new ArgumentNullException("packages");
if (projectRepository == null) throw new ArgumentNullException("projectRepository");
var repoForClean = projectRepository as ISupportCleaning;
if (repoForClean == null) throw new ArgumentException("projectRepository must implement ISupportCleaning");
return new PackageCleanResultIterator(CleanProjectPackagesCore(packages, repoForClean, x => name.EqualsNoCase(x)));
}
开发者ID:andrewdavey,项目名称:openwrap,代码行数:9,代码来源:DefaultPackageManager.cs
示例6: DefaultPackageInfo
public DefaultPackageInfo(string packageFileName, Version versionFileContent, PackageDescriptor descriptor)
{
_descriptor = descriptor;
_packageVersion = versionFileContent
?? descriptor.Version
?? PackageNameUtility.GetVersion(packageFileName);
_packageName = PackageNameUtility.GetName(packageFileName);
Identifier = new PackageIdentifier(Name, Version);
}
开发者ID:emiaj,项目名称:openwrap,代码行数:9,代码来源:DefaultPackageInfo.cs
示例7: Lock
public static IPackageDescriptor Lock(this IPackageDescriptor descriptor, IPackageRepository repository, string scope = null)
{
scope = scope ?? string.Empty;
var lockedRepo = repository.Feature<ISupportLocking>();
if (lockedRepo == null)
return descriptor;
var lockedDescriptor = new PackageDescriptor(descriptor);
var lockedPackages = lockedRepo.LockedPackages[scope];
return Lock(lockedDescriptor, lockedPackages);
}
开发者ID:guesshoo,项目名称:openwrap,代码行数:10,代码来源:PackageDescriptorExtensions.cs
示例8: Write
public void Write(PackageDescriptor descriptor, Stream descriptorStream)
{
var streamWriter = new StreamWriter(descriptorStream, Encoding.UTF8);
var lines = from parser in _lineParsers
from parserLine in parser.Write(descriptor)
select parserLine;
var content = lines.Join("\r\n");
streamWriter.Write(content);
streamWriter.Flush();
}
开发者ID:RobertTheGrey,项目名称:openwrap,代码行数:11,代码来源:PackageDescriptorReaderWriter.cs
示例9: InMemoryEnvironment
public InMemoryEnvironment(IDirectory currentDirectory, IDirectory configDirectory)
{
CurrentDirectory = currentDirectory;
SystemRepository = new InMemoryRepository("System repository");
RemoteRepository = new InMemoryRepository("Remote repository");
CurrentDirectoryRepository = new InMemoryRepository("Current directory repository");
RemoteRepositories = new List<InMemoryRepository> { RemoteRepository };
DescriptorFile = CurrentDirectory.GetFile("descriptor.wrapdesc");
Descriptor = new PackageDescriptor();
ConfigurationDirectory = configDirectory;
}
开发者ID:emiaj,项目名称:openwrap,代码行数:11,代码来源:InMemoryEnvironment.cs
示例10: dependency_resolver_context
public dependency_resolver_context()
{
DependencyDescriptor = new PackageDescriptor
{
Name = "test",
SemanticVersion = "1.0".ToSemVer()
};
ProjectRepository = new InMemoryRepository("Local repository");
SystemRepository = new InMemoryRepository("System repository");
RemoteRepository = new InMemoryRepository("Remote repository");
CurrentDirectoryRepository = new InMemoryRepository("Current repository");
}
开发者ID:modulexcite,项目名称:openwrap,代码行数:12,代码来源:dependency_manager_context.cs
示例11: Read
public PackageDescriptor Read(Stream content)
{
var stringReader = new StreamReader(content, true);
var lines = stringReader.ReadToEnd().GetUnfoldedLines();
var descriptor = new PackageDescriptor();
foreach (var line in lines)
foreach (var parser in _lineParsers)
parser.Parse(line, descriptor);
return descriptor;
}
开发者ID:RobertTheGrey,项目名称:openwrap,代码行数:12,代码来源:PackageDescriptorReaderWriter.cs
示例12: GenerateDescriptorFile
static PackageContent GenerateDescriptorFile(PackageDescriptor descriptor)
{
var descriptorStream = new MemoryStream();
new PackageDescriptorReaderWriter().Write(descriptor, descriptorStream);
return new PackageContent
{
FileName = descriptor.Name + ".wrapdesc",
RelativePath = ".",
Stream = descriptorStream.ResetOnRead(),
Size = descriptorStream.Length
};
}
开发者ID:andrewdavey,项目名称:openwrap,代码行数:12,代码来源:BuildWrapCommand.cs
示例13: InMemoryEnvironment
public InMemoryEnvironment(IDirectory currentDirectory, IDirectory configDirectory)
{
CurrentDirectory = currentDirectory;
SystemRepository = new InMemoryRepository("System repository");
RemoteRepository = new InMemoryRepository("Remote repository");
CurrentDirectoryRepository = new InMemoryRepository("Current directory repository");
RemoteRepositories = new List<InMemoryRepository> { RemoteRepository };
DescriptorFile = CurrentDirectory.GetFile("descriptor.wrapdesc").MustExist();
Descriptor = new PackageDescriptor();
ConfigurationDirectory = configDirectory;
ScopedDescriptors = new Dictionary<string, FileBased<IPackageDescriptor>>(StringComparer.OrdinalIgnoreCase);
ScopedDescriptors[string.Empty] = FileBased.New(DescriptorFile, Descriptor);
}
开发者ID:petejohanson,项目名称:openwrap,代码行数:13,代码来源:InMemoryEnvironment.cs
示例14: AddProjectPackage
public IPackageAddResult AddProjectPackage(PackageRequest packageToAdd,
IEnumerable<IPackageRepository> sourceRepositories,
PackageDescriptor projectDescriptor,
IPackageRepository projectRepository,
PackageAddOptions options = PackageAddOptions.Default)
{
Check.NotNull(packageToAdd, "packageToAdd");
Check.NoNullElements(sourceRepositories, "sourceRepositories");
Check.NotNull(projectDescriptor, "projectDescriptor");
Check.NotNull(projectRepository, "projectRepository");
return new PackageAddResultIterator(AddProjectPackageCore(packageToAdd, sourceRepositories, projectDescriptor, projectRepository, options));
}
开发者ID:andrewdavey,项目名称:openwrap,代码行数:13,代码来源:DefaultPackageManager.cs
示例15: GetPackage
/// <summary>
/// Retrieves a suitable package to put a certain type into.
/// </summary>
/// <param name="type">type for which a suitable package is desired</param>
/// <returns>suitable package</returns>
public PackageDescriptor GetPackage(Type type)
{
string pkgName = type.Namespace;
if (pkgName == null)
pkgName = "DefaultPackage";
PackageDescriptor pd;
if (!_pkgMap.TryGetValue(pkgName, out pd))
{
pd = new PackageDescriptor(pkgName);
}
_pkgMap[pkgName] = pd;
_design.AddChild(pd, pd.Name);
return pd;
}
开发者ID:venusdharan,项目名称:systemsharp,代码行数:19,代码来源:TypeLibrary.cs
示例16: ExecuteAllTests
public IEnumerable<KeyValuePair<string, bool?>> ExecuteAllTests(ExecutionEnvironment environment, IPackage package)
{
var descriptor = new PackageDescriptor();
descriptor.Dependencies.Add(new PackageDependencyBuilder(Guid.NewGuid().ToString()).Name(package.Name).VersionVertex(new EqualVersionVertex(package.Version)));
var allAssemblyReferences = _manager.GetProjectAssemblyReferences(descriptor, package.Source, environment, false);
var runners = _factories.SelectMany(x => x.GetTestRunners(allAssemblyReferences)).NotNull();
var tests = new DefaultAssemblyExporter("tests").Items<Exports.IAssembly>(package, environment);
if (tests == null) return Enumerable.Empty<KeyValuePair<string, bool?>>();
var testAssemblies = from item in tests.SelectMany(x=>x)
where item.File.Extension.Equals(".dll")
select item.File.Path.FullPath;
return from runner in runners
from asm in testAssemblies
from result in runner.ExecuteTests(allAssemblyReferences.Select(x => x.File.Path.FullPath).ToList(), testAssemblies)
select result;
}
开发者ID:nuxleus,项目名称:openwrap,代码行数:21,代码来源:TestRunnerManager.cs
示例17: ExecuteAllTests
public IEnumerable<KeyValuePair<string, bool?>> ExecuteAllTests(ExecutionEnvironment environment, IPackage package)
{
var descriptor = new PackageDescriptor();
descriptor.Dependencies.Add(new PackageDependencyBuilder(Guid.NewGuid().ToString()).Name(package.Name).VersionVertex(new EqualVersionVertex(package.Version)));
var allAssemblyReferences = _resolver.GetAssemblyReferences(false, environment, descriptor, package.Source, _environment.ProjectRepository, _environment.SystemRepository);
var runners = _factories.SelectMany(x=>x.GetTestRunners(allAssemblyReferences)).NotNull();
var export = package.GetExport("tests", environment);
if (export == null) return Enumerable.Empty<KeyValuePair<string, bool?>>();
var testAssemblies = from item in export.Items
where item.FullPath.EndsWithNoCase(".dll")
select item.FullPath;
return from runner in runners
from asm in testAssemblies
from result in runner.ExecuteTests(allAssemblyReferences.Select(x => x.FullPath).ToList(), testAssemblies)
select result;
}
开发者ID:petejohanson,项目名称:openwrap,代码行数:21,代码来源:TestRunnerManager.cs
示例18: UncompressedPackage
public UncompressedPackage(IPackageRepository source,
IFile originalPackageFile,
IDirectory wrapCacheDirectory,
IEnumerable<IExportBuilder> exporters)
{
_originalPackageFile = originalPackageFile;
_exporters = exporters;
BaseDirectory = wrapCacheDirectory;
// get the descriptor file inside the package
var descriptorName = originalPackageFile.NameWithoutExtension;
Source = source;
var wrapDescriptor = wrapCacheDirectory.Files("*.wrapdesc").SingleOrDefault();
if (wrapDescriptor == null)
throw new InvalidOperationException("Could not find descriptor in wrap cache directory, or there are multiple .wrapdesc files in the package.");
var versionFile = wrapCacheDirectory.GetFile("version");
_descriptor = new PackageDescriptorReaderWriter().Read(wrapDescriptor);
PackageInfo = new DefaultPackageInfo(originalPackageFile.Name,
versionFile.Exists ? versionFile.Read(x => x.ReadString().ToVersion()) : null,
_descriptor);
Identifier = new PackageIdentifier(Name, Version);
}
开发者ID:andrewdavey,项目名称:openwrap,代码行数:21,代码来源:UncompressedPackage.cs
示例19: ParseContent
protected abstract void ParseContent(string content, PackageDescriptor descriptor);
开发者ID:andrewdavey,项目名称:openwrap,代码行数:1,代码来源:AbstractDescriptorParser.cs
示例20: GetPackageVersion
Version GetPackageVersion(IList<FileBuildResult> buildFiles, PackageDescriptor packageDescriptorForEmbedding)
{
// gets the package version from (in this order):
// 1. 'version' file generated by the build
// 2. 'version' file living alongside the .wrapdesc file
// 3. 'version:' header in wrap descriptor
return new DefaultPackageInfo(string.Empty, GetVersionFromVersionFiles(buildFiles), packageDescriptorForEmbedding).Version;
}
开发者ID:andrewdavey,项目名称:openwrap,代码行数:9,代码来源:BuildWrapCommand.cs
注:本文中的PackageDescriptor类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论