Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions CONTEXT.md
Original file line number Diff line number Diff line change
Expand Up @@ -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**:
Expand All @@ -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`.
Expand Down
2 changes: 1 addition & 1 deletion readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

<!-- #content -->
---
Expand Down
4 changes: 2 additions & 2 deletions src/Azure.Cli/Azure.Cli.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
<PropertyGroup>
<TargetFramework>net10.0</TargetFramework>
<PackageId>Azure.Cli</PackageId>
<RootNamespace>Azure.Cli</RootNamespace>
<RootNamespace>Azure</RootNamespace>
<AssemblyName>Azure.Cli</AssemblyName>
<Description>Azure CLI payload for .NET: PackageReference Azure.Cli and publish/pack for your RID to get az/ plus Az.ResolvePath.</Description>
<Description>Azure CLI payload for .NET: PackageReference Azure.Cli and publish/pack for your RID to get az/ plus Azure.Cli.ResolvePath.</Description>
<IsAotCompatible>true</IsAotCompatible>
<IsPackable>true</IsPackable>
<RuntimeIdentifiers>win-x64;linux-x64;linux-arm64;osx-x64;osx-arm64</RuntimeIdentifiers>
Expand Down
4 changes: 2 additions & 2 deletions src/Azure.Cli/Az.cs → src/Azure.Cli/Cli.cs
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
namespace Azure.Cli;
namespace Azure;

/// <summary>
/// Resolves the Payload's <c>az</c> executable copied next to the app as <c>az/bin/az</c>.
/// </summary>
public static class Az
public static class Cli
{
/// <summary>
/// Returns the full path to <c>az.cmd</c> (Windows) or <c>az</c> under
Expand Down
12 changes: 6 additions & 6 deletions src/Tests/AzTests.cs → src/Tests/CliTests.cs
Original file line number Diff line number Diff line change
@@ -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()
Expand All @@ -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
{
Expand All @@ -31,7 +31,7 @@ public void ResolvePath_throws_when_missing()
Directory.CreateDirectory(root);
try
{
var ex = Assert.Throws<FileNotFoundException>(() => Az.ResolvePath(root));
var ex = Assert.Throws<FileNotFoundException>(() => Cli.ResolvePath(root));
Assert.Contains("az", ex.FileName, StringComparison.OrdinalIgnoreCase);
}
finally
Expand All @@ -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)
{
Expand Down Expand Up @@ -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);
}
Expand Down
4 changes: 2 additions & 2 deletions src/azx/Program.cs
Original file line number Diff line number Diff line change
@@ -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
Expand Down
Loading