Skip to content

Commit

Permalink
Remove support for the Android SDK Tools Package (#5778)
Browse files Browse the repository at this point in the history
Context: https://developer.android.com/studio/releases/sdk-tools

The Android SDK Tools package has been deprecated since 2017 and is
no longer receiving updates.

Remove all usage of the Android SDK Tools package.
  • Loading branch information
jonpryor authored Mar 26, 2021
1 parent edddf9b commit 171cccd
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 32 deletions.
10 changes: 0 additions & 10 deletions build-tools/check-boot-times/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -531,29 +531,21 @@ static string GetProgramPath (params string [] filenames)
$"{sdkPath}/cmdline-tools/1.0/bin",
$"{sdkPath}/cmdline-tools/latest/bin",
$"{sdkPath}/emulator",
$"{sdkPath}/tools",
$"{sdkPath}/tools/bin",
});
} else {
potentialLocations.AddRange (new []{
"AppData/Local/Android/Sdk/platform-tools",
"AppData/Local/Android/Sdk/cmdline-tools/1.0/bin",
"AppData/Local/Android/Sdk/cmdline-tools/latest/bin",
"AppData/Local/Android/Sdk/emulator",
"AppData/Local/Android/Sdk/tools",
"AppData/Local/Android/Sdk/tools/bin",
"Library/Android/sdk/platform-tools",
"Library/Android/sdk/cmdline-tools/1.0/bin",
"Library/Android/sdk/cmdline-tools/latest/bin",
"Library/Android/sdk/emulator",
"Library/Android/sdk/tools",
"Library/Android/sdk/tools/bin",
"android-toolchain/sdk/platform-tools",
"android-toolchain/sdk/cmdline-tools/1.0/bin",
"android-toolchain/sdk/cmdline-tools/latest/bin",
"android-toolchain/sdk/emulator",
"android-toolchain/sdk/tools",
"android-toolchain/sdk/tools/bin",
});

if (RunningOnWindowsEnvironment) {
Expand All @@ -562,8 +554,6 @@ static string GetProgramPath (params string [] filenames)
"C:/Program Files (x86)/Android/android-sdk/cmdline-tools/1.0/bin",
"C:/Program Files (x86)/Android/android-sdk/cmdline-tools/latest/bin",
"C:/Program Files (x86)/Android/android-sdk/emulator",
"C:/Program Files (x86)/Android/android-sdk/tools",
"C:/Program Files (x86)/Android/android-sdk/tools/bin",
});
}
}
Expand Down
6 changes: 3 additions & 3 deletions build-tools/scripts/TestApks.targets
Original file line number Diff line number Diff line change
Expand Up @@ -354,7 +354,7 @@
<Target Name="InstallAvdImage" >
<!-- SDK component installation can be frail, try a few times. -->
<Exec
Command="&quot;$(AndroidSdkDirectory)\tools\bin\sdkmanager&quot; &quot;$(SdkManagerImageName)&quot;"
Command="&quot;$(CommandLineToolsBinPath)\sdkmanager&quot; &quot;$(SdkManagerImageName)&quot;"
EnvironmentVariables="JAVA_HOME=$(Java8SdkDirectory)"
ContinueOnError="true">
<Output TaskParameter="ExitCode" PropertyName="_SdkManagerExitCode" />
Expand All @@ -364,7 +364,7 @@
Condition=" '$(_SdkManagerExitCode)' != '0' "
/>
<Exec
Command="&quot;$(AndroidSdkDirectory)\tools\bin\sdkmanager&quot; &quot;$(SdkManagerImageName)&quot;"
Command="&quot;$(CommandLineToolsBinPath)\sdkmanager&quot; &quot;$(SdkManagerImageName)&quot;"
EnvironmentVariables="JAVA_HOME=$(Java8SdkDirectory)"
ContinueOnError="true"
Condition=" '$(_SdkManagerExitCode)' != '0' ">
Expand All @@ -375,7 +375,7 @@
Condition=" '$(_SdkManagerExitCode)' != '0' "
/>
<Exec
Command="&quot;$(AndroidSdkDirectory)\tools\bin\sdkmanager&quot; &quot;$(SdkManagerImageName)&quot;"
Command="&quot;$(CommandLineToolsBinPath)\sdkmanager&quot; &quot;$(SdkManagerImageName)&quot;"
EnvironmentVariables="JAVA_HOME=$(Java8SdkDirectory)"
ContinueOnError="true"
Condition=" '$(_SdkManagerExitCode)' != '0' ">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,6 @@ bool AcceptLicenses (Context context, string sdkRoot)
string[] sdkManagerPaths = new[]{
Path.Combine (sdkRoot, "cmdline-tools", context.Properties [KnownProperties.CommandLineToolsFolder], "bin", "sdkmanager"),
Path.Combine (sdkRoot, "cmdline-tools", "latest", "bin", "sdkmanager"),
Path.Combine (sdkRoot, "tools", "bin", "sdkmanager"),
};
string sdkManager = "";
foreach (var sdkManagerPath in sdkManagerPaths) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,6 @@ public class CalculateProjectDependencies : AndroidTask

public string PlatformToolsVersion { get; set; }

public string ToolsVersion { get; set; }

public string NdkVersion { get; set; }

public bool NdkRequired { get; set; }
Expand Down Expand Up @@ -68,9 +66,6 @@ public override bool RunTask ()
if (!string.IsNullOrEmpty (CommandLineToolsVersion)) {
dependencies.Add (CreateAndroidDependency ($"cmdline-tools/{CommandLineToolsVersion}", CommandLineToolsVersion));
}
if (!string.IsNullOrEmpty (ToolsVersion)) {
dependencies.Add (CreateAndroidDependency ("tools", ToolsVersion));
}
if (!string.IsNullOrEmpty (NdkVersion) && NdkRequired) {
dependencies.Add (CreateAndroidDependency ("ndk-bundle", NdkVersion));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,19 +29,16 @@ public void CheckNdkBundle ([Values(true, false)] bool ndkRequred)
};

task.PlatformToolsVersion = "26.0.3";
task.ToolsVersion = "26.0.1";
task.NdkVersion = "12.1";
task.NdkRequired = ndkRequred;
task.BuildToolsVersion = "26.0.1";
task.TargetFrameworkVersion = "v8.0";
task.ManifestFile = new TaskItem (Path.Combine (path, "AndroidManifest.xml"));
Assert.IsTrue (task.Execute ());
Assert.IsNotNull (task.Dependencies);
Assert.AreEqual (ndkRequred ? 5 : 4, task.Dependencies.Length);
Assert.AreEqual (ndkRequred ? 4 : 3, task.Dependencies.Length);
Assert.IsNotNull (task.Dependencies.FirstOrDefault (x => x.ItemSpec == "build-tools/26.0.1" && x.GetMetadata ("Version") == "26.0.1"),
"Dependencies should contains a build-tools version 26.0.1");
Assert.IsNotNull (task.Dependencies.FirstOrDefault (x => x.ItemSpec == "tools" && x.GetMetadata ("Version") == "26.0.1"),
"Dependencies should contains a tools version 26.0.1");
Assert.IsNotNull (task.Dependencies.FirstOrDefault (x => x.ItemSpec == "platforms/android-26" && x.GetMetadata ("Version") == ""),
"Dependencies should contains a platform version android-26");
Assert.IsNotNull (task.Dependencies.FirstOrDefault (x => x.ItemSpec == "platform-tools" && x.GetMetadata ("Version") == "26.0.3"),
Expand Down Expand Up @@ -70,19 +67,16 @@ public void ManifestFileDoesNotExist ()
};

task.PlatformToolsVersion = "26.0.3";
task.ToolsVersion = "26.0.1";
task.NdkVersion = "12.1";
task.NdkRequired = true;
task.BuildToolsVersion = "26.0.1";
task.TargetFrameworkVersion = "v8.0";
task.ManifestFile = new TaskItem (Path.Combine (path, "AndroidManifest.xml"));
Assert.IsTrue (task.Execute ());
Assert.IsNotNull (task.Dependencies);
Assert.AreEqual (5, task.Dependencies.Length);
Assert.AreEqual (4, task.Dependencies.Length);
Assert.IsNotNull (task.Dependencies.FirstOrDefault (x => x.ItemSpec == "build-tools/26.0.1" && x.GetMetadata ("Version") == "26.0.1"),
"Dependencies should contains a build-tools version 26.0.1");
Assert.IsNotNull (task.Dependencies.FirstOrDefault (x => x.ItemSpec == "tools" && x.GetMetadata ("Version") == "26.0.1"),
"Dependencies should contains a tools version 26.0.1");
Assert.IsNotNull (task.Dependencies.FirstOrDefault (x => x.ItemSpec == "platforms/android-26" && x.GetMetadata ("Version") == ""),
"Dependencies should contains a platform version android-26");
Assert.IsNotNull (task.Dependencies.FirstOrDefault (x => x.ItemSpec == "platform-tools" && x.GetMetadata ("Version") == "26.0.3"),
Expand Down Expand Up @@ -114,19 +108,16 @@ public void ManifestFileExists ()
</manifest>");

task.PlatformToolsVersion = "26.0.3";
task.ToolsVersion = "26.0.1";
task.NdkVersion = "12.1";
task.NdkRequired = true;
task.BuildToolsVersion = "26.0.1";
task.TargetFrameworkVersion = "v8.0";
task.ManifestFile = new TaskItem (manifestFile);
Assert.IsTrue(task.Execute ());
Assert.IsNotNull (task.Dependencies);
Assert.AreEqual (5, task.Dependencies.Length);
Assert.AreEqual (4, task.Dependencies.Length);
Assert.IsNotNull (task.Dependencies.FirstOrDefault (x => x.ItemSpec == "build-tools/26.0.1" && x.GetMetadata ("Version") == "26.0.1"),
"Dependencies should contains a build-tools version 26.0.1");
Assert.IsNotNull (task.Dependencies.FirstOrDefault (x => x.ItemSpec == "tools" && x.GetMetadata ("Version") == "26.0.1"),
"Dependencies should contains a tools version 26.0.1");
Assert.IsNotNull (task.Dependencies.FirstOrDefault (x => x.ItemSpec == "platforms/android-26" && x.GetMetadata ("Version") == ""),
"Dependencies should contains a platform version android-26");
Assert.IsNotNull (task.Dependencies.FirstOrDefault (x => x.ItemSpec == "platform-tools" && x.GetMetadata ("Version") == "26.0.3"),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2570,7 +2570,6 @@ because xbuild doesn't support framework reference assemblies.
ManifestFile="$(_ProjectAndroidManifest)"
BuildToolsVersion="$(AndroidSdkBuildToolsVersion)"
PlatformToolsVersion="$(AndroidSdkPlatformToolsVersion)"
ToolsVersion="$(AndroidSdkToolsVersion)"
NdkVersion="$(AndroidNdkVersion)"
NdkRequired="$(_NdkRequired)"
>
Expand Down

0 comments on commit 171cccd

Please sign in to comment.