ADA集成开发环境GNAT-GPS的版本控制配置

ADA集成开发环境GNAT-GPS集成了CVS功能。其基本配置界面如下:

 

ADA集成开发环境GNAT-GPS的版本控制配置_第1张图片

这里对ariane工程(一个新建的ADA库代号,google code地址http://code.google.com/p/ariane/

(Sorry, with IME turned off, the rest of the article is to be in English)

This is a section inside the project preference which can be brought up by clicking on the appropriate item in the context menu of the project node in the project view.

Normally google code assigns to each user a user name (which should be the google account) and a password (a system generated password for google code purpose only). So when one first time accesses the code base through a client, authentication is requested. No exception to this ADA IDE. But fortunately, it seems the password only needs to be input once, and on a linux machine (should similarly apply to windows), once svn client with command line tool is installed (which means it's allowed to do svn operations by typing in commands starting svn in a linux terminal), one can use this IDE to talk to google code server through svn client without difficulty. The only thing needs to be done is specify the authentication information, the pair of user name and password. There is no way to do so with the user interface of the gnat-gps IDE, however the IDE is actually very powerful in that it allows users to write scripts in XML and Python to configure it and customize its behavior. In this simple case, we only need to modify XML code for Subversion setup located specifically in a file named (on ubuntu linux platform) /usr/share/gps/plug-ins/subversion.xml, the folder where the file is placed is for all gnat-gps plugins which are XMLs and Pythons that respectively declare and define the actions the IDE would take for these specific tasks.

There is only one place we need to change, which is in the following XML section. 

 1 <action name="generic_svn_commit" show-command="false" output="none" category="">
 2   <shell output="">echo "Committing file(s) $2-"</shell>
 3   <shell>dump "$1" TRUE</shell>
 4   <external check-password="true">svn --non-interactive --non-recursive commit -F "%1" "$2-"</external>
 5   <on-failure>
 6      <shell output="">echo_error "SVN error:"</shell>
 7      <shell output="">echo_error "%2"</shell>
 8   </on-failure>
 9   <shell>delete "%2"</shell>
10   <shell>Hook "file_changed_on_disk"</shell>
11   <shell>Hook.run %1 null</shell>
12 </action>

This XML section describes the action the IDE performs whenever the user makes a svn commit, and what the system does is specified in the external element which is an svn command line the system directs to the linux shell to execute. We don't need to worry about the details of the arguments, among some options regarding the modes of the commit process, what they mainly specify are the source and the target (which is actually the path we input in the repository field above), and what's missing here, the authentication information can be appended at the end, as below

1 <external check-password="true">
2   svn --non-interactive --non-recursive commit -F "%1" "$2-" -username [email protected] -password somepassword
3 </external>

From now on, the CVS in svn mode for google code access should be properly configured. And the first thing to do afterwards is committing some file onto the server to activate the authentication, and once this is done, I guess google would approve this client and no longer request authentication data later on. And the user might well restore the svn plugin file to what it was. There should be some other nicer and more flexible way to specify the authentication information, like by reading it from the IDE's environment variables, some registry or whatever, but it surely would take some time to find them, and since for this particular use with google code, the data is sent once and for all, I am not very keen to make this exploration.

你可能感兴趣的:(版本控制)