Skip to content

Commit 10bd8d1

Browse files
grendellojonpryor
authored andcommitted
[android-toolchains] Be more granular with SDK and NDK stamp files
Previously we used a single stamp file to detect whether SDK/NDK need to be updated/recreate. This worked fine if nobody touched the toolchain directory. However, if any of the directories (sdk, ndk or anything in them) were removed, build would *not* recreate the toolchain *unless* the stamp file in the root folder would be deleted as well. This patch creates a stamp file per component directory for all the NDK and SDK components and thus the content will be restored should the directory be removed. It can be further improved, probably, by not removing the entire directory prior to unzipping files as we do now but instead unpack only those components that are missing.
1 parent 521357c commit 10bd8d1

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

build-tools/android-toolchain/android-toolchain.targets

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,9 @@
2323
Condition=" '%(HostOS)' == '$(HostOS)' Or '%(HostOS)' == '' ">
2424
<Output TaskParameter="Include" ItemName="_PlatformAndroidNdkItem"/>
2525
</CreateItem>
26+
<ItemGroup>
27+
<_SdkStampFiles Include="@(_PlatformAndroidSdkItem->'$(AndroidToolchainDirectory)\sdk\.stamp-%(Identity)')" />
28+
</ItemGroup>
2629
</Target>
2730
<Target Name="_DownloadItems"
2831
DependsOnTargets="_DetermineItems"
@@ -36,7 +39,7 @@
3639
<Target Name="_UnzipFiles"
3740
DependsOnTargets="_DetermineItems"
3841
Inputs="@(_PlatformAndroidSdkItem->'$(AndroidToolchainCacheDirectory)\%(Identity)')"
39-
Outputs="$(AndroidToolchainDirectory)\.stamp-sdk">
42+
Outputs="@(_SdkStampFiles);$(AndroidToolchainDirectory)\ndk\.stamp-ndk">
4043
<CreateItem
4144
Include="@(_PlatformAndroidSdkItem->'$(AndroidToolchainCacheDirectory)\%(_PlatformAndroidSdkItem.Identity)">
4245
<Output TaskParameter="Include" ItemName="_AndroidSdkItems"/>
@@ -61,7 +64,7 @@
6164
DestinationFolder="$(AndroidToolchainDirectory)\ndk"
6265
/>
6366
<Touch
64-
Files="$(AndroidToolchainDirectory)\.stamp-sdk"
67+
Files="@(_SdkStampFiles);$(AndroidToolchainDirectory)\ndk\.stamp-ndk"
6568
AlwaysCreate="True"
6669
/>
6770
</Target>
@@ -73,7 +76,7 @@
7376
</ItemGroup>
7477
<Target Name="_CreateNdkToolchains"
7578
Condition=" '$(OS)' == 'Unix' "
76-
Inputs="$(AndroidToolchainDirectory)\.stamp-sdk"
79+
Inputs="$(AndroidToolchainDirectory)\ndk\.stamp-ndk"
7780
Outputs="@(_NdkToolchain->'$(AndroidToolchainDirectory)\.stamp-toolchains-%(Identity)')">
7881
<PropertyGroup>
7982
<_Script>$(AndroidToolchainDirectory)\ndk\build\tools\make-standalone-toolchain.sh</_Script>

0 commit comments

Comments
 (0)