Is there a way to use a variable to set the Project Name?

I occassionally develop in two different branches of the same code base.  For example, "Hot Fixes" and "New Development".  I have the .name file checked into source control (and all of the other.x files for the directory based project)  This means that the name that shows up in my Windows Task bar is the same for both instances of IDEA, which is kind of annoying.

I was wondering if there was a way to use some logic with the $PROJECT_DIR$ to pull out the branch name from the directory structure.  For example, if my directory structure was 'C:/development/HotFix', then I could something with that information to set the project name.

Thanks for your help and/or suggestions.

2 comments
Comment actions Permalink

To my knowledge, there is not a way to use a variable. You may want to open up a feature request for such.  In the meantime, could you possibly make it part of you branching process to update the .name file so it's value includes the branch name? I know this is not ideal, but it is a viable workaround.

Also, note that if you delete the .name file, the project name defaults to the directory name. So if your .idea directory is inside the C:/development/HotFix directory you reference, the project name would show as "HotFix". Of course the downside there is you do not know which effort/product it is a hotfix for. Not an issue if you primarily work on one application/product. Or only have IDEA projects for one application/product open at a time. But obviously it is a hassle if you switch between master projects through the course of the day.

0
Comment actions Permalink

Thanks that worked for me!  I had to reconfigure some stuff, so I think I'll put in a feature request also, but this definitely improved things for me.

0

Please sign in to leave a comment.