Skip to content

Commit db24634

Browse files
Add scenario variables' support for Alire projects
For eng/ide/gnatstudio#129
1 parent 8b24256 commit db24634

File tree

1 file changed

+19
-27
lines changed

1 file changed

+19
-27
lines changed

share/support/core/alire.py

Lines changed: 19 additions & 27 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
"""
@@ -320,8 +305,15 @@ def on_compilation_finished(hook, category, target_name, mode_name, status, cmd)
320305
"Alire environment is now setup: project has been reloaded",
321306
importance=GPS.Message.Importance.INFORMATIONAL,
322307
)
308+
323309
update_aliases_for_alire_targets(is_alire_project=True)
324310
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+
325317
project_to_reload = None
326318

327319

0 commit comments

Comments
 (0)