Alec the Geek

mobile version http://alecthegeek.mofuse.mobi/

Archive for June, 2004

A useful Build setup scripts

Posted by Alec on 30 June 2004

NB NOT tested on current versions of Serena Dimensions

Given a list of Build projects, setup projects and build areas. Assumes a naming convention. Need to set the variables buildServer, projectList, buildRoot before running.

importPackage(Packages.com.merant.dimensions.objects);
importPackage(Packages.com.merant.dimensions.collections);
var db=BaseDatabase.getInstance();
db.login("dmtool","dmtool","intermediate","localhost","DIM9");

load("buildProjectsLibrary.js");
//source("buildProjectsLibrary.js");

//
// Find a project. Assumes all project names are unique
//
function findProject(projectName) {
    var projects = BaseDatabase.instance.projects

    var id;
    var project;

    // loop over  project identifiers
    for (var it = projects.iterator(); it.hasNext(); ) {
        // get next  project id
        id = it.next()

        // fetch corresponding Project object
        project = projects.get(id)

       	if (project.name == projectName)
		return project;
    }
    return null;
}

//
// find a build stages registered in the base database. Assumes all stage names are unique
//
function findBuildStage(name) {
    var buildStages = BaseDatabase.instance.buildStages

    var id;
    var buildStage;

    // loop over build stage identifiers
    for (var it = buildStages.iterator(); it.hasNext(); ) {
        // get next build stage id
        id = it.next()

        // fetch corresponding BuildStage object
        buildStage = buildStages.get(id)

	if (buildStage.name == name)
		return buildStage;
    }
    return null;
}
//
// find a build area defined for a project
//
function findBuildAreasAssignedToProject(project,areaName){
    var buildAreas = project.buildAreas

    var id
    var buildArea
    // loop over project objects
    for(var it = buildAreas.iterator(); it.hasNext(); ) {
        // get next build area identifier
        id = it.next()

        // get next buildarea object
        buildArea = buildAreas.get(id)

	if (buildArea.name == areaName)
		return buildArea;
    }
    return null;
}

var buildStageNames=new Array();
  buildStageNames["UT"]="UNIT TEST";
  buildStageNames["ST"]="SYSTEM TEST";
  buildStageNames["REL"]="RELEASE";
  buildStageNames["ER"]="EMERGENCY";

var buildServer = "aus-alecc-mel";
var projectList=new Array("BINGO");
var buildRoot = "c:Builds\";

