How do you keep a build number ?

By Metalion

Paragon (1343)

Аватар пользователя 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.

Thanks.

Для того, чтобы оставить комментарий, необходимо регистрация или !login

By Metalion

Paragon (1343)

Аватар пользователя Metalion

27-02-2021, 16:33

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

	module VERSION

major=0
minor=0
build:=0003
if build<9999
build:=build+1
endif

	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

By aoineko

Master (129)

Аватар пользователя 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