06 August, 2006

More Eclipse Monkey

Today's Eclipse Monkey offering is entirely selfish in its utility. It updates the version number of any locally modified plug-ins in my workspace.

I've reformatted it a bit to make it fit a little better on this page.

--- Came wiffling through the eclipsey wood ---
/*
 * Menu: Versions > Update Versions of Modified Plug Ins
 * Kudos: Toby Tripp
 * License: EPL 1.0
 *
 * The Update Site URL and Feature ID of the "DOM"
 * for this script:
 * DOM: http://tripp.no-ip.org/eclipse/updates/com.ttripp.eclipsemonkey.doms
 *
 * The above DOM provides the following objects:
 *  * svn - com.ttripp.eclipsemonkey.doms.subversion.SubversionResources
 *  * pluginVersion - com.ttripp.eclipsemonkey.doms.plugins.PluginsFacade
 *
 * Note that this DOM depends on the Subclipse plug-in:
 *   http://subclipse.tigris.org/update_1.2.x
 */
 function main() {
  
    var verIndex =
       Packages.com.ttripp.eclipsemonkey.doms.plugins.PluginsFacade.UPDATE_VERSION
  
    // dirtyProjects returns an array of 
    // Subversion resources (ISVNLocalResource)
    var dirtyProjects = svn.dirtyProjects();
  
    for each( project in dirtyProjects ) {
   
       // This call will increment, by one, the third (update)
       // index of the plug-ins version number.
       pluginVersion.incrementPluginVersion( project.getResource(),
                                             verIndex );
    }
 }
--- And burbled as it ran! ---

No comments: