Cross project scripting?

How can i use one script file in two projects? So that if i change this file in one project, it should be changed in another as well.

Thanks in advance.

I’ve put a bit of thought into this as I have some scripts that need to be shared between projects. The setup is really going to depend how you handle source control and what platform you are on.

Option 1:
Your shared files belong to a root source control and you remap them into the project directories. When you check in your work and sync in the other project you will get and merge changes.

Option 2:
On windows development I sometimes use sync/linked folders. I like this shell extension tool, it adds a lot of support to do such things. http://schinagl.priv.at/nt/hardlinkshellext/hardlinkshellext.html You could specify your script folder that shared the file between two locations. By editing in one project it would manipulate the result seen in both locations.

Option 3:
Possibly a hybrid approach of 1 and 2 or go for an advanced source control branching structure that works for your team size. My main concerns with sharing files is that changes to one project should not impact the stability of another. If your source control is setup where the core is in a main line and each project branches the results then the projects can work independently and then reintegration back to the main line. Then the other project carefully pulls in these changes. This will probably work better for larger teams. If it is just you then maybe you are more comfortable option 2 because it becomes less integration maintenance work.

Whatever solution you decide I recommend the best one that is going to keep your shared file synchronized in a manor that you can “afford” to maintain. Don’t over do the branching source control if it is too much it becomes much much of a burden that you end up never keeping them synced. Where on the other hand also avoid deviating functionality systems too far that you fail to maintain stability in both projects.