Files
floci/tools/java_sources.py
T
Hector Ventura 7cf443fcee chore: rename the package to io.floci.aws (#7689)
Move the Java sources from io.github.hectorvent.floci to io.floci.aws, matching io.floci.gcp, io.floci.az and io.floci.oci. Generated by tools/rename/rename_package.py apply on the base commit, with no other edits.

Logger categories and the arn.fail-on-blank-region property move to the io.floci.aws prefix. The pom groupId becomes io.floci; the artifactId stays floci.

Refs #6589

Signed-off-by: Hector Ventura <hectorvent@gmail.com>
2026-11-06 11:07:21 -04:00

20 lines
927 B
Python

"""Where Floci's Java sources live: the one place the tools under tools/ name the Java package.
Tools import the paths from here instead of writing src/main/java/<package>/... themselves, so a
package rename changes this file and nothing else in tools/. Registries that list source files
(tools/docs/services.yaml, tools/docs/service_matrix.yaml) hold paths relative to PACKAGE_DIR.
"""
from __future__ import annotations
SOURCE_ROOT = "src/main/java"
PACKAGE_DIR = f"{SOURCE_ROOT}/io/floci/aws"
SERVICES_PACKAGE_DIR = f"{PACKAGE_DIR}/services"
def package_source(relative: str) -> str:
"""The repo-relative path of a source file a registry lists relative to PACKAGE_DIR."""
if relative.startswith(("src/", "/")):
raise ValueError(f"{relative}: registry paths are relative to {PACKAGE_DIR}/, "
f"for example services/sqs/SqsJsonHandler.java")
return f"{PACKAGE_DIR}/{relative}"