Skip to content

Commit 3bfafea

Browse files
jonathanpeppersjonpryor
authored andcommitted
[build] fix Windows build on a fresh machine (#1132)
We discovered the build fails on Windows if you: - wipe out `~\android-toolchain` - `git clean -dxf` - `msbuild Xamarin.Android.sln /t:Prepare` - Or just have a fresh machine We need to reorder the steps of what happens in `PrepareWindows.targets`: 1. `git submodule update` 2. build `xa-prep-tasks`, which gets `.nuget\NuGet.exe` 2. `nuget restore` 3. build `android-toolchain` , which is the missing step that installs the Android SDK 4. proceed with everything else Without step no. 3, the missing Android SDK that gets installed to `~\android-toolchain` causes the `<JdkInfo />` task to fail.
1 parent 59cfa5d commit 3bfafea

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

build-tools/scripts/PrepareWindows.targets

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,12 @@
1111
<Target Name="Prepare">
1212
<Exec Command="git submodule update --init --recursive" WorkingDirectory="$(_TopDir)" />
1313
<MSBuild Projects="$(MSBuildThisFileDirectory)..\xa-prep-tasks\xa-prep-tasks.csproj" />
14+
<Exec Command="$(_NuGet) restore Xamarin.Android.sln" WorkingDirectory="$(_TopDir)" />
15+
<Exec Command="$(_NuGet) restore Xamarin.Android-Tests.sln" WorkingDirectory="$(_TopDir)" />
16+
<Exec Command="$(_NuGet) restore external\Java.Interop\Java.Interop.sln" WorkingDirectory="$(_TopDir)" />
17+
<Exec Command="$(_NuGet) restore external\LibZipSharp\libZipSharp.sln" WorkingDirectory="$(_TopDir)" />
18+
<Exec Command="$(_NuGet) restore external\xamarin-android-tools\Xamarin.Android.Tools.sln" WorkingDirectory="$(_TopDir)" />
19+
<MSBuild Projects="$(MSBuildThisFileDirectory)..\android-toolchain\android-toolchain.mdproj" />
1420
<JdkInfo
1521
AndroidSdkPath="$(AndroidSdkDirectory)"
1622
AndroidNdkPath="$(AndroidNdkDirectory)"
@@ -28,10 +34,5 @@
2834
DestinationFile="$(_TopDir)\Configuration.OperatingSystem.props"
2935
Replacements="@JAVA_HOME@=$(_JavaSdkDirectory)"
3036
/>
31-
<Exec Command="$(_NuGet) restore Xamarin.Android.sln" WorkingDirectory="$(_TopDir)" />
32-
<Exec Command="$(_NuGet) restore Xamarin.Android-Tests.sln" WorkingDirectory="$(_TopDir)" />
33-
<Exec Command="$(_NuGet) restore external\Java.Interop\Java.Interop.sln" WorkingDirectory="$(_TopDir)" />
34-
<Exec Command="$(_NuGet) restore external\LibZipSharp\libZipSharp.sln" WorkingDirectory="$(_TopDir)" />
35-
<Exec Command="$(_NuGet) restore external\xamarin-android-tools\Xamarin.Android.Tools.sln" WorkingDirectory="$(_TopDir)" />
3637
</Target>
3738
</Project>

0 commit comments

Comments
 (0)