Skip to content

Commit

Permalink
[build] Pass variables to monodroid and improve toolchain caching (#3325
Browse files Browse the repository at this point in the history
)

Bumps to xamarin/monodroid@eab304ee

Context: xamarin/monodroid#1010

Partially reworks the inverted build so that variables imported from
'rules.mk' can be accessed externally.

Improves commercial build support for new Android API levels.

Improves provisioning performance when building and testing on the
Azure Pipeline macOS hosted agent pools. We'll now use the Android
SDK components which are pre-installed on those machines, as most of
what we need is already present and this location should be less prone
to being cleaned up.
  • Loading branch information
pjcollins authored and jonpryor committed Jul 31, 2019
1 parent d6d4a48 commit 21a650c
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 9 deletions.
2 changes: 1 addition & 1 deletion .external
Original file line number Diff line number Diff line change
@@ -1 +1 @@
xamarin/monodroid:d16-3@cccf420083cadeae8bcd8be68eea65db1b707274
xamarin/monodroid:d16-3@eab304eebff24efa4b01e4c81cba38df00b5a9a0
1 change: 1 addition & 0 deletions Configuration.props
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@
<HOME Condition=" '$(HOME)' == '' ">$(USERPROFILE)</HOME>
<AndroidPreviousFrameworkVersion Condition=" '$(AndroidPreviousFrameworkVersion)' == '' ">v1.0</AndroidPreviousFrameworkVersion>
<AndroidToolchainCacheDirectory Condition=" '$(AndroidToolchainCacheDirectory)' == '' ">$(HOME)\android-archives</AndroidToolchainCacheDirectory>
<AndroidToolchainDirectory Condition=" '$(AndroidToolchainDirectory)' == '' And '$(RunningOnCI)' == 'true' And '$(HostOS)' == 'Darwin' ">$(HOME)\Library\Android</AndroidToolchainDirectory>
<AndroidToolchainDirectory Condition=" '$(AndroidToolchainDirectory)' == '' ">$(HOME)\android-toolchain</AndroidToolchainDirectory>
<AndroidMxeInstallPrefix Condition=" '$(HostOS)' == 'Linux' ">\usr</AndroidMxeInstallPrefix>
<AndroidMxeInstallPrefix Condition=" '$(HostOS)' == 'Darwin' ">$(HostHomebrewPrefix)</AndroidMxeInstallPrefix>
Expand Down
14 changes: 7 additions & 7 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -125,12 +125,6 @@ uninstall::
rm -rf "$(prefix)/lib/mono/xbuild/Xamarin/Android"
rm -rf "$(prefix)/lib/mono/xbuild-frameworks/MonoAndroid"

include build-tools/scripts/BuildEverything.mk

# Must be after BuildEverything.mk - it uses variables defined there
include build-tools/scripts/Packaging.mk
include tests/api-compatibility/api-compatibility.mk

topdir := $(shell pwd)

# Used by External XA Build
Expand All @@ -139,6 +133,12 @@ EXTERNAL_GIT_PATH=$(topdir)/external

-include $(EXTERNAL_GIT_PATH)/monodroid/xa-integration.mk

include build-tools/scripts/BuildEverything.mk

# Must be after BuildEverything.mk - it uses variables defined there
include build-tools/scripts/Packaging.mk
include tests/api-compatibility/api-compatibility.mk

run-all-tests:
@echo "PRINTING MONO VERSION"
mono --version
Expand Down Expand Up @@ -193,7 +193,7 @@ prepare-build: prepare-build-init
msbuild $(PREPARE_MSBUILD_FLAGS) $(PREPARE_SOLUTION)

.PHONY: prepare
prepare:: prepare-build
prepare: prepare-build
mono --debug $(PREPARE_EXE) $(_PREPARE_ARGS)

.PHONY: prepare-help
Expand Down
5 changes: 4 additions & 1 deletion build-tools/scripts/BuildEverything.mk
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,12 @@
# The other targets depended upon by leeroy also require rules.mk to be present and thus they
# are invoked in the same way framework-assemblies is
#
jenkins::
jenkins:
$(MAKE) PREPARE_CI=1 prepare
$(MAKE) leeroy $(ZIP_OUTPUT)
ifeq ($(XA_INVERTED_COMMERCIAL_BUILD),true)
$(MAKE) commercial
endif

leeroy: leeroy-all framework-assemblies opentk-jcw

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ void Generate (Context context, StreamWriter sw)
WriteVariable ("ALL_JIT_ABIS", ToValue (AbiNames.AllJitAbis));
WriteVariable ("ALL_HOST_ABIS", ToValue (AbiNames.AllHostAbis));
WriteVariable ("ALL_AOT_ABIS", ToValue (AbiNames.AllAotAbis));
WriteVariable ("ANDROID_TOOLCHAIN_DIR", context.Properties.GetRequiredValue (KnownProperties.AndroidToolchainDirectory));
if (context.MonoOptions != null && context.MonoOptions.Count > 0) {
WriteVariable ("MONO_OPTIONS", ToValue (context.MonoOptions));
sw.WriteLine ("export MONO_OPTIONS");
Expand Down

0 comments on commit 21a650c

Please sign in to comment.