Skip to content

Commit 64fb3dd

Browse files
authored
Restore --location to publisher (#2716)
## Motivation and Context This PR adds back `--location` to the subcommand `generate-version-manifest` for the `publisher`. Without this, CI would fail due to the PR bot trying to use the already deleted command option ([link](https://github.com/awslabs/smithy-rs/actions/runs/5023168618/jobs/9007489752?pr=2712)). It's important to note that all changes to `tools` need to be backwards compatible across releases. ## Testing Against the old and the new versions of [`build.gradle.kts`](https://github.com/awslabs/smithy-rs/pull/2663/files), manually ran ``` ./gradlew :aws:sdk:assemble ``` and confirmed that `versions.toml` got created under `smithy-rs/aws/sdk/build/aws-sdk`. ---- _By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice._ Co-authored-by: Yuki Saito <[email protected]>
1 parent 61b7a77 commit 64fb3dd

File tree

1 file changed

+18
-4
lines changed

1 file changed

+18
-4
lines changed

tools/ci-build/publisher/src/subcommand/generate_version_manifest.rs

+18-4
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,15 @@ pub struct GenerateVersionManifestArgs {
2626
/// Revision of `aws-doc-sdk-examples` repository used to retrieve examples
2727
#[clap(long)]
2828
examples_revision: String,
29+
/// Same as `input_location` but kept for backwards compatibility
30+
#[clap(long, required_unless_present = "input-location")]
31+
location: Option<PathBuf>,
2932
/// Path containing the generated SDK to generate a version manifest for
30-
#[clap(long)]
31-
input_location: PathBuf,
33+
#[clap(long, required_unless_present = "location")]
34+
input_location: Option<PathBuf>,
3235
/// Path to a directory in which a version manifest is generated
33-
#[clap(long)]
34-
output_location: PathBuf,
36+
#[clap(long, required_unless_present = "location")]
37+
output_location: Option<PathBuf>,
3538
/// Optional path to the `versions.toml` manifest from the previous SDK release
3639
#[clap(long)]
3740
previous_release_versions: Option<PathBuf>,
@@ -41,6 +44,7 @@ pub async fn subcommand_generate_version_manifest(
4144
GenerateVersionManifestArgs {
4245
smithy_build,
4346
examples_revision,
47+
location,
4448
input_location,
4549
output_location,
4650
previous_release_versions,
@@ -56,6 +60,16 @@ pub async fn subcommand_generate_version_manifest(
5660
info!("Resolved smithy-rs revision to {}", smithy_rs_revision);
5761

5862
let smithy_build_root = SmithyBuildRoot::from_file(smithy_build)?;
63+
let input_location = match (location, input_location) {
64+
(Some(location), None) => location,
65+
(None, Some(input_location)) => input_location,
66+
_ => bail!("Only one of `--location` or `--input-location` should be provided"),
67+
};
68+
let output_location = match (location, output_location) {
69+
(Some(location), None) => location,
70+
(None, Some(output_location)) => output_location,
71+
_ => bail!("Only one of `--location` or `--output-location` should be provided"),
72+
};
5973
let manifests = discover_package_manifests(input_location.into())
6074
.await
6175
.context("discover package manifests")?;

0 commit comments

Comments
 (0)