/// <summary> /// Writes the plugin descriptor to an existing Json writer /// </summary> /// <param name="Writer">The writer to receive plugin data</param> /// <param name="BaseDir">Base directory to save paths relative to</param> public void Write(JsonWriter Writer, DirectoryReference BaseDir) { Writer.WriteValue("FileVersion", (int)ProjectDescriptorVersion.Latest); Writer.WriteValue("EngineAssociation", EngineAssociation); Writer.WriteValue("Category", Category); Writer.WriteValue("Description", Description); if (DisableEnginePluginsByDefault) { Writer.WriteValue("DisableEnginePluginsByDefault", DisableEnginePluginsByDefault); } // Write the enterprise flag if (IsEnterpriseProject) { Writer.WriteValue("Enterprise", IsEnterpriseProject); } // Write the module list ModuleDescriptor.WriteArray(Writer, "Modules", Modules); // Write the plugin list PluginReferenceDescriptor.WriteArray(Writer, "Plugins", Plugins); // Write the custom module roots if (AdditionalRootDirectories.Count > 0) { Writer.WriteStringArrayField("AdditionalRootDirectories", AdditionalRootDirectories.Select(x => x.MakeRelativeTo(BaseDir).Replace(Path.DirectorySeparatorChar, '/'))); } // Write out the additional plugin directories to scan if (AdditionalPluginDirectories.Count > 0) { Writer.WriteStringArrayField("AdditionalPluginDirectories", AdditionalPluginDirectories.Select(x => x.MakeRelativeTo(BaseDir).Replace(Path.DirectorySeparatorChar, '/'))); } // Write the target platforms if (TargetPlatforms != null && TargetPlatforms.Length > 0) { Writer.WriteStringArrayField("TargetPlatforms", TargetPlatforms); } // If it's a signed sample, write the name hash if (EpicSampleNameHash != 0) { Writer.WriteValue("EpicSampleNameHash", (uint)EpicSampleNameHash); } // Write the custom build steps if (PreBuildSteps != null) { PreBuildSteps.Write(Writer, "PreBuildSteps"); } if (PostBuildSteps != null) { PostBuildSteps.Write(Writer, "PostBuildSteps"); } }
/// <summary> /// Writes the plugin descriptor to an existing Json writer /// </summary> /// <param name="Writer">The writer to receive plugin data</param> public void Write(JsonWriter Writer) { Writer.WriteValue("FileVersion", (int)ProjectDescriptorVersion.Latest); Writer.WriteValue("Version", Version); Writer.WriteValue("VersionName", VersionName); Writer.WriteValue("FriendlyName", FriendlyName); Writer.WriteValue("Description", Description); Writer.WriteValue("Category", Category); Writer.WriteValue("CreatedBy", CreatedBy); Writer.WriteValue("CreatedByURL", CreatedByURL); Writer.WriteValue("DocsURL", DocsURL); Writer.WriteValue("MarketplaceURL", MarketplaceURL); Writer.WriteValue("SupportURL", SupportURL); if (!String.IsNullOrEmpty(EngineVersion)) { Writer.WriteValue("EngineVersion", EngineVersion); } if (bEnabledByDefault.HasValue) { Writer.WriteValue("EnabledByDefault", bEnabledByDefault.Value); } Writer.WriteValue("CanContainContent", bCanContainContent); if (bIsBetaVersion) { Writer.WriteValue("IsBetaVersion", bIsBetaVersion); } if (bInstalled) { Writer.WriteValue("Installed", bInstalled); } if (bRequiresBuildPlatform) { Writer.WriteValue("RequiresBuildPlatform", bRequiresBuildPlatform); } if (SupportedTargetPlatforms != null && SupportedTargetPlatforms.Length > 0) { Writer.WriteEnumArrayField <UnrealTargetPlatform>("SupportedTargetPlatforms", SupportedTargetPlatforms); } ModuleDescriptor.WriteArray(Writer, "Modules", Modules); LocalizationTargetDescriptor.WriteArray(Writer, "LocalizationTargets", LocalizationTargets); if (PreBuildSteps != null) { PreBuildSteps.Write(Writer, "PreBuildSteps"); } if (PostBuildSteps != null) { PostBuildSteps.Write(Writer, "PostBuildSteps"); } PluginReferenceDescriptor.WriteArray(Writer, "Plugins", Plugins); }
/// <summary> /// Saves the descriptor to disk /// </summary> /// <param name="FileName">The filename to write to</param> /// <param name="bPluginTypeEnabledByDefault">Whether the plugin is enabled by default based on its location</param> public void Save(string FileName, bool bPluginTypeEnabledByDefault) { using (JsonWriter Writer = new JsonWriter(FileName)) { Writer.WriteObjectStart(); Writer.WriteValue("FileVersion", (int)ProjectDescriptorVersion.Latest); Writer.WriteValue("Version", Version); Writer.WriteValue("VersionName", VersionName); Writer.WriteValue("FriendlyName", FriendlyName); Writer.WriteValue("Description", Description); Writer.WriteValue("Category", Category); Writer.WriteValue("CreatedBy", CreatedBy); Writer.WriteValue("CreatedByURL", CreatedByURL); Writer.WriteValue("DocsURL", DocsURL); Writer.WriteValue("MarketplaceURL", MarketplaceURL); Writer.WriteValue("SupportURL", SupportURL); if (!String.IsNullOrEmpty(EngineVersion)) { Writer.WriteValue("EngineVersion", EngineVersion); } if (CompatibleChangelist != 0) { Writer.WriteValue("CompatibleChangelist", CompatibleChangelist); } if (bEnabledByDefault != bPluginTypeEnabledByDefault) { Writer.WriteValue("EnabledByDefault", bEnabledByDefault); } Writer.WriteValue("CanContainContent", bCanContainContent); Writer.WriteValue("IsBetaVersion", bIsBetaVersion); if (bIsMod) { Writer.WriteValue("IsMod", bIsMod); } Writer.WriteValue("Installed", bInstalled); Writer.WriteValue("RequiresBuildPlatform", bRequiresBuildPlatform); ModuleDescriptor.WriteArray(Writer, "Modules", Modules); if (PreBuildSteps != null) { PreBuildSteps.Write(Writer, "PreBuildSteps"); } if (PostBuildSteps != null) { PostBuildSteps.Write(Writer, "PostBuildSteps"); } Writer.WriteObjectEnd(); } }
/// <summary> /// Writes the plugin descriptor to an existing Json writer /// </summary> /// <param name="Writer">The writer to receive plugin data</param> public void Write(JsonWriter Writer) { Writer.WriteValue("FileVersion", (int)ProjectDescriptorVersion.Latest); Writer.WriteValue("EngineAssociation", EngineAssociation); Writer.WriteValue("Category", Category); Writer.WriteValue("Description", Description); // Write the enterprise flag if (IsEnterpriseProject) { Writer.WriteValue("Enterprise", IsEnterpriseProject); } // Write the module list ModuleDescriptor.WriteArray(Writer, "Modules", Modules); // Write the plugin list PluginReferenceDescriptor.WriteArray(Writer, "Plugins", Plugins); // Write out the additional plugin directories to scan if (AdditionalPluginDirectories != null && AdditionalPluginDirectories.Length > 0) { Writer.WriteStringArrayField("AdditionalPluginDirectories", AdditionalPluginDirectories); } // Write the target platforms if (TargetPlatforms != null && TargetPlatforms.Length > 0) { Writer.WriteStringArrayField("TargetPlatforms", TargetPlatforms); } // If it's a signed sample, write the name hash if (EpicSampleNameHash != 0) { Writer.WriteValue("EpicSampleNameHash", (uint)EpicSampleNameHash); } // Write the custom build steps if (PreBuildSteps != null) { PreBuildSteps.Write(Writer, "PreBuildSteps"); } if (PostBuildSteps != null) { PostBuildSteps.Write(Writer, "PostBuildSteps"); } }
/// <summary> /// Writes the plugin descriptor to an existing Json writer /// </summary> /// <param name="Writer">The writer to receive plugin data</param> public void Write(JsonWriter Writer) { Writer.WriteValue("FileVersion", (int)ProjectDescriptorVersion.Latest); Writer.WriteValue("Version", Version); Writer.WriteValue("VersionName", VersionName); Writer.WriteValue("FriendlyName", FriendlyName); Writer.WriteValue("Description", Description); Writer.WriteValue("Category", Category); Writer.WriteValue("CreatedBy", CreatedBy); Writer.WriteValue("CreatedByURL", CreatedByURL); Writer.WriteValue("DocsURL", DocsURL); Writer.WriteValue("MarketplaceURL", MarketplaceURL); Writer.WriteValue("SupportURL", SupportURL); if (!String.IsNullOrEmpty(EngineVersion)) { Writer.WriteValue("EngineVersion", EngineVersion); } if (bEnabledByDefault.HasValue) { Writer.WriteValue("EnabledByDefault", bEnabledByDefault.Value); } Writer.WriteValue("CanContainContent", bCanContainContent); if (bIsBetaVersion) { Writer.WriteValue("IsBetaVersion", bIsBetaVersion); } if (bIsExperimentalVersion) { Writer.WriteValue("IsExperimentalVersion", bIsExperimentalVersion); } if (bInstalled) { Writer.WriteValue("Installed", bInstalled); } if (bRequiresBuildPlatform) { Writer.WriteValue("RequiresBuildPlatform", bRequiresBuildPlatform); } if (bExplicitlyLoaded) { Writer.WriteValue("ExplicitlyLoaded", bExplicitlyLoaded); } if (SupportedTargetPlatforms != null && SupportedTargetPlatforms.Count > 0) { Writer.WriteStringArrayField("SupportedTargetPlatforms", SupportedTargetPlatforms.Select <UnrealTargetPlatform, string>(x => x.ToString()).ToArray()); } if (SupportedPrograms != null && SupportedPrograms.Length > 0) { Writer.WriteStringArrayField("SupportedPrograms", SupportedPrograms); } if (bIsPluginExtension) { Writer.WriteValue("bIsPluginExtension", bIsPluginExtension); } if (Modules != null && Modules.Count > 0) { ModuleDescriptor.WriteArray(Writer, "Modules", Modules.ToArray()); } LocalizationTargetDescriptor.WriteArray(Writer, "LocalizationTargets", LocalizationTargets); if (PreBuildSteps != null) { PreBuildSteps.Write(Writer, "PreBuildSteps"); } if (PostBuildSteps != null) { PostBuildSteps.Write(Writer, "PostBuildSteps"); } if (Plugins != null && Plugins.Count > 0) { PluginReferenceDescriptor.WriteArray(Writer, "Plugins", Plugins.ToArray()); } }