Sharing external tool config via version control

In my project I need to create some properties file using a script. To achieve this:

  1. I added the "script" as an external tool.


  2. In run/debug configuration specified the external tool inside "Before launch" tasks.


This led to creation of a configuration inside ".idea/runConfigurations" folder that I added to our version control system.

When someone checks out this change, although he gets the new "runConfiguration", it does not work because the "external tool" is not configured in their IDE.

How to add the "external tool" inside the version control?

In case there is some better way of achieving this instead of using external tool (may be by modifying the default "Make" task to incorporate the "script"), then please guide me.

Comment actions Permalink

External Tool configurations are set at the IDE level, and not the project level. So there is no way to share them via Version Control. This makes sense in most cases since external tools are usually very platform specific (i.e. you and I likely have our systems configured differently).

While there are some "hackish" ways you could probably handle this (via symlinks or junctions), if you just need to run a script, I would recommend using Ant (or even Gradle). Either have Ant do the actual work, or write a simple ant script that wraps and launches the external script (via the <exec> or <script> target for example). The script, the ant build, and its "Before Launch" configuration can then all be committed to version control.

Comment actions Permalink

Thanks for the suggestion.

My script was in python, so following your advice I created a python run/debug configuration and added that in the "Before launch" configuration of my original project.

I was easily able to share the python configuration too.

There's still a small issue here.

While creating python configuration, I had to specify the path to python SDK, which was stored by IDE inside the "runConfiguration".

Since different people have python stored at different locations, this file is unnecessarily getting modified, making it hard to share it.

Is there a way to set the sdk path using an environment variable?

I have attached the configuration file. "SDK_HOME" is the variable whose value I want to set using an environment variable.


Please sign in to leave a comment.