static void PackagePlugin(FileReference SourcePluginFile, IEnumerable <FileReference> BuildProducts, DirectoryReference TargetDir, bool bUnversioned) { DirectoryReference SourcePluginDir = SourcePluginFile.Directory; // Copy all the files to the output directory FileReference[] SourceFiles = FilterPluginFiles(SourcePluginFile, BuildProducts).ToArray(); foreach (FileReference SourceFile in SourceFiles) { FileReference TargetFile = FileReference.Combine(TargetDir, SourceFile.MakeRelativeTo(SourcePluginDir)); CommandUtils.CopyFile(SourceFile.FullName, TargetFile.FullName); CommandUtils.SetFileAttributes(TargetFile.FullName, ReadOnly: false); } // Get the output plugin filename FileReference TargetPluginFile = FileReference.Combine(TargetDir, SourcePluginFile.GetFileName()); PluginDescriptor NewDescriptor = PluginDescriptor.FromFile(TargetPluginFile); NewDescriptor.bEnabledByDefault = null; NewDescriptor.bInstalled = true; if (!bUnversioned) { BuildVersion Version; if (BuildVersion.TryRead(BuildVersion.GetDefaultFileName(), out Version)) { NewDescriptor.EngineVersion = String.Format("{0}.{1}.0", Version.MajorVersion, Version.MinorVersion); } } NewDescriptor.Save(TargetPluginFile.FullName); }
public override void ExecuteBuild() { string FileName = ParseParamValue("FileName", null); if (FileName == null) { throw new AutomationException("Missing -FileName=... argument"); } CommandUtils.SetFileAttributes(FileName, ReadOnly: false); PluginDescriptor Plugin = PluginDescriptor.FromFile(new FileReference(FileName)); Plugin.bEnabledByDefault = true; Plugin.Save(FileName); }
static void PackagePlugin(FileReference SourcePluginFile, IEnumerable <FileReference> BuildProducts, DirectoryReference TargetDir) { DirectoryReference SourcePluginDir = SourcePluginFile.Directory; // Copy all the files to the output directory FileReference[] SourceFiles = FilterPluginFiles(SourcePluginFile, BuildProducts).ToArray(); foreach (FileReference SourceFile in SourceFiles) { FileReference TargetFile = FileReference.Combine(TargetDir, SourceFile.MakeRelativeTo(SourcePluginDir)); CommandUtils.CopyFile(SourceFile.FullName, TargetFile.FullName); CommandUtils.SetFileAttributes(TargetFile.FullName, ReadOnly: false); } // Get the output plugin filename FileReference TargetPluginFile = FileReference.Combine(TargetDir, SourcePluginFile.GetFileName()); PluginDescriptor NewDescriptor = PluginDescriptor.FromFile(TargetPluginFile, false); NewDescriptor.bEnabledByDefault = true; NewDescriptor.bInstalled = true; NewDescriptor.Save(TargetPluginFile.FullName, false); }
static void PackagePlugin(string PluginFileName, List <BuildProduct> BuildProducts, string PackageDirectory) { // Clear the output directory CommandUtils.DeleteDirectoryContents(PackageDirectory); // Copy all the files to the output directory List <string> MatchingFileNames = FilterPluginFiles(PluginFileName, BuildProducts); foreach (string MatchingFileName in MatchingFileNames) { string SourceFileName = Path.Combine(Path.GetDirectoryName(PluginFileName), MatchingFileName); string TargetFileName = Path.Combine(PackageDirectory, MatchingFileName); CommandUtils.CopyFile(SourceFileName, TargetFileName); CommandUtils.SetFileAttributes(TargetFileName, ReadOnly: false); } // Get the output plugin filename string TargetPluginFileName = CommandUtils.MakeRerootedFilePath(Path.GetFullPath(PluginFileName), Path.GetDirectoryName(Path.GetFullPath(PluginFileName)), PackageDirectory); PluginDescriptor NewDescriptor = PluginDescriptor.FromFile(TargetPluginFileName); NewDescriptor.bEnabledByDefault = true; NewDescriptor.bInstalled = true; NewDescriptor.Save(TargetPluginFileName); }