Remove all library build artifacts.
()
| 485 | |
| 486 | |
| 487 | def clean_library() -> int: |
| 488 | """Remove all library build artifacts.""" |
| 489 | print("Cleaning library artifacts...") |
| 490 | |
| 491 | removed_count = 0 |
| 492 | |
| 493 | # Remove library file |
| 494 | if LIBRARY_OUTPUT.exists(): |
| 495 | LIBRARY_OUTPUT.unlink() |
| 496 | print(f" Removed: {LIBRARY_OUTPUT}") |
| 497 | removed_count += 1 |
| 498 | |
| 499 | # Remove metadata file |
| 500 | if LIBRARY_METADATA.exists(): |
| 501 | LIBRARY_METADATA.unlink() |
| 502 | print(f" Removed: {LIBRARY_METADATA}") |
| 503 | removed_count += 1 |
| 504 | |
| 505 | # Remove objects directory |
| 506 | if OBJECTS_DIR.exists(): |
| 507 | import shutil |
| 508 | |
| 509 | shutil.rmtree(OBJECTS_DIR) |
| 510 | print(f" Removed: {OBJECTS_DIR}") |
| 511 | removed_count += 1 |
| 512 | |
| 513 | # Remove deps directory |
| 514 | if DEPS_DIR.exists(): |
| 515 | import shutil |
| 516 | |
| 517 | shutil.rmtree(DEPS_DIR) |
| 518 | print(f" Removed: {DEPS_DIR}") |
| 519 | removed_count += 1 |
| 520 | |
| 521 | if removed_count == 0: |
| 522 | print(" No library artifacts found to clean") |
| 523 | else: |
| 524 | print(f"✓ Cleaned {removed_count} library artifact(s)") |
| 525 | |
| 526 | return 0 |
| 527 | |
| 528 | |
| 529 | def build_library( |