Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
03/22/08 15:59:07 (16 years ago)
Author:
gkronber
Message:
  • added an attribute for the build time of an assembly.
  • build-date is automatically updated via SubWCRev in the pre-build action.
  • adapted PluginManager to correctly handle plugins with same version but newer build date

fixes ticket #39

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.PluginInfrastructure.GUI/ManagerForm.cs

    r38 r91  
    147147    private void publishButton_Click(object sender, EventArgs args) {
    148148      PluginInfo plugin = ((PluginTag)pluginTreeView.SelectedNode.Tag).Plugin;
     149      publishPlugin(plugin);
     150    }
     151
     152    private void publishPlugin(PluginInfo plugin) {
    149153      try {
    150154        string packageFileName = plugin.Name + "-" + plugin.Version + ".zip";
     
    165169        infoTextBox.Text += "Upload this file to your plugin source and add the following entry to" +
    166170" the file plugins.xml residing in the base directory of your plugin source.\n\n";
    167         infoTextBox.Text += "  <Plugin Name=\"" + plugin.Name + "\" Version=\"" + plugin.Version + "\">\n";
     171        infoTextBox.Text += "  <Plugin Name=\"" + plugin.Name + "\" Version=\""
     172          + plugin.Version + "\" Build=\"" + plugin.BuildDate.ToUniversalTime().ToString(System.Globalization.CultureInfo.InvariantCulture.DateTimeFormat) + "\">\n";
    168173        foreach(PluginInfo dependency in plugin.Dependencies) {
    169174          infoTextBox.Text += "    <Dependency Name=\"" + dependency.Name + "\" />\n";
     
    251256        if(samePlugins.Count > 1) {
    252257          samePlugins.ForEach(delegate(PluginDescription tag2) {
    253             if(tag2.Version > mostRecentVersion.Version) {
     258            if(tag2.Version > mostRecentVersion.Version ||
     259              (tag2.Version == mostRecentVersion.Version && tag2.BuildDate>mostRecentVersion.BuildDate)) {
    254260              mostRecentVersion = tag2;
    255261            }
     
    288294      allAvailablePlugins.ForEach(delegate(PluginDescription availablePlugin) {
    289295        List<PluginTag> oldPlugins = allTags.FindAll(delegate(PluginTag currentPlugin) {
    290           return currentPlugin.PluginName == availablePlugin.Name && 
    291             (currentPlugin.State & (PluginState.Installed | PluginState.Disabled)) !=0;
     296          return currentPlugin.PluginName == availablePlugin.Name &&
     297            (currentPlugin.State & (PluginState.Installed | PluginState.Disabled)) != 0;
    292298        });
    293299
    294300        if(oldPlugins.Count == 1) {
    295           if(oldPlugins[0].PluginVersion < availablePlugin.Version) {
     301          if(oldPlugins[0].PluginVersion < availablePlugin.Version ||
     302            (oldPlugins[0].PluginVersion == availablePlugin.Version && oldPlugins[0].PluginBuildDate<availablePlugin.BuildDate)) {
    296303            upgrades.Add(availablePlugin);
    297304          }
     
    309316        });
    310317
    311         if(currentPlugins.Count == 1 && currentPlugins[0].PluginVersion < availablePlugin.Version) {
     318        if(currentPlugins.Count == 1 && (currentPlugins[0].PluginVersion < availablePlugin.Version ||
     319          (currentPlugins[0].PluginVersion==availablePlugin.Version && currentPlugins[0].PluginBuildDate<availablePlugin.BuildDate))) {
    312320          overrides.Add(availablePlugin);
    313321        }
Note: See TracChangeset for help on using the changeset viewer.