How do you keep a build number ?

Door Metalion

Paragon (1343)

afbeelding van Metalion

27-02-2021, 13:55

Hi everyone,

How do you keep a build number in your development ?

Of course, you can set it up manually inside your code, but that's quite annoying to change the number each time you compile your source. Is there an automatic way for that number to increase ? Specifically within a sjasm development environment, for example.


Aangemeld of registreer om reacties te plaatsen

Van Metalion

Paragon (1343)

afbeelding van Metalion

27-02-2021, 16:33

OK, I found a neat way to do it, using the 'update' instruction:

	module VERSION

if build<9999

	update "version.asm"
	code @ 2Ch
	byte "0"+build/1000,"0"+(build mod 1000)/100
	byte "0"+(build mod 100)/10,"0"+(build mod 10)

	endmodule VERSION

Van aoineko

Master (129)

afbeelding van aoineko

27-02-2021, 16:44

Personally, I don't keep the build number, but the revision number of my version-control repository (SVN, Git, etc.). The interest is to be able to associate a given build with all the modifications that was included into the build.
To do so, the build tool retrieves the revision number, writes it in a file included in the program source and then compiles the program.

If the 'update' instruction does what you need, that's fine. Smile