for (var p in projectList ){
	var cp = findProject(projectList[p]+"1.0");
	if (cp)
		print("Error: Project "+projectList[p]+"1.0  already defined!");
	else
	{
		BaseDatabase.instance.runCommand("DPROJ "+projectList[p]+"1.0 /BUILD_PROJECT="+projectList[p]+" /DESC=\"" +projectList[p]+ " example build\"");
		BaseDatabase.instance.projects.refresh();
		cp = findProject(projectList[p]+"1.0");
		for (var s in buildStageNames){
			var cbs = findBuildStage(buildStageNames[s]);
			if (cbs)
				if (! findBuildAreasAssignedToProject(cp,cp.name +"_"+s))
					createBuildArea(cp, cbs, cp.name +"_"+s, buildServer, buildRoot+cp.name+"\"+s,"Java","","");
				else
					print("Build stage "+cp.name +"_"+s+" already defined");
			else
				print("Error: Build stage "+s+" not found!");
		}
	}
}

Posted in Serena Dimensions, Software Configuration Management | Leave a Comment »

Bah! Humbug

Posted by Alec on 28 June 2004

At the risk of sounding like a 70 year old COBOL programmer I just want to say the GUI based tools are an abomination. Too much goes on you can’t see!

Posted in Uncategorized | Leave a Comment »

My New Book

Posted by Alec on 28 June 2004

Started reading “Enterprise Java Beans “ only to discover that the fourth edition is due for release this month :-( . Books are expensive in Australia, this one was A$130, and it’s already out of date …. It was still worth getting though, very useful.

Posted in Software Development | Leave a Comment »

Why would you do that?

Posted by Alec on 28 June 2004

Well Sun have been asking people to port other languages to the Java runtime. I’m not sure Mainsoft, Visual MainWin for the J2EE platform is what they had in mind :-) .

Posted in Software Development | Leave a Comment »

J2EE is a big beast!

Posted by Alec on 23 June 2004

OK — Trying to pick up on ear’s and war’s, deployment descripters, how to generate stubs and skeletons and I need to do it quickly. So I downloaded the Sun J2EE SDK for starters, including the docs. Now I have a lot of reading to do :-( .

Posted in Software Development | Leave a Comment »

Why IDE’s really suck

Posted by Alec on 17 June 2004

Running IDE Projects

I have always been less than enthusiastic about using integrated development environments (IDEs). I saw them as very specific applications that:

  1. Hide too much necessary detail from the developer and deny the level of control and understanding often required in anything other than toy systems development
  2. Encouraging sloppy programming practice because too much just happened under the hood

Recently however I have started using Eclipse for occasional work (I can use it for Java, C++ and Perl) and I have been working with a customer who uses Borland JBuilder. I can see some virtue in such tools, indeed for todays complex environments (i.e. .NET and J2EE) they would appaer to be essential. However pitfalls still lurk to trap the unwary. Here are my some observations:

  1. Development teams that use IDE’s need a common
    1. IDE standard operating environment (SOE) that documents:
      1. Which IDE’s will be supported
      2. How such tools will be set up in a consistent fashion. This
        affects such things as

        1. Names and locations
        2. Hierarchy of settings (projects vs. user vs. installation)
    2. Project library management standards e.g.
      1. A consistent CLASSPATH in Java that is used by all developers
      2. Link edit options in other languages
  2. Software Configuration Management (SCM) approach
    1. Needs a common directory set and file naming
    2. Re-factoring needs to be addressed (how does one manage re-factoring in an environment with enforced changed control?)
    3. Should IDE specific files (e.g. project files) be placed under SCM control?
    4. Specific for Serena Dimensions configuration management tool
      1. One workset per IDE project
      2. IDE Project directory to included in workset directory structure
    5. A documented approach for the management of shared code and libraries across multiple projects. Who is responsible for
      1. Identifying change
      2. Implementing changes
      3. Accepting and migrating changes into projects
  3. Building software for test and release environments
    1. Software build must be done via a scripting process.
      1. Some IDE’s support this (e.g. JBuilder uses the -build
        switch).
      2. Others will required the creation of Ant, make scripts or the use of similar tools.
      3. Some IDE’s will assist the in the generation of the make or Ant script
    2. Builds must be done on configuration managed environment, not on developers PCs.

    Updated 4/Feb/07

Of course some of these issues need to be addressed even wothout and IDE. However in my experience and IDE makes a lot of assumptions and without making some explicit descisions it is easy to get caught.

Posted in Software Development | 2 Comments »

XML Editors

Posted by Alec on 17 June 2004

The free (as in beer) XML editor from XMLMind is jolly useful for editing Openmake TGT files.

Posted in Uncategorized | Leave a Comment »

Top Tip for Dimensions Build 8

Posted by Alec on 17 June 2004

Dimensions Build 8.0.2: How to rename a build project

1) Rename the Build project in Build web client
2) Edit the TGT and globally replace the old name with the new name
3) Create a new build project in Dimensions
4) Move the Build sub project

In the next release I am told this will easier (no need to edit the TGT files)

Posted in Software Configuration Management | Leave a Comment »

Dark Humour

Posted by Alec on 17 June 2004

A South African man is found guilty of hacking to death an interior designer who was unimpressed with his home. [BBC World News]

If you ignore the fact that someone tragically died, this is bloody funny!

Posted in Uncategorized | Leave a Comment »

Using Personal configuration management

Posted by Alec on 16 June 2004


Starter: David Baird
Body: … I was involved in a discussion with someone preparing a presentation on CVS, Subversion and Arch for an audience of freelance software developers. He is focusing on version control for personal use, not in a commercial product environment.I think it is interesting that someone would want to use SCM tools for their own private projects. Perhaps it is indicative of the local culture where I live.
[CM Crossroads - General CM]

Not really — any software developer with mileage under his belt should do this. Otherwise when we make stupid mistakes as 3am (or 3pm in my case) all is not lost.

I recently has to develop some Perl scripts for the kid’s school and I used CVS on my laptop, with the repository in the root of my development tree. And the rational for this (even though I have access to some pretty sophisticated CM tools)?

  • I could hand my CVS archive to anyone and they can get at the contents using a free tool on *NIX or Windows.
  • When I backed up my development directory then my version archive was included in the backup

I guess what I want to say is that anyone, who professes to be a software professional, who does not use a basic version tool on their private projects is a charlatan in my humble opinion

Posted in Software Configuration Management | 2 Comments »

108667404792215038

Posted by Alec on 8 June 2004

TheyWorkForYou.com: Is your MP working for you in Parliament?

Wow! Now this could empower democracy — worth a look

Posted in Uncategorized | Leave a Comment »

Looking over your MP’s shoulder

Posted by Alec on 8 June 2004

TheyWorkForYou.com: Is your MP working for you in Parliament?

Wow! Now this could empower democracy — worth a look

Posted in Personal Opinion | Leave a Comment »