Skip to content

Commit 8ec0e37

Browse files
Merge branch 'topic/alire_integration' into 'master'
Alire: add support for scenario variables See merge request eng/ide/gnatstudio!484
2 parents 0781592 + db24634 commit 8ec0e37

File tree

3 files changed

+26
-32
lines changed

3 files changed

+26
-32
lines changed

builder/src/build_command_manager-end_of_build.adb

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -235,8 +235,7 @@ package body Build_Command_Manager.End_Of_Build is
235235
if Directory /= No_File then
236236
Build.Full.Dir := Directory;
237237
else
238-
Build.Full.Dir :=
239-
Builder.Kernel.Registry.Tree.Root_Project.Project_Path.Dir;
238+
Build.Full.Dir := GNATCOLL.VFS.Get_Current_Dir;
240239
end if;
241240
end if;
242241
end Local_Expand_Command_Line;

kernel/src/gps-kernel-remote.adb

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -824,7 +824,9 @@ package body GPS.Kernel.Remote is
824824
end if;
825825

826826
if Active (Me) then
827-
Trace (Me, "Spawning");
827+
Trace
828+
(Me,
829+
"Spawning in directory: " & Get_Current_Dir.Display_Full_Name);
828830

829831
if Args /= null then
830832
for J in Args'Range loop

share/support/core/alire.py

Lines changed: 22 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,11 @@
4747
<arg>--no-color</arg>
4848
<arg>--no-tty</arg>
4949
<arg>-q</arg>
50+
<arg>--</arg>
51+
<arg>%X</arg>
5052
</command-line>
5153
<iconname>gps-build-all-symbolic</iconname>
52-
<switches command="%(tool_name)s" columns="1" lines="1">
54+
<switches command="%(tool_name)s" columns="1" lines="1" sections="--">
5355
<title column="1" line="1" >Profiles</title>
5456
<radio
5557
line="1"
@@ -83,9 +85,11 @@
8385
<arg>--no-color</arg>
8486
<arg>--no-tty</arg>
8587
<arg>-q</arg>
88+
<arg>--</arg>
89+
<arg>%X</arg>
8690
</command-line>
8791
<iconname>gps-clean-symbolic</iconname>
88-
<switches command="%(tool_name)s" columns="2" lines="1">
92+
<switches command="%(tool_name)s" columns="2" lines="1" sections="--">
8993
<title column="1" line="1" >Options</title>
9094
<check label="Delete cache of releases" switch="--cache"
9195
tip="All downloaded dependencies will be deleted." />
@@ -103,31 +107,6 @@
103107
</output-parsers>
104108
</target-model>
105109
106-
<target-model name="Alire Run" category="">
107-
<description>Launch an executable built by the crate</description>
108-
<command-line>
109-
<arg>alr</arg>
110-
<arg>--non-interactive</arg>
111-
<arg>--no-color</arg>
112-
<arg>--no-tty</arg>
113-
<arg>-q</arg>
114-
</command-line>
115-
<iconname>gps-run-symbolic</iconname>
116-
<switches command="%(tool_name)s" columns="1" lines="1">
117-
<title column="1" line="1" >Options</title>
118-
<check label="Skip building step" switch="--skip-build"
119-
tip="Skip the building step before running the executable(s)." />
120-
</switches>
121-
<output-parsers>
122-
output_chopper
123-
utf8_converter
124-
progress_parser
125-
alire_parser
126-
console_writer
127-
end_of_build
128-
</output-parsers>
129-
</target-model>
130-
131110
<target model="Alire" category="Alire" name="Alire"
132111
messages_category="Alire">
133112
<in-toolbar>FALSE</in-toolbar>
@@ -169,6 +148,8 @@
169148
<arg>--no-tty</arg>
170149
<arg>-q</arg>
171150
<arg>build</arg>
151+
<arg>--</arg>
152+
<arg>%X</arg>
172153
</command-line>
173154
</target>
174155
@@ -187,6 +168,8 @@
187168
<arg>--no-tty</arg>
188169
<arg>-q</arg>
189170
<arg>build</arg>
171+
<arg>--</arg>
172+
<arg>%X</arg>
190173
</command-line>
191174
</target>
192175
@@ -204,6 +187,8 @@
204187
<arg>--no-tty</arg>
205188
<arg>-q</arg>
206189
<arg>clean</arg>
190+
<arg>--</arg>
191+
<arg>%X</arg>
207192
</command-line>
208193
</target>
209194
"""
@@ -284,7 +269,8 @@ def display_message(timeout):
284269
# Alire is being ran
285270
timeout = GPS.Timeout(100, display_message)
286271
timeout.counter = 0
287-
else:
272+
273+
elif not GPS.getenv("ALIRE"):
288274
# We are not loading an Alire project: unset the aliases
289275
# on Alire build targets.
290276
update_aliases_for_alire_targets(is_alire_project=False)
@@ -319,8 +305,15 @@ def on_compilation_finished(hook, category, target_name, mode_name, status, cmd)
319305
"Alire environment is now setup: project has been reloaded",
320306
importance=GPS.Message.Importance.INFORMATIONAL,
321307
)
308+
322309
update_aliases_for_alire_targets(is_alire_project=True)
323310
GPS.MDI.information_popup("Alire project is now setup", "vcs-up-to-date")
311+
312+
# Change GS's current directory to Alire project's root directory.
313+
GPS.Logger("ALIRE").log("Changing current directory to: %s" % root)
314+
GPS.cd(root)
315+
GPS.Logger("ALIRE").log("Current directory is now: %s" % GPS.pwd())
316+
324317
project_to_reload = None
325318

326319

@@ -352,7 +345,7 @@ def on_project_changing(hook, file):
352345
root = find_alire_root(file.path)
353346

354347
if root:
355-
GPS.Logger("ALIRE").log("Alire manifest detected!")
348+
GPS.Logger("ALIRE").log("Alire manifest detected at: %s" % file.path)
356349
project_to_reload = (file.path, root)
357350

358351

0 commit comments

Comments
 (0)