Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[build] Fix
make prepare
ordering (dotnet#937)
@Clancey was trying to build xamarin-android, which failed: $ make prepare ./build-tools/scripts/generate-os-info Configuration.OperatingSystem.props xbuild /p:Configuration=Debug /p:_DebugFileExt=.pdb build-tools/dependencies/dependencies.mdproj ... warning : Referenced Project ../../external/xamarin-android-tools/src/Xamarin.Android.Tools.AndroidSdk/Xamarin.Android.Tools.AndroidSdk.csproj not found, ignoring. ... Xamarin.Android.BuildTools.PrepTasks/JdkInfo.cs(9,23): error CS0234: The type or namespace name 'Tools' does not exist in the namespace 'Xamarin.Android' (are you missing an assembly reference?) The problem is that `make prepare-deps`, which builds `build-tools/dependencies/dependencies.mdproj`, implicitly builds `build-tools/xa-prep-tasks/xa-prep-tasks.csproj`, which in turn depends on `external/xamarin-android-tools/src/Xamarin.Android.Tools.AndroidSdk/Xamarin.Android.Tools.AndroidSdk.csproj`, which is only reliably created by `make prepare-external`s `git submodule update --init --recursive`. Unfortunately, `make prepare-external` wasn't invoked until *after* `make prepare-deps`, meaning there is no way for `make prepare` to actually work on a clean install! (This works on Jenkins because Jenkins automatically checks out all submodules, so it never encounters this "clean checkout" scenario.) Reorder the targets that `make prepare` executes so that `make prepare-external` is run *before* `make prepare-deps`, ensuring that git submodules exist before we attempt to use them.
- Loading branch information