MCPcopy Index your code
hub / github.com/aws/amazon-q-developer-cli / build

Function build

scripts/build.py:536–597  ·  view source on GitHub ↗
(
    release: bool,
    stage_name: str | None = None,
    run_lints: bool = True,
    run_test: bool = True,
)

Source from the content-addressed store, hash-verified

534
535
536def build(
537 release: bool,
538 stage_name: str | None = None,
539 run_lints: bool = True,
540 run_test: bool = True,
541):
542 BUILD_DIR.mkdir(exist_ok=True)
543
544 disable_signing = os.environ.get("DISABLE_SIGNING")
545
546 gpg_signer = load_gpg_signer() if not disable_signing and isLinux() else None
547 signing_role_arn = os.environ.get("SIGNING_ROLE_ARN")
548 signing_bucket_name = os.environ.get("SIGNING_BUCKET_NAME")
549 signing_apple_notarizing_secret_arn = os.environ.get("SIGNING_APPLE_NOTARIZING_SECRET_ARN")
550 if (
551 not disable_signing
552 and isDarwin()
553 and signing_role_arn
554 and signing_bucket_name
555 and signing_apple_notarizing_secret_arn
556 ):
557 signing_data = CdSigningData(
558 bucket_name=signing_bucket_name,
559 apple_notarizing_secret_arn=signing_apple_notarizing_secret_arn,
560 signing_role_arn=signing_role_arn,
561 )
562 else:
563 signing_data = None
564
565 match stage_name:
566 case "prod" | None:
567 info("Building for prod")
568 case "gamma":
569 info("Building for gamma")
570 case _:
571 raise ValueError(f"Unknown stage name: {stage_name}")
572
573 targets = rust_targets()
574
575 info(f"Release: {release}")
576 info(f"Targets: {targets}")
577 info(f"Signing app: {signing_data is not None or gpg_signer is not None}")
578
579 if run_test:
580 info("Running cargo tests")
581 run_cargo_tests()
582
583 if run_lints:
584 info("Running cargo clippy")
585 run_clippy()
586
587 info("Building", CHAT_PACKAGE_NAME)
588 chat_path = build_chat_bin(
589 release=release,
590 output_name=CHAT_BINARY_NAME,
591 targets=targets,
592 )
593

Callers 1

main.pyFile · 0.90

Calls 12

isLinuxFunction · 0.90
isDarwinFunction · 0.90
infoFunction · 0.90
rust_targetsFunction · 0.90
load_gpg_signerFunction · 0.85
CdSigningDataClass · 0.85
build_chat_binFunction · 0.85
build_macosFunction · 0.85
build_linuxFunction · 0.85
run_cargo_testsFunction · 0.70
run_clippyFunction · 0.70
getMethod · 0.45

Tested by

no test coverage detected