Commit Graph

13 Commits

Author SHA1 Message Date
Emmanuel Briot
459605c14f (Name_Parameters): more efficient implementation
We now only lookup in the kw dictionary once (we did it up to
 three times before), and simply change the arguments in place,
 removing need for special tests in Get_Param.
In preparation for JB12-019

git-svn-id: svn+ssh://svn.eu.adacore.com/Dev/trunk/gps@167157 936e1b1b-40f2-da11-902a-00137254ae57
2010-11-17 10:00:16 +00:00
Emmanuel Briot
f7fec5f838 Minor refactoring: rename some fields to better describe their role
git-svn-id: svn+ssh://svn.eu.adacore.com/Dev/trunk/gps@167155 936e1b1b-40f2-da11-902a-00137254ae57
2010-11-17 08:13:52 +00:00
Emmanuel Briot
5a8ae181a4 (New_List, Set_Nth_Arg, Set_Return_Value): added support for returning
lists of list to the scripting language, and to make the list more
 explicit instead of using Set_Return_Value_As_List.
JB15-028

git-svn-id: svn+ssh://svn.eu.adacore.com/Dev/trunk/gps@167108 936e1b1b-40f2-da11-902a-00137254ae57
2010-11-16 13:13:47 +00:00
Emmanuel Briot
f932142e8b (List_Instance): new type
(Nth_Arg): can now accept lists as parameters to script functions,
 in addition to the usual simple types
JB15-028

git-svn-id: svn+ssh://svn.eu.adacore.com/Dev/trunk/gps@167055 936e1b1b-40f2-da11-902a-00137254ae57
2010-11-15 17:33:14 +00:00
Emmanuel Briot
ec8ba9a876 (Set_Return_Value_As_List): it is now possible to override the type
returned (ie use the usual builtin "list", or in languages that support
 it a subclass of it)
JB15-010

git-svn-id: svn+ssh://svn.eu.adacore.com/Dev/trunk/gps@167044 936e1b1b-40f2-da11-902a-00137254ae57
2010-11-15 15:51:10 +00:00
Emmanuel Briot
5ed6316a31 (GNATCOLL.Scripts): now generates new-style classes in python
JB15-010

git-svn-id: svn+ssh://svn.eu.adacore.com/Dev/trunk/gps@167037 936e1b1b-40f2-da11-902a-00137254ae57
2010-11-15 14:56:33 +00:00
Emmanuel Briot
2345857846 Change parameter types to make it easier to subclass the type
Scripts_Repository_Record
JB12-017

git-svn-id: svn+ssh://svn.eu.adacore.com/Dev/trunk/gps@166971 936e1b1b-40f2-da11-902a-00137254ae57
2010-11-12 11:54:55 +00:00
Nicolas Setton
abf012ab4b * gps.texi:
Add documentation for GPS_PYTHONHOME.

* gnatcoll-python.adb:
(Py_SetPythonHome): New binding.

* gnatcoll-python.ads:
(Py_SetPythonHome): Declare.

* gnatcoll-scripts-python.adb:
(Register_Python_Scripting): New parameters Program_Name and Python_Home.

* gnatcoll-scripts-python.ads:
(Register_Python_Scripting): New parameters Program_Name and Python_Home,
 allowing finer control on the initialization of the Python interpreter.

* gps-main.adb:
(Init_Settings): Do not modify PYTHONHOME.
(Finish_Setup): Likewise.

* python_module.adb:
(Register_Module): Set the Python home explicitely, either to the directory
 pointed to by GPS_PYTHONHOME if it is set, or to the install dir.

For JA20-017.




git-svn-id: svn+ssh://svn.eu.adacore.com/Dev/trunk/gps@166155 936e1b1b-40f2-da11-902a-00137254ae57
2010-10-20 14:58:09 +00:00
Romain Berrendonner
fc0c5d7ab9 Fix the header:
adding the exception in the license part.
 setting the name to "G N A T C O L L"
Part of J614-016.


