Commit 9578d0d4ab06b3bdf832b9e97a35655ff6cca646
1 parent
72bc2a40
[+] introduce the version number to be able to regenerate database if only hayam…
…iki generator version change [+] the generation date and time and HK generator version are stored into the hayamiki.ini
Showing
3 changed files
with
32 additions
and
3 deletions
Show diff stats
hayamiki_generator.1.19.aproj
| @@ -430,6 +430,8 @@ | @@ -430,6 +430,8 @@ | ||
| 430 | <Compile Include="library\widgets4\window_test.anubis" /> | 430 | <Compile Include="library\widgets4\window_test.anubis" /> |
| 431 | <Compile Include="library\xml\basic_xml_parser.anubis" /> | 431 | <Compile Include="library\xml\basic_xml_parser.anubis" /> |
| 432 | <Compile Include="library\xml\xml_parser.apg.anubis" /> | 432 | <Compile Include="library\xml\xml_parser.apg.anubis" /> |
| 433 | + <Compile Include="src\app\app_loggers.anubis" /> | ||
| 434 | + <Compile Include="src\app\app_version.anubis" /> | ||
| 433 | <Compile Include="src\check.anubis" /> | 435 | <Compile Include="src\check.anubis" /> |
| 434 | <Compile Include="src\generation\choices_selector.anubis" /> | 436 | <Compile Include="src\generation\choices_selector.anubis" /> |
| 435 | <Compile Include="src\generation\columns.anubis" /> | 437 | <Compile Include="src\generation\columns.anubis" /> |
| 1 | +/* | ||
| 2 | + * Created by PyramIDE. | ||
| 3 | + * User: フランスのトトロ aka (David RENÉ) | ||
| 4 | + * Date: 22/08/2022 | ||
| 5 | + * Time: 08:58 | ||
| 6 | + * © David RENÉ | ||
| 7 | + */ | ||
| 8 | + | ||
| 9 | +read tools/basis.anubis | ||
| 10 | +read system/string.anubis | ||
| 11 | + | ||
| 12 | +public define Int major = 1. | ||
| 13 | +public define Int minor = 19. | ||
| 14 | +public define Int release = 3. | ||
| 15 | +public define Int build = 0. | ||
| 16 | +public define String status = "". | ||
| 17 | + | ||
| 18 | +public define String product_version = major+"."+minor+"."+release+"."+build+" "+status. | ||
| 19 | +public define String product_numerical_version = major+"."+minor+"."+release+"."+build. |
src/generation/files.anubis
| @@ -16,6 +16,9 @@ read hayamiki_lib/hk_generator.anubis | @@ -16,6 +16,9 @@ read hayamiki_lib/hk_generator.anubis | ||
| 16 | read tools/basis.anubis | 16 | read tools/basis.anubis |
| 17 | read tools/streams.anubis | 17 | read tools/streams.anubis |
| 18 | read tools/ISO-8601.anubis | 18 | read tools/ISO-8601.anubis |
| 19 | + | ||
| 20 | +read app/app_version.anubis | ||
| 21 | + | ||
| 19 | read generation/header.anubis | 22 | read generation/header.anubis |
| 20 | read generation/types.anubis | 23 | read generation/types.anubis |
| 21 | read generation/densaku.anubis | 24 | read generation/densaku.anubis |
| @@ -264,11 +267,14 @@ define Maybe(One) | @@ -264,11 +267,14 @@ define Maybe(One) | ||
| 264 | with db_SHA1 = readString(ini, "DB_MODEL", "SHA1", "N/A"), | 267 | with db_SHA1 = readString(ini, "DB_MODEL", "SHA1", "N/A"), |
| 265 | with version = readString(ini, "DB_MODEL", "Version", "0.0.0.0"), | 268 | with version = readString(ini, "DB_MODEL", "Version", "0.0.0.0"), |
| 266 | with app_name= readString(ini, "DB_MODEL", "app_name", ""), | 269 | with app_name= readString(ini, "DB_MODEL", "app_name", ""), |
| 270 | + with engine = readString(ini, "DB_MODEL", "engine", "sqlite3"), | ||
| 271 | + with hkg_version = readString(ini, "HK_GENERATOR", "Generator_version", ""), | ||
| 272 | + | ||
| 267 | println("Saved DB model SHA1 = "+db_SHA1); | 273 | println("Saved DB model SHA1 = "+db_SHA1); |
| 268 | - with current_db_SHA1 = to_ascii(sha1(serialize(db))), | 274 | + with current_db_SHA1 = to_ascii(sha1(serialize(db)+to_byte_array(version))), |
| 269 | println("Current DB model SHA1 = "+current_db_SHA1); | 275 | println("Current DB model SHA1 = "+current_db_SHA1); |
| 270 | 276 | ||
| 271 | - if db_SHA1 = current_db_SHA1 then | 277 | + if db_SHA1 = current_db_SHA1 & hkg_version = product_numerical_version then |
| 272 | success(println("Model already generated, nothing to do")) | 278 | success(println("Model already generated, nothing to do")) |
| 273 | else if check_database(db) is | 279 | else if check_database(db) is |
| 274 | { | 280 | { |
| @@ -285,7 +291,9 @@ define Maybe(One) | @@ -285,7 +291,9 @@ define Maybe(One) | ||
| 285 | if generate_hk_menus(apps, destination_dir) is failure then println("failure");failure else | 291 | if generate_hk_menus(apps, destination_dir) is failure then println("failure");failure else |
| 286 | if generate_cxm_lib_menus(apps, destination_dir) is failure then println("failure");failure else | 292 | if generate_cxm_lib_menus(apps, destination_dir) is failure then println("failure");failure else |
| 287 | writeString(ini, "DB_MODEL", "SHA1", current_db_SHA1); | 293 | writeString(ini, "DB_MODEL", "SHA1", current_db_SHA1); |
| 288 | - writeString(ini, "DB_MODEL", "Version", version); | 294 | + writeString(ini, "DB_MODEL", "Version", version); |
| 295 | + writeString(ini, "HK_GENERATOR", "Generator_version", product_numerical_version); | ||
| 296 | + writeString(ini, "HK_GENERATOR", "generation_datetime",_Int_to_ISO_8601_datetime(now)); | ||
| 289 | writeIniInfo(ini); | 297 | writeIniInfo(ini); |
| 290 | sleep(3000); | 298 | sleep(3000); |
| 291 | success(unique) | 299 | success(unique) |