Page 1 of 1

OXPs and version control

Posted: Mon May 16, 2011 4:26 pm
by Ramirez
This may be one for the Expansions Forum, however it's also Mac-specific so might be better here.

Does anyone out there use version control to help manage development of their OXPs? As my offerings seem to be getting more complex I thought it might be an idea to try putting them under some proper control so I can avoid losing track of things quite so often.

I've been using SVN in a limited capacity for some other minor stuff but I'm not quite sure how best to use it when it comes to OXPs. In particular, is it possible to place a checked-out package directly in the AddOns folder so that it can be modified, run and (if everything goes well) committed, or would it be necessary to hold a working copy somewhere else and transfer files between the two locations in order to commit back to a repository?

Any pointers would be gratefully received.

Re: OXPs and version control

Posted: Mon May 16, 2011 6:46 pm
by maik
I use SVN quite regularly for work purposes, but not for OXPs. Generally speaking, you can put any directory under version control, so there is no need to copy between locations. So if you want your work-in-progress OXP to be part of your Oolite add-ons you would put the .oxp folder and all its contents directly under version control.

It would probably be best to have two Oolite installations then: one where you work on your OXPs and a second one which contains a copy of the latest released version of your OXP so that you can easily verify reported bugs. In effect you would create a development environment (which is under version control and subject to frequent changes) and a test environment (which is kept stable).

Hope that helps.

Re: OXPs and version control

Posted: Mon May 16, 2011 9:14 pm
by JensAyton
I do. :-) There are three different test suite OXPs in the Oolite svn repository, plus the debug OXP. The test suites are simply OXPs checked into the repository, while the debug OXP uses a build system like “real” software.

For personal use, you’d probably be better off with a distributed version control system, like Mercurial or Git. These allow you to set up a repository in a folder without requiring a server. (If you’re using a separate server for svn you also get a backup as a side effect, but you can back up a repository like any other directory using normal backup software.)

OXPs in repositories can be put straight into the AddOns directory, and you can do commits and stuff there (I do this with the test suites). For svn, you can check out a subfolder within the repository, which is useful if your repository is a folder with the OXP and additional working files in it (for example, svn checkout svn://example.net/myoxp/myoxp.oxp). You can’t do this with Git, so you’d need to make the root of the repository the OXP. I suspect other DCVSes have the same limitation.

To publish an OXP from svn, use the svn export command to make a copy without the hidden .svn directories. Git and, I believe, all the other “modern” systems use a single hidden folder in the root of the repository, so you can just copy the OXP contents out.

Re: OXPs and version control

Posted: Tue May 17, 2011 5:40 pm
by Ramirez
Thanks Ahruman, that's just the kind of info I was after. Will give it a go and see how I get on.