public ResolvedFileEventArgs(string packageId, PackageFileKind kind, BuildConfiguration configuration, string fileName) { PackageId = packageId; Kind = kind; Configuration = configuration; FileName = fileName; }
protected void InstallGenericFile(string root, string fileToInstall, PackageFileKind kind, string packageId) { string kindName = kind.ToString().ToLower(); string relativeKindRoot = Path.Combine(root, kindName); if (!Directory.Exists(relativeKindRoot)) { Directory.CreateDirectory(relativeKindRoot); } string shortName = fileToInstall.Substring(fileToInstall.IndexOf("/") + 1); string fullName = kindName + "/" + packageId + "/" + shortName; InstallingResolvedFile?.Invoke(this, new ResolvedFileEventArgs(packageId, kind, BuildConfiguration.Any, fullName)); string fullPath = PathUtils.FixPathSeparators(Path.Combine(root, fullName)); string fullDirPath = new FileInfo(fullPath).Directory.FullName; PathUtils.EnsureDirectoryExists(fullDirPath); if (File.Exists(fullPath)) { File.Delete(fullPath); } using (Stream df = File.Create(fullPath)) GetSourceStream(fileToInstall).CopyTo(df); }
protected void InstallToInternal(string rootFolder, string packageId, BuildConfiguration configuration, string filePath) { PackageFileKind kind = GetKind(filePath); switch (kind) { case PackageFileKind.Binary: InstallLibrary(packageId, rootFolder, filePath, configuration); break; case PackageFileKind.Include: case PackageFileKind.Tools: case PackageFileKind.Other: InstallGenericFile(rootFolder, filePath, kind, packageId); break; } }
public SourceFiles(string include, PackageFileKind kind = PackageFileKind.Binary) : this() { this.Include = include; this.FileKind = kind; }