git-svn-id: svn+ssh://svn.eu.adacore.com/Dev/trunk/gps@165719 936e1b1b-40f2-da11-902a-00137254ae57
2010-10-12 13:40:03 +00:00
Nicolas Setton
0d4cbf6290 Rename package GNATCOLL.Command_Lines to GNATCOLL.Arg_Lists and type
Command_Line to Arg_List.
For IB19-006.




git-svn-id: svn+ssh://svn.eu.adacore.com/Dev/trunk/gps@152729 936e1b1b-40f2-da11-902a-00137254ae57
2009-11-23 17:31:43 +00:00
Nicolas Setton
753e0e0ffa * aliases_module.adb:
(Execute): Adapt to new profile of Execute_GPS_Shell_Command.

* build_command_manager.adb:
Start replacing command line handling with use of GNATCOLL.Command_Line.

* builder_module.adb:
Do not use a GNAT.OS_Lib.Argument_List to represent a command line.

* commands-builder.adb:
(Launch_Build_Command): Use type GNATCOLL.Command_Lines.Command_Line.

* commands-builder.ads:
(Launch_Build_Command): Use type GNATCOLL.Command_Lines.Command_Line.

* code_peer-module-bridge.adb:
(Add_Audit_Record): Adapt to new profile of Launch_Process.
(Inspection): Ditto.
(Review_Message): Ditto.

* code_peer-shell_commands.adb:
(Build_Target): Adapt to new profile of Execute_GPS_Shell_Command.
(Build_Target_Execute): Ditto.
(Get_Build_Mode): Ditto.
(Set_Build_Mode): Ditto.

* codefix_module.adb:
(Compilation_Finished_Cb): Adapt to new profile of Execute_GPS_Shell_Command.

* custom_module.adb:
(Parse_Entry_Node): Adapt to new profile of Execute_GPS_Shell_Command.

* expect_interface.adb:
 (Interactive_Expect): Adapt to new profile of Spawn.
(Custom_Spawn_Handler): Likewise.

* xml_viewer.adb:
(On_Click): Adapt to new profile of Execute_GPS_Shell_Command.

* gnatcoll-command_lines.adb:
Initial revision.

* gnatcoll-command_lines.ads:
Initial revision.

* gnatcoll-scripts-shell.ads:
(Initialize): Remove parameter Arguments_Count, no longer needed.
(Command_Line_Treatment): Declare.
(Execute_Command): Adapt to new profile of parent.
(Execute_Command_With_Args): Likewise.
(Set_Nth_Arg): Likewise.

* gnatcoll-scripts-utils.ads:
Add ??? comment.

* gnatcoll-scripts.adb:
(Command_Line_Treatment): Declare.
(Set_Nth_Arg): Adapt to new parameters of parent.
(Execute_Command): Likewise.
(Execute_Command_With_Args): Likewise.


* gnatcoll-scripts.ads:
(Command_Line_Treatment): Add new subprogram, which enables scripts to specify
 how they would like their command line to be handled.
(Set_Nth_Arg): Adapt to new parameters of parent.
(Execute_Command): Likewise.
(Execute_Command_With_Args): Likewise.

* gnatcoll-scripts-python-gtkada.adb:
(Init_PyGtk_Support): Adapt to new profile of Execute_Command.

* gnatcoll-scripts-python.adb:
(Command_Line_Treatment): Implement.
(Set_Nth_Arg): Adapt to profile of parent.
(Execute_Command): Ditto.
(Execute_File): Adapt to new profile of Execute_Command.

* gnatcoll-scripts-python.ads:
(Command_Line_Treatment): Declare.
(Execute_Command, Set_Nth_Arg): Adjust to new profiles of abstract parent.

* gps-main.adb:
(Execute_Batch): Adapt to new profile of Execute_Command.

* debugger.adb:
(General_Spawn): Adapt to new profile of Spawn.

* debugger.ads:
Add ??? comment.

* gvd-proc_utils.adb:
(Open_Processes): Adapt to new profile of Spawn.

* gvd-source_editor-gps.adb:
(Highlight_Current_Line): Adapt to new profile of Execute_GPS_Shell_Command.
(Unhighlight_Current_Line): Ditto.
(Initialize): Ditto.
(Free_Debug_Info): Ditto.

* help_module.adb:
(On_Load_HTML): Adapt to new profile of Execute_Command.

* commands-custom.adb:
Rewrite handling of command line. Use type GNATCOLL.Command_Lines.Command_Line.

* gps-kernel-macros.adb:
(Substitute): No need to protect paths.

* gps-kernel-remote.adb:
(Spawn): Use type Command_Line rather than GNAT.OS_Lib.Argument_List to
 represent command lines.


* gps-kernel-remote.ads:
(Spawn): Use type Command_Line rather than GNAT.OS_Lib.Argument_List to
 represent command lines.

* gps-kernel-scripts.adb:
(Execute_GPS_Shell_Command): Remove versions based on String + GNAT.OS_Lib.
 Argument_List. Replace all by use of type Command_Line.
(Set_Nth_Arg): Adjust mode of Callback_Data.

* gps-kernel-scripts.ads:
(Execute_GPS_Shell_Command): Remove versions based on String + GNAT.OS_Lib.
 Argument_List. Replace all by use of type Command_Line.
(Set_Nth_Arg): Adjust mode of Callback_Data.

* gps-kernel-timeout.adb:
(Free): No longer need to free Args.
(Execute): Ditto. Adapt to new profile for Spawn.
(Launch_Process): Use type Command_Line to represent a command line.

* gps-kernel-timeout.ads:
(Launch_Process): Use type GNATCOLL.Command_Lines.Command_Line to represent a
 command line.

* gps-kernel.adb:
(Filter_Matches_Primitive): Adapt to new profile of Execute_Command.

* navigation_module.adb:
(Go_To): Adapt to new profile of Execute_Command.

* project_properties.adb:
(For_Each_Item_In_List): Adapt to new profile of Execute_Command.

* python_module.adb:
(Load_Dir): Adapt to new profile of Execute_Command.

* remote-rsync.adb:
(On_Rsync_Hook): Adapt to new profile of Launch_Process.

* clearcase.xml:
Conform to the command line API design: parameters such as "$2-" and "$*" need
 to not be surrounded by quotes, so that they expand into multiple arguments.

* cvs.xml:
Conform to the command line API design: parameters such as "$2-" and "$*" need
 to not be surrounded by quotes, so that they expand into multiple arguments.

* gnatpp.xml:
Remove unneeded triple quoting.

* subversion.xml:
Conform to the command line API design: parameters such as "$2-" and "$*" need
 to not be surrounded by quotes, so that they expand into multiple arguments.

* shell_script.adb:
(Module_Command_Handler): Adapt to new profile of Execute_GPS_Shell_Command.
(Create): No longer need to take into account Arguments_Count.
 Add ??? comment.

* commands-socket.adb:
(Execute): Adapt to new profile of Execute_GPS_Shell_Command.

* casing_exceptions.adb:
(Set_Casing): Adapt to new profile of Execute_GPS_Shell_Command.

* src_editor_buffer.adb:
(Edition_Timeout): Adapt to new profile of Execute_GPS_Shell_Command.

* src_editor_module.adb:
(On_Print): Adapt to new profile of Execute_GPS_Shell_Command.

* log_utils.adb:
(Get_ChangeLog_From_File): Adapt to new profile of Execute_GPS_Shell_Command.

* vcs-generic_vcs.adb:
(Parse_Annotations): Adapt to new profile of Execute_GPS_Shell_Command.

* vcs_activities_view_api.adb:
(Execute): Adapt to new profile of Execute_GPS_Shell_Command.

* vcs_view_api.adb:
(Get_Location): Adapt to new profile of Execute_GPS_Shell_Command.
(On_Menu_Edit_ChangeLog): Ditto.
(On_Menu_View_Log_Rev): Ditto.
(Comparison): Ditto.

* vdiff2_command_block.adb:
(Close_Difference): Adapt to new profile of Execute_GPS_Shell_Command.

* vdiff2_module-callback.adb:
(Setup_Ref): Adapt to new profile of Execute_GPS_Shell_Command.

* vdiff2_module-utils-shell_command.adb:
(Add_Line Adapt to new profile of Execute_GPS_Shell_Command.
(Edit, Synchronize_Scrolling, Get_Chars, Get_File_Last_Line,
Get_Line_Number, Highlight_Line, Highlight_Range, Register_Highlighting,
Remove_Blank_Lines, Replace_Text, Unhighlight, Unhighlight_Range): Ditto.

* vdiff2_module-utils.adb:
(Is_Ref_Editor_Opened): Adapt to new profile of Execute_GPS_Shell_Command.

* clipboard_views.adb:
(Button_Press): Adapt to new profile of Execute_GPS_Shell_Command.

* interactive_consoles.adb:
(Default_Command_Handler): Adapt to new profile of Execute_Command.

Change the way GPS handles command lines. Introduce a new type
 (GNATCOLL.Command_Lines.Command_Line) and use it in most areas where we
 manipulate command lines.

For H926-007.




git-svn-id: svn+ssh://svn.eu.adacore.com/Dev/trunk/gps@152411 936e1b1b-40f2-da11-902a-00137254ae57
2009-11-17 17:51:13 +00:00
Nicolas Setton
cda1059953 * build_command_manager.adb:
(Execute): The hook for Compute_Build_Targets_Hook now returns an Any_Type.


* builder_facility_module.adb:
(On_Compute_Build_Targets): This now returns an Any_Type. The structure of this
 Any_Type is described in shell_commands.xml.
(Install_Button_For_Target): The hook for Compute_Build_Targets_Hook now
 returns an Any_Type, adapt.
(Add_Menu_For_Target): Likewise.

* gnatcoll-any_types.adb:
Initial revision.

* gnatcoll-any_types.ads:
Initial revision.

* gnatcoll-scripts-shell.adb:
Implement overriding subprogram Execute [Any_Type].

* gnatcoll-scripts-shell.ads:
Declare overriding subprogram Execute [Any_Type].

* gnatcoll-scripts.ads:
(Execute): New abstract subprogram, returning an Any_Type.

* gnatcoll-any_types-python.adb:
Initial revision.

* gnatcoll-any_types-python.ads:
Initial revision.

* gnatcoll-scripts-python.adb:
(Execute): Declare overriding subprogram. Implement.
(Execute_Command): New subprogram.

* gnatcoll-scripts-python.ads:
(Execute_Command): New subprogram.

* gps-kernel-hooks.adb:
(Command_Handler_Return_Any): New subprogram.
(Wrapper_Return_Any): New type.
(Execute): Implement wrappers.
(Destroy): Implement.
(Run_Hook_Until_Not_Empty): New subprogram.
(Register_Standard_Hooks): The hook Compute_Build_Targets_Hook now returns an
 Any_Type.

* gps-kernel-hooks.ads:
Add functions allowing to launch hooks that return Any_Types.
Add documentation.

* Makefile.py:
Adapt to new return types of compute_build_targets hook.

* shell_commands.xml:
Document new return type of compute_build_targets hook.

Follow-up on I302-024.

We want to display the base names of "main" targets in the Build menu, and we
 also want the hook to contain the full path to the main file in order to
 support "%TT".

We cannot do a simple "base_name" on the target when it comes to adding it to
 the menu, because this suppresses useful information coming from targets from
 Makefile.py.

To solve this, the hook "compute_build_targets" now returns a list of targets,
 with, for each target, the name to display in the menu, and the full name.

In order to implement this, we introduce a way for hooks to return complex
 information, mapping a subset of the Python types.




git-svn-id: svn+ssh://svn.eu.adacore.com/Dev/trunk/gps@143141 936e1b1b-40f2-da11-902a-00137254ae57
2009-04-22 13:16:40 +00:00
Emmanuel Briot
0ff4e20e3a Renamed gnatlib => gnatcoll (H411-006)
Renamed GNAT.* packages into GNATCOLL.*
Fixed headers in gnatlib, so that they reference "G N A T C O L L", rather
 than the misc. names we have before.
Update copyright dates


git-svn-id: svn+ssh://svn.eu/Dev/trunk/gps@124025 936e1b1b-40f2-da11-902a-00137254ae57
2008-04-17 12:12:00 +00:00