(config, **kwargs)
| 4 | |
| 5 | |
| 6 | def on_config(config, **kwargs): |
| 7 | pom = Path(config.config_file_path).parent / "pom.xml" |
| 8 | text = pom.read_text(encoding="utf-8") |
| 9 | # The <version> right after the project artifactId is the SDK version (parent pom |
| 10 | # coordinates come first, so anchor on the artifactId to skip them). |
| 11 | m = re.search( |
| 12 | r"<artifactId>dashscope-sdk-java</artifactId>\s*<version>([^<]+)</version>", text |
| 13 | ) |
| 14 | config.extra["sdk_version"] = m.group(1) if m else "unknown" |
| 15 | return config |