Esempio n. 1
0
 private void SetOptionalProperties(BsipaManifest manifest)
 {
     manifest.Files         = ParseUtil.ParseStringArray(Files);
     manifest.DependsOn     = ParseUtil.ParseModIds(DependsOn, manifest.DependsOn, "DependsOn");
     manifest.ConflictsWith = ParseUtil.ParseModIds(ConflictsWith, manifest.ConflictsWith, "ConflictsWith");
     manifest.LoadBefore    = ParseUtil.ParseStringArray(LoadBefore);
     manifest.LoadAfter     = ParseUtil.ParseStringArray(LoadAfter);
     if (!string.IsNullOrWhiteSpace(Icon))
     {
         manifest.Icon = Icon;
     }
     manifest.ProjectHome   = ProjectHome;
     manifest.ProjectSource = ProjectSource;
     manifest.Donate        = Donate;
     if (!string.IsNullOrWhiteSpace(Features))
     {
         manifest.Features = SimpleJSON.JSON.Parse(Features) as SimpleJSON.JSONObject;
     }
     if (!string.IsNullOrWhiteSpace(Misc))
     {
         manifest.Misc = SimpleJSON.JSON.Parse(Misc) as SimpleJSON.JSONObject;
     }
     if (!string.IsNullOrWhiteSpace(PluginHint))
     {
         manifest.PluginHint = PluginHint;
     }
     manifest.GeneratedBy = $"BSMT.Tasks/{Assembly.GetExecutingAssembly().GetName().Version.ToString()}";
 }
Esempio n. 2
0
 public void TestManifest(GenerateManifest task, BsipaManifest manifest, int baseDepends = 0, int baseConflicts = 0)
 {
     Assert.AreEqual(task.Id, manifest.Id);
     Assert.AreEqual(task.Name, manifest.Name);
     Assert.AreEqual(task.Author, manifest.Author);
     Assert.AreEqual(task.Version, manifest.Version);
     Assert.AreEqual(task.GameVersion, manifest.GameVersion);
     Assert.AreEqual(task.Description, manifest.Description);
     Assert.AreEqual(task.Icon, manifest.Icon);
     CompareDictionary(ParseUtil.ParseModIds(task.DependsOn, null, "DependsOn"), manifest.DependsOn, baseDepends);
     CompareDictionary(ParseUtil.ParseModIds(task.ConflictsWith, null, "ConflictsWith"), manifest.ConflictsWith, baseConflicts);
     CompareStringArrays(ParseUtil.ParseStringArray(task.Files), manifest.Files, 0);
 }