public Package GetPackage() { var packageId = PackageId.Create(GetStringId()); IPackageDescriptor iPackageDescriptor = new PackageDescriptor(); return(Package.Create(packageId, GetAbsolutePath(), iPackageDescriptor)); }
private Package CreatePackage(string version) { AbsolutePath path = AbsolutePath.Create(m_context.PathTable, TemporaryDirectory + $"\\random.package.name\\{version}\\nu.spec"); var pathStr = path.ToString(m_context.PathTable); var id = PackageId.Create(StringId.Create(m_context.StringTable, pathStr)); var desc = new PackageDescriptor(); return(Package.Create(id, path, desc)); }
/// <nodoc /> protected static PackageId ReadPackageId(BuildXLReader reader) { var name = reader.ReadStringId(); var minVersion = reader.ReadStringId(); var maxVersion = reader.ReadStringId(); if (minVersion.IsValid && maxVersion.IsValid) { return(PackageId.Create(name, PackageVersion.Create(minVersion, maxVersion))); } return(PackageId.Create(name)); }
/// <nodoc/> protected Package CreateDummyPackageFromPath(AbsolutePath path) { Contract.Requires(path.IsValid); var pathStr = path.ToString(Context.PathTable); var id = PackageId.Create(StringId.Create(Context.StringTable, pathStr)); var desc = new PackageDescriptor { Name = path.ToString(Context.PathTable), }; return(Package.Create(id, path, desc)); }
private Package CreatePackageForModule(ParsedModule module) { var path = module.Definition.Root.Combine(PathTable, "package.config.dsc"); var package = Package.Create( PackageId.Create(StringTable, module.Descriptor.Name), path, new PackageDescriptor { Name = module.Descriptor.Name }, parsedProjects: module.PathToSpecs, moduleId: module.Descriptor.Id); return(package); }
private Package CreatePackage(ModuleDefinition moduleDefinition) { var moduleDescriptor = moduleDefinition.Descriptor; var packageId = PackageId.Create(StringId.Create(m_context.StringTable, moduleDescriptor.Name)); var packageDescriptor = new PackageDescriptor { Name = moduleDescriptor.Name, Main = moduleDefinition.MainFile, NameResolutionSemantics = NameResolutionSemantics.ImplicitProjectReferences, Publisher = null, Version = moduleDescriptor.Version, Projects = new List <AbsolutePath>(moduleDefinition.Specs), }; return(Package.Create(packageId, moduleDefinition.ModuleConfigFile, packageDescriptor, moduleId: moduleDescriptor.Id)); }
private Package CreateConfigAsPackage( IConfiguration config, AbsolutePath configPath, IReadOnlyList <AbsolutePath> projects) { string name = Names.ConfigAsPackageName; var descriptor = new PackageDescriptor { Name = name, // Instead of displaying cryptic '__Config__' we use a foler name where config.dsc is located DisplayName = configPath.GetParent(Context.PathTable).GetName(Context.PathTable).ToString(Context.StringTable), Projects = projects, NameResolutionSemantics = config.FrontEnd.NameResolutionSemantics(), }; var id = PackageId.Create(StringId.Create(Context.StringTable, name)); // This makes the default package the only one whose main file is its own configuration file! // TODO: make this consistent (nevertheless, 'main' field should go away when we move completely to V2...) return(Package.Create(id, configPath, descriptor)); }