diff --git a/CONTEXT.md b/CONTEXT.md index 7ca4f79..e8938d4 100644 --- a/CONTEXT.md +++ b/CONTEXT.md @@ -5,7 +5,7 @@ NuGet pointer and per-RID payloads that put a working Azure CLI next to a .NET a ## Language **Pointer**: -The `Azure.Cli` nupkg: `Az` plus `runtime.json` mapping each supported RID to a RID package. +The `Azure.Cli` nupkg: `Cli` plus `runtime.json` mapping each supported RID to a RID package. _Avoid_: metapackage, tool package, native package **RID package**: @@ -16,9 +16,9 @@ _Avoid_: native package, runtime pack, sidecar package The self-contained tree copied to the consuming app as `az/`, from which `az` is executed. _Avoid_: native files, native/, binaries, sidecar, nopython tarball (that is an upstream artifact, not what we ship) -**Az**: -The managed type in `Azure.Cli` whose `ResolvePath` returns the Payload's `az` executable (`az.cmd` on Windows). -_Avoid_: Azx, AzureCli, WhatsBoxHost, ResolveBinaryPath +**Cli**: +The managed type whose `ResolvePath` returns the Payload's `az` executable (`az.cmd` on Windows). Call site is `Azure.Cli.ResolvePath()`. +_Avoid_: Az, Azx, AzureCli, WhatsBoxHost, ResolveBinaryPath **azx**: The passthrough .NET tool that execs the Payload `az` with the same arguments. Primary human vehicle via `dnx`/`ndnx azx`. diff --git a/readme.md b/readme.md index db7f914..ab1ea2c 100644 --- a/readme.md +++ b/readme.md @@ -26,7 +26,7 @@ dnx azx -- account list azx --version # azx version, then az --version ``` -`PackageReference` `Azure.Cli` and pack/publish for your RID to copy `az/` next to the app. `Az.ResolvePath()` is the Payload `az` executable. +`PackageReference` `Azure.Cli` and pack/publish for your RID to copy `az/` next to the app. `Azure.Cli.ResolvePath()` is the Payload `az` executable. --- diff --git a/src/Azure.Cli/Azure.Cli.csproj b/src/Azure.Cli/Azure.Cli.csproj index 8ed7339..c51c963 100644 --- a/src/Azure.Cli/Azure.Cli.csproj +++ b/src/Azure.Cli/Azure.Cli.csproj @@ -2,9 +2,9 @@ net10.0 Azure.Cli - Azure.Cli + Azure Azure.Cli - Azure CLI payload for .NET: PackageReference Azure.Cli and publish/pack for your RID to get az/ plus Az.ResolvePath. + Azure CLI payload for .NET: PackageReference Azure.Cli and publish/pack for your RID to get az/ plus Azure.Cli.ResolvePath. true true win-x64;linux-x64;linux-arm64;osx-x64;osx-arm64 diff --git a/src/Azure.Cli/Az.cs b/src/Azure.Cli/Cli.cs similarity index 97% rename from src/Azure.Cli/Az.cs rename to src/Azure.Cli/Cli.cs index 86a5336..2086660 100644 --- a/src/Azure.Cli/Az.cs +++ b/src/Azure.Cli/Cli.cs @@ -1,9 +1,9 @@ -namespace Azure.Cli; +namespace Azure; /// /// Resolves the Payload's az executable copied next to the app as az/bin/az. /// -public static class Az +public static class Cli { /// /// Returns the full path to az.cmd (Windows) or az under diff --git a/src/Tests/AzTests.cs b/src/Tests/CliTests.cs similarity index 94% rename from src/Tests/AzTests.cs rename to src/Tests/CliTests.cs index 2450dc7..d56066f 100644 --- a/src/Tests/AzTests.cs +++ b/src/Tests/CliTests.cs @@ -1,8 +1,8 @@ -using Azure.Cli; +using Azure; namespace Tests; -public class AzTests +public class CliTests { [Fact] public void ResolvePath_finds_payload_under_az_bin() @@ -16,7 +16,7 @@ public void ResolvePath_finds_payload_under_az_bin() try { - Assert.Equal(Path.GetFullPath(expected), Az.ResolvePath(root)); + Assert.Equal(Path.GetFullPath(expected), Cli.ResolvePath(root)); } finally { @@ -31,7 +31,7 @@ public void ResolvePath_throws_when_missing() Directory.CreateDirectory(root); try { - var ex = Assert.Throws(() => Az.ResolvePath(root)); + var ex = Assert.Throws(() => Cli.ResolvePath(root)); Assert.Contains("az", ex.FileName, StringComparison.OrdinalIgnoreCase); } finally @@ -46,7 +46,7 @@ public void ResolvePath_finds_project_payload_and_az_version_matches_pin() string path; try { - path = Az.ResolvePath(); + path = Cli.ResolvePath(); } catch (FileNotFoundException) { @@ -113,7 +113,7 @@ public void ResolvePath_sets_unix_execute_bits() try { - Assert.Equal(Path.GetFullPath(az), Az.ResolvePath(root)); + Assert.Equal(Path.GetFullPath(az), Cli.ResolvePath(root)); Assert.True(File.GetUnixFileMode(az).HasFlag(UnixFileMode.UserExecute), az); Assert.True(File.GetUnixFileMode(py).HasFlag(UnixFileMode.UserExecute), py); } diff --git a/src/azx/Program.cs b/src/azx/Program.cs index e2954a8..7ff0a58 100644 --- a/src/azx/Program.cs +++ b/src/azx/Program.cs @@ -1,12 +1,12 @@ using System.Diagnostics; using System.Reflection; -using Azure.Cli; +using Azure; static class Program { static int Main(string[] args) { - var az = Az.ResolvePath(); + var az = Cli.ResolvePath(); if (args is ["--version"]) { var version = typeof(Program).Assembly