Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[build] fixes for failing Windows build
Context: dotnet#2019 Context: http://build.devdiv.io/2168276 Context: http://build.devdiv.io/2169681 Since 4bb4b2e, our builds have been failing on VSTS on Windows. Jenkins is green, however. Currently getting a failure in `Xamarin.Android.LibraryProjectZip-LibBinding.csproj` such as: 2018-10-31T14:02:28.8336608Z .\gradlew assembleDebug --stacktrace --no-daemon 2018-10-31T14:02:40.7122197Z NDK is missing a "platforms" directory. 2018-10-31T14:02:40.7122937Z If you are using NDK, verify the ndk.dir is set to a valid NDK directory. It is currently set to C:\Users\dlab14\android-toolchain\sdk\ndk-bundle. 2018-10-31T14:02:40.7124870Z If you are not using NDK, unset the NDK variable from ANDROID_NDK_HOME or local.properties to remove this warning. It doesn't really make sense to me why this started happening with d8/r8 support... The `~\android-toolchain\sdk\ndk-bundle` path seems completely wrong. However, it looks like we should be setting `ANDROID_NDK_HOME=$(AndroidNdkDirectory)`. After that change, we got a new error: 2018-10-31T17:19:30.1558223Z Checking the license for package Android SDK Build-Tools 25.0.2 in C:\Users\dlab14\android-toolchain\sdk\licenses 2018-10-31T17:19:30.1562674Z EXEC : warning : License for package Android SDK Build-Tools 25.0.2 not accepted. [E:\A\_work\14\s\tests\CodeGen-Binding\Xamarin.Android.LibraryProjectZip-LibBinding\Xamarin.Android.LibraryProjectZip-LibBinding.csproj] So this is the actual problem! In fa57aa8, I changed `android-toolchain` to not run `<AcceptAndroidSdkLicense/>` all the time. That was actually making this `.\gradlew` command successfully install Android SDK Build-Tools 25.0.2 and use it without a license prompt. We started seeing the problem since 4bb4b2e, because it caused a new `~\android-toolchain\sdk` directory to get setup. The fix here is to just use Build-Tools 28.0.0, since that is the version we boostrap and install during our build. But we would never actually remember to update this value... So we should make a `build.gradle.in` file, and replace with our existing property from `Configuration.props`: <XABuildToolsFolder Condition="'$(XABuildToolsFolder)' == ''">28.0.0</XABuildToolsFolder> Other changes: - Added `--stacktrace` to the gradle calls in `r8.targets`, so we get better error messages. It also matches the gradle command in `Xamarin.Android.LibraryProjectZip-LibBinding.csproj`.
- Loading branch information