Skip to content

Commit

Permalink
[build] <AcceptAndroidSdkLicense/> should not always run (#2327)
Browse files Browse the repository at this point in the history
On my machine, `<AcceptAndroidSdkLicense/>` is taking about ~1.5 sec
and runs even in a build with no changes.

We can run it as part of the `_UnzipFiles` target, removing the
`_AcceptAndroidSdkLicenses` target completely. We only need to
re-accept the licenses after new zip files are extracted.

This should save us about 1.5 seconds on any incremental build of
Xamarin.Android itself.
  • Loading branch information
jonathanpeppers authored and dellis1972 committed Oct 23, 2018
1 parent eca09c8 commit fa57aa8
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions build-tools/android-toolchain/android-toolchain.targets
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
_DownloadItems;
_UnzipFiles;
_CreateMxeToolchains;
_AcceptAndroidSdkLicenses;
</BuildDependsOn>
</PropertyGroup>
<UsingTask AssemblyFile="..\..\bin\Build$(Configuration)\Xamarin.Android.Tools.BootstrapTasks.dll" TaskName="Xamarin.Android.Tools.BootstrapTasks.UnzipDirectoryChildren" />
Expand Down Expand Up @@ -88,14 +87,12 @@
SourceFiles="@(_PlatformAntItem->'$(AndroidToolchainCacheDirectory)\%(Identity).zip')"
DestinationFolder="$(AntDirectory)"
/>
<AcceptAndroidSdkLicenses AndroidSdkDirectory="$(AndroidSdkDirectory)" JavaSdkDirectory="$(JavaSdkDirectory)" />
<Touch
Files="@(_SdkStampFiles);$(AndroidToolchainDirectory)\ndk\.stamp-ndk"
AlwaysCreate="True"
/>
</Target>
<Target Name="_AcceptAndroidSdkLicenses">
<AcceptAndroidSdkLicenses AndroidSdkDirectory="$(AndroidSdkDirectory)" JavaSdkDirectory="$(JavaSdkDirectory)" />
</Target>
<Target Name="_CreateMxeToolchains"
Condition=" '$(HostOS)' != 'Windows' And '$(NeedMxe)' == 'true' And ($(AndroidSupportedHostJitAbisForConditionalChecks.Contains (':mxe-Win32:')) Or $(AndroidSupportedHostJitAbisForConditionalChecks.Contains (':mxe-Win64:')))"
Outputs="$(AndroidMxeFullPath)\.stamp">
Expand Down

0 comments on commit fa57aa8

Please sign in to comment.