Simplifying the build process?

Main development forum.

Simplifying the build process?

Postby kimmov » Sat May 16, 2009 5:34 pm

While I have been moving PO files to different folder I've been once again faced by the problem of hard coded paths and various assumptions about different paths. And mix of scripts involved with some VS defines etc. I've realized from the beginning when all this infrastructure was added that it is fragile. But we also rarely need to touch to it. So it mostly works.

But what if we really tried to get rid of this mess and really improve the building system...

I'll first list some of the problems:
  • Mix of different script languages (python [my build script], batch files, windows script) each of these are run through the cmdline so the scripts don't really even communicate
  • hard-coded paths in scripts - when some path changes we need to update scripts (instead of config file?)
  • assumptions about folder structure in scripts (basically the same as above)
  • monolithic build from command line point of view, one cannot disable updating language files from command line. So my build script does some phases two times.

There are several improvements we can make:
  • use some existing build system (Ant, CMake, NAnt, MSbuild,...)
  • Use just one script language
  • break build into independent blocks
  • use config file instead of hard-coding

Using existing build system would reduce need for scripting. And at least we could use tasks in those frameworks for many things we now have scripted ourselves. But, we are C++/MFC/Windows app and there really aren't good solutions for such combination. Recent MSbuild (in .Net 3.5) gets near, but also requires new Windows version. And MSbuild tasks aren't so capable than Ant/NAnt tasks. NAnt would be very good, but it requires VS2008 for C++ task. Ant's Cpptaks is a bit challenging to use... So there isn't really one good solution and it would take lot of effort to get builds running.

But I very much want to unify our scripting. If we have one language in use we can call other scripts/functions from the script and many things will get simpler. Not least the maintenance of these scripts.

I've already used Python in many of my scripts so it is my own preference for future scripting. I've recently looked at IronPython which is Python running on the .Net framework. And it "only" requires .Net 2.0Sp1 which should be common enough today. Of course it requires loading small runtime, but it is way smaller than e.g. .Net 3.5.

Converting existing scripts to IronPython is some work, but the reward is also good - e.g. ability add some unit tests. And being able to switch data between scripts.

Hard-coded paths work fine if we don't change our folder structure. But when we do, it is quite detective work to find all the places to change. So I think simple INI file for building listing important paths and files would be easier to maintain. And allow people easier to do possible custom builds.
kimmov
 
Posts: 562
Joined: Thu Sep 11, 2008 8:51 pm
Location: Finland

Return to Developers

Who is online

Users browsing this forum: No registered users and 4 guests