diff --git a/Makefile b/Makefile index 5e4ac060..87d06a35 100644 --- a/Makefile +++ b/Makefile @@ -1,7 +1,66 @@ -.PHONY: doctor setup install-format-tools format-tools-status format format-check lint install-debug-cli uninstall-debug-cli debug-cli-status resolve build run test guardrails conductor-selftest release-selftest release-sync-cli-version release-preflight release-artifact install-local-production xcode xcode-open xcode-generate xcode-check xcode-validate xcode-generator-test xcode-clean dev-status dev-build dev-swift-build dev-run dev-test dev-test-list dev-provider-test dev-provider-test-list dev-smoke dev-smoke-launch dev-format dev-format-check dev-lint dev-format-tools-status dev-check-format-tools dev-install-format-tools dev-release-preflight dev-release-artifact dev-install-local-production dev-stop-app dev-daemon-stop clean +.PHONY: help doctor setup install-format-tools format-tools-status format format-check lint install-debug-cli uninstall-debug-cli debug-cli-status resolve build run test guardrails conductor-selftest release-selftest release-sync-cli-version release-preflight release-artifact install-local-production xcode xcode-open xcode-generate xcode-check xcode-validate xcode-generator-test xcode-clean dev-status dev-build dev-swift-build dev-run dev-test dev-test-list dev-provider-test dev-provider-test-list dev-smoke dev-smoke-launch dev-format dev-format-check dev-lint dev-format-tools-status dev-check-format-tools dev-install-format-tools dev-release-preflight dev-release-artifact dev-install-local-production dev-stop-app dev-daemon-stop clean PRODUCT ?= all +help: + @printf '%s\n' 'Usage: make ' + @printf '\n%s\n' 'Common targets:' + @printf ' %-30s %s\n' 'doctor' 'Verify local Swift/Xcode setup and diagnostics' + @printf ' %-30s %s\n' 'setup' 'Install format tools, run doctor, and resolve packages' + @printf ' %-30s %s\n' 'build' 'Build and package the debug app' + @printf ' %-30s %s\n' 'run' 'Build, package, and launch the debug app' + @printf ' %-30s %s\n' 'test' 'Run the Swift test suite' + @printf ' %-30s %s\n' 'guardrails' 'Run source layout and repository guardrails' + @printf ' %-30s %s\n' 'clean' 'Remove .build' + @printf '\n%s\n' 'Coordinated developer daemon targets:' + @printf ' %-30s %s\n' 'dev-status' 'Show conductor daemon status' + @printf ' %-30s %s\n' 'dev-build' 'Coordinated debug app package build' + @printf ' %-30s %s\n' 'dev-swift-build' 'Coordinated Swift build; override with PRODUCT=name' + @printf ' %-30s %s\n' 'dev-run' 'Coordinated debug app build and launch' + @printf ' %-30s %s\n' 'dev-test' 'Coordinated test run; override with FILTER=name' + @printf ' %-30s %s\n' 'dev-test-list' 'List XCTest methods through conductor' + @printf ' %-30s %s\n' 'dev-provider-test' 'Run provider package tests; override with FILTER=name' + @printf ' %-30s %s\n' 'dev-provider-test-list' 'List provider package tests' + @printf ' %-30s %s\n' 'dev-smoke' 'Run non-disruptive live debug app smoke checks' + @printf ' %-30s %s\n' 'dev-smoke-launch' 'Launch debug app, then run smoke checks' + @printf ' %-30s %s\n' 'dev-stop-app' 'Stop the coordinated debug app' + @printf ' %-30s %s\n' 'dev-daemon-stop' 'Stop the conductor daemon' + @printf '\n%s\n' 'Style targets:' + @printf ' %-30s %s\n' 'format' 'Format Swift files directly' + @printf ' %-30s %s\n' 'format-check' 'Check Swift formatting directly' + @printf ' %-30s %s\n' 'lint' 'Run direct format-check and SwiftLint' + @printf ' %-30s %s\n' 'dev-format' 'Coordinated Swift formatting' + @printf ' %-30s %s\n' 'dev-format-check' 'Coordinated Swift formatting check' + @printf ' %-30s %s\n' 'dev-lint' 'Coordinated format-check and SwiftLint' + @printf ' %-30s %s\n' 'install-format-tools' 'Install SwiftFormat and SwiftLint' + @printf ' %-30s %s\n' 'format-tools-status' 'Show direct format tool status' + @printf ' %-30s %s\n' 'dev-install-format-tools' 'Coordinated format tool install' + @printf ' %-30s %s\n' 'dev-format-tools-status' 'Show coordinated format tool status' + @printf ' %-30s %s\n' 'dev-check-format-tools' 'Check coordinated format tool availability' + @printf '\n%s\n' 'Debug CLI targets:' + @printf ' %-30s %s\n' 'install-debug-cli' 'Build and install the CE debug CLI' + @printf ' %-30s %s\n' 'uninstall-debug-cli' 'Uninstall the CE debug CLI' + @printf ' %-30s %s\n' 'debug-cli-status' 'Show CE debug CLI status' + @printf '\n%s\n' 'Xcode workspace targets:' + @printf ' %-30s %s\n' 'xcode' 'Generate and open the disposable Xcode workspace' + @printf ' %-30s %s\n' 'xcode-generate' 'Generate the disposable Xcode workspace' + @printf ' %-30s %s\n' 'xcode-check' 'Check generated Xcode workspace state' + @printf ' %-30s %s\n' 'xcode-validate' 'Generate and validate the Xcode workspace' + @printf ' %-30s %s\n' 'xcode-generator-test' 'Run Xcode workspace generator tests' + @printf ' %-30s %s\n' 'xcode-clean' 'Remove generated Xcode workspace metadata' + @printf '\n%s\n' 'Release targets:' + @printf ' %-30s %s\n' 'release-preflight' 'Run release preflight directly' + @printf ' %-30s %s\n' 'release-artifact' 'Build release artifact directly' + @printf ' %-30s %s\n' 'install-local-production' 'Install a local production app' + @printf ' %-30s %s\n' 'dev-release-preflight' 'Coordinated release preflight' + @printf ' %-30s %s\n' 'dev-release-artifact' 'Coordinated release artifact build' + @printf ' %-30s %s\n' 'dev-install-local-production' 'Coordinated local production install' + @printf '\n%s\n' 'Internal/test targets:' + @printf ' %-30s %s\n' 'resolve' 'Resolve Swift packages' + @printf ' %-30s %s\n' 'conductor-selftest' 'Run conductor/tooling self-tests' + @printf ' %-30s %s\n' 'release-selftest' 'Run release tooling self-tests' + @printf ' %-30s %s\n' 'release-sync-cli-version' 'Sync CLI version for release tooling' + doctor: ./Scripts/doctor.sh diff --git a/Scripts/inventory_local_signing_identities.py b/Scripts/inventory_local_signing_identities.py index 987a05f4..5e2a3c37 100755 --- a/Scripts/inventory_local_signing_identities.py +++ b/Scripts/inventory_local_signing_identities.py @@ -10,7 +10,7 @@ import argparse import json import re -from datetime import UTC, datetime +from datetime import datetime, timezone from pathlib import Path from typing import Any @@ -50,7 +50,7 @@ def parse_iso_datetime(value: str) -> datetime: parsed = datetime.fromisoformat(value.replace("Z", "+00:00")) if parsed.tzinfo is None: raise ValueError(f"Timestamp must include a timezone: {value!r}") - return parsed.astimezone(UTC) + return parsed.astimezone(timezone.utc) def validity_state(not_before: datetime, not_after: datetime, now: datetime) -> str: @@ -114,7 +114,7 @@ def collect_inventory(fixture: dict[str, Any], *, now: datetime) -> dict[str, An "source": "offline-fixture", "capture_label": str(fixture.get("capture_label", "unspecified")), "certificate_name": certificate_name, - "evaluated_at": now.astimezone(UTC).isoformat(), + "evaluated_at": now.astimezone(timezone.utc).isoformat(), "summary": { "exact_name_certificate_count": len(exact_certificates), "private_key_backed_identity_count": sum(bool(certificate["private_key_backed"]) for certificate in exact_certificates), @@ -140,7 +140,7 @@ def main() -> int: fixture = json.loads(Path(arguments.fixture).read_text(encoding="utf-8")) evaluation_value = arguments.at or fixture.get("evaluated_at") - now = parse_iso_datetime(str(evaluation_value)) if evaluation_value else datetime.now(UTC) + now = parse_iso_datetime(str(evaluation_value)) if evaluation_value else datetime.now(timezone.utc) inventory = collect_inventory(fixture, now=now) rendered = json.dumps(inventory, indent=2, sort_keys=True) + "\n" if arguments.output: