Skip to content
Merged
Show file tree
Hide file tree
Changes from 4 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
4 changes: 4 additions & 0 deletions eng/Version.Details.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@
<Uri>https://github.com/microsoft/clrmd</Uri>
<Sha>d724947392626b66e39b525998a8817447d50380</Sha>
</Dependency>
<Dependency Name="Xamarin.Android.Tools.AndroidSdk" Version="1.0.105-preview.225">
<Uri>https://github.com/dotnet/android</Uri>
<Sha>bf304cf475308547a2a1a342bb9f2e6825cc33cd</Sha>
</Dependency>
Comment on lines +12 to +15
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is probably always going to be "preview" branded and marked as a non-shipping/transport package.

We could track with a subscription, but you probably don't need to update this frequently.

I can manage updating it manually when it matters, such as: > darc update-dependencies --id 276447

</ProductDependencies>
<ToolsetDependencies>
<Dependency Name="Microsoft.DotNet.Arcade.Sdk" Version="10.0.0-beta.25351.106">
Expand Down
1 change: 1 addition & 0 deletions eng/Versions.props
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@
<cdbsosversion>10.0.26100.1</cdbsosversion>
<NewtonSoftJsonVersion>13.0.1</NewtonSoftJsonVersion>
<MicrosoftSourceBuildIntermediatesourcebuildreferencepackagesPackageVersion>10.0.622304</MicrosoftSourceBuildIntermediatesourcebuildreferencepackagesPackageVersion>
<XamarinAndroidToolsAndroidSdkVersion>1.0.105-preview.225</XamarinAndroidToolsAndroidSdkVersion>
<!-- Roslyn and analyzers -->
<!-- dotnet/roslyn dependencies -->
<!--
Expand Down
23 changes: 22 additions & 1 deletion src/Tools/dotnet-dsrouter/ADBTcpRouterFactory.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
using System.Threading.Tasks;
using Microsoft.Diagnostics.NETCore.Client;
using Microsoft.Extensions.Logging;
using Xamarin.Android.Tools;

namespace Microsoft.Diagnostics.Tools.DiagnosticsServerRouter
{
Expand Down Expand Up @@ -65,7 +66,27 @@ public static void AdbRemovePortReverse(int localPort, int remotePort, bool owns

public static bool RunAdbCommandInternal(string command, string expectedOutput, int expectedExitCode, bool rethrow, ILogger logger)
{
string sdkRoot = Environment.GetEnvironmentVariable("ANDROID_SDK_ROOT");
void sdklogger(TraceLevel level, string message)
{
switch (level)
{
case TraceLevel.Error:
logger?.LogError(message);
break;
case TraceLevel.Warning:
logger?.LogWarning(message);
break;
case TraceLevel.Info:
logger?.LogInformation(message);
break;
case TraceLevel.Verbose:
logger?.LogDebug(message);
break;
}
};

//ANDROID_SDK_ROOT is deprecated
string sdkRoot = Environment.GetEnvironmentVariable("ANDROID_HOME") ?? Environment.GetEnvironmentVariable("ANDROID_SDK_ROOT") ?? new AndroidSdkInfo(logger: sdklogger).AndroidSdkPath;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was thinking about this...

If $ANDROID_SDK_ROOT is deprecated, we can probably remove it and all mention of this env var. And we should add a new command-line switch to set this path? This could be a separate PR.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How much of this logic is encoded directly into AndroidSdkPath? Maybe it already has logic to check the correct env variables supported by the Android SDK?

When we update this, we should update any documentation that reference the deprecated env variable.

+1 on having a separate optional argument passed to dsrouter, should work when using android profiles or using the forward port argument.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok, then we should probably drop the env checks here altogether and rely on AndroidSdkPath to provide it.

string adbTool = "adb";

if (!string.IsNullOrEmpty(sdkRoot))
Expand Down
1 change: 1 addition & 0 deletions src/Tools/dotnet-dsrouter/dotnet-dsrouter.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
<PackageReference Include="System.CommandLine" Version="$(SystemCommandLineVersion)" />
<PackageReference Include="Microsoft.Extensions.Logging" Version="$(MicrosoftExtensionsLoggingVersion)" />
<PackageReference Include="Microsoft.Extensions.Logging.Console" Version="$(MicrosoftExtensionsLoggingConsoleVersion)" />
<PackageReference Include="Xamarin.Android.Tools.AndroidSdk" Version="$(XamarinAndroidToolsAndroidSdkVersion)" />
</ItemGroup>

</Project>