Skip to content

Commit

Permalink
Be more granular with SDK and NDK stamp files
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
grendello committed May 12, 2016
1 parent 70e4042 commit 61fe354
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions build-tools/android-toolchain/android-toolchain.targets
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
<Target Name="_UnzipFiles"
DependsOnTargets="_DetermineItems"
Inputs="@(_PlatformAndroidSdkItem->'$(AndroidToolchainCacheDirectory)\%(Identity)')"
Outputs="$(AndroidToolchainDirectory)\.stamp-sdk">
Outputs="@(_PlatformAndroidSdkItem->'$(AndroidToolchainDirectory)\sdk\%(DestDir)\.stamp-sdk') $(AndroidToolchainDirectory)\ndk\.stamp-ndk">
<CreateItem
Include="@(_PlatformAndroidSdkItem->'$(AndroidToolchainCacheDirectory)\%(_PlatformAndroidSdkItem.Identity)">
<Output TaskParameter="Include" ItemName="_AndroidSdkItems"/>
Expand All @@ -61,7 +61,7 @@
DestinationFolder="$(AndroidToolchainDirectory)\ndk"
/>
<Touch
Files="$(AndroidToolchainDirectory)\.stamp-sdk"
Files="@(_PlatformAndroidSdkItem->'$(AndroidToolchainDirectory)\sdk\%(DestDir)\.stamp-sdk') $(AndroidToolchainDirectory)\ndk\.stamp-ndk"
AlwaysCreate="True"
/>
</Target>
Expand All @@ -73,7 +73,7 @@
</ItemGroup>
<Target Name="_CreateNdkToolchains"
Condition=" '$(OS)' == 'Unix' "
Inputs="$(AndroidToolchainDirectory)\.stamp-sdk"
Inputs="$(AndroidToolchainDirectory)\ndk\.stamp-ndk"
Outputs="@(_NdkToolchain->'$(AndroidToolchainDirectory)\.stamp-toolchains-%(Identity)')">
<PropertyGroup>
<_Script>$(AndroidToolchainDirectory)\ndk\build\tools\make-standalone-toolchain.sh</_Script>
Expand Down

0 comments on commit 61fe354

Please sign in to comment.