Using a macro to execute "Project update" and "Make" in sequence

I've been trying to come up with a way to execute "Project update" and "Make" right after each other (so I can just go grab a coffee, and when I come back everything is up to date and already compiled :)). I recorded these actions into a macro, but it doesn't work, because the "Make" doesn't wait for the "Project update" to finish.

In macros.xml, I have this:
<?xml version="1.0" encoding="UTF-8"?>
<application>
  <component name="ActionMacroManager">
    <macro name="FullUpdate">
      <action id="Vcs.UpdateProject" />
      <action id="CompileDirty" />
    </macro>
  </component>
</application>

Is there a way to configure the macro so that "CompileDirty" can wait for "Vcs.UpdateProject" to finish?

If that's not possible, can anyone perhaps think of a workaround, f.i. by inserting another action in between that would block until Vcs.UpdateProject is finished? E.g. a VcsRefresh or something like that?

0
5 comments

You can configure version control update to run in foreground instead of background in Settings | Version Control | Background, in this case Make should not be invoked until Update finishes.

0

Unfortunately, that doesn't help. The update happens in the foreground, but I can see "make" running at the same time (during the update, the notifications of make are already appearing in the status bar (synchronizing output directory, parsing, writing,  ...)).

This is on IJ 10.0.3.

Any other suggestions?

0

Try to disable background compilation in Settings | Compiler.

0

Serge, thanks for the ideas, but it still doesn't work. Both "VCS update" and "compile" are set to run in the foreground (and I've upgraded to 10.5.2). They do wait on each other, but for some reason, "Make" always runs first.

If the macro is:

    <macro name="FullUpdate">
      <action id="Vcs.UpdateProject" />
      <action id="CompileDirty" />
    </macro>

then Make runs first, followed by a project update.

But if I reverse the order in the macro, "Make" still runs first.

Is there maybe some (dummy) action that I can insert between the two, to force "Make" to wait?

0

Please sign in to leave a comment.