Announcement Announcement Module
No announcement yet.
recording results of roo commands (svn / git) Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • recording results of roo commands (svn / git)

    I find ROO really great, but as a beginner it would really help to understand better if I could tell what command produced certain lines in generated files (or what lines were handwritten).

    One obvious solution would be to add project to version control(for example SVN) and after each command commit the project so later you could view SVN annotations (for example using Subclipse plugin: Team -> show annotations) and tell based on SVN commit message, what Roo command produced the line.

    I think that it would be create to have such ROO add-on that automatically commits changed files after executing roo command and also adds roo command to the commit message. However it seemed to me, that one place where such logic could be "hacked in" is in roo core class eCommand() or JLineShell that extends AbstractShell.
    Of course I understand that changing this place is not very smart decision. I guess that it would not be very difficult to develop such an add-on, but can someone guide me how I could develop an add-on, that replaces default shell (I guess this is JLineShell) with a subclass, that performs some svn operations in addition to everything that default shell is doing?

    As I imagine the add-on would require installation of svn and would simply make smth like
    Runtime.getRuntime().exec( "svn add "+newFiles );
    Runtime.getRuntime().exec( "svn commit -m "+"rooCommand:\n"+ command);
    This add-on could probably make a commit based add-on specific optional attribute, such as
    "--commitOnSuccess true"
    and maybe also before execution of command using
    "--precommit true"
    (or based on user preferences, if such a concept exists in ROO).

    I would really appreciate if someone could get me going with this.


  • #2
    Roo does tell you which files have been touched (managed file xyz) and which files have been created (created file abc). I am not sure, if there is the possibility to get more detailed information about the stuff that has been added/removed/changed. If there is no such thing, you could always open a feature request in Jira

    What I would like to see is something like this.
    anyRooCommand --parameters --verbose
    In Roo shell (and maybe also in the roo.log as comments):
    Added line log4j.rootLogger=info, stdout, R
    Added line log4j.appender.stdout=org.apache.log4j.ConsoleAppender
    Added line log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
    I guess for some commands it would not be that easy to read/understand the single changes (compare any version system compare between two versions).


    • #3
      In Roo 1.1.0.M1 I added a feature so more detailed messages can be outputted (see It's now just a question of other parts of Roo using this new API to give more info on what they're doing. Of course the messages are designed for easy human consumption, as opposed to source control diff style messages. That latter could be automated relatively easily, though, as we now have a new FileManager method that is generally used by Roo modules and add-ons to add or modify a file (see I could add some cleverness into there to give a diff style comparison if you like. Feel free to log this as an enhancement request.

      Note there has been separate discussion about Roo integration with source control repository systems, as per I am less of a fan of these as they're more complex and there will be compatibility issues. Feel free to log the simple diff output enhancement request, though.


      • #4
        Created improvement request ROO-901. Feel free to vote for it if you would like to see this implemented.