Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace uses of CONFIGURATIONS by CONFIGURATION #2325

Merged
merged 2 commits into from
Oct 25, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 0 additions & 6 deletions Documentation/building/unix-instructions.md
Original file line number Diff line number Diff line change
Expand Up @@ -190,12 +190,6 @@ There are a few ways to do it:
* Build all the platforms with:

make framework-assemblies

Note that `make framework-assemblies` builds `Mono.Android.dll`
for *both* Debug and Release configurations. To build only a
single configuration, set the `$(CONFIGURATIONS)` make variable:

make framework-assemblies CONFIGURATIONS=Debug

* Build several platforms other than the default

Expand Down
13 changes: 5 additions & 8 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -102,16 +102,13 @@ prepare-external:
git submodule update --init --recursive
nuget restore $(SOLUTION)
nuget restore Xamarin.Android-Tests.sln
$(foreach conf, $(CONFIGURATIONS), \
(cd external/xamarin-android-tools && make prepare CONFIGURATION=$(conf)) && \
(cd $(call GetPath,JavaInterop) && make prepare CONFIGURATION=$(conf) JI_MAX_JDK=8) && \
(cd $(call GetPath,JavaInterop) && make bin/Build$(conf)/JdkInfo.props CONFIGURATION=$(conf) JI_MAX_JDK=8) && ) \
true
(cd external/xamarin-android-tools && make prepare CONFIGURATION=$(CONFIGURATION))
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can remove these CONFIGURATION=$(CONFIGURATION).

(cd $(call GetPath,JavaInterop) && make prepare CONFIGURATION=$(CONFIGURATION) JI_MAX_JDK=8)
(cd $(call GetPath,JavaInterop) && make bin/Build$(CONFIGURATION)/JdkInfo.props CONFIGURATION=$(CONFIGURATION) JI_MAX_JDK=8)

prepare-deps: prepare-external
./build-tools/scripts/generate-os-info Configuration.OperatingSystem.props
$(foreach conf, $(CONFIGURATIONS), \
mkdir -p bin/Build$(conf) ; )
mkdir -p bin/Build$(CONFIGURATION)
$(call MSBUILD_BINLOG,prepare-deps) build-tools/dependencies/dependencies.csproj
$(call MSBUILD_BINLOG,prepare-bundle) build-tools/download-bundle/download-bundle.csproj

Expand Down Expand Up @@ -142,7 +139,7 @@ include tests/api-compatibility/api-compatibility.mk
topdir := $(shell pwd)


XA_BUILD_PATHS_OUT = $(CONFIGURATIONS:%=bin/Test%/XABuildPaths.cs)
XA_BUILD_PATHS_OUT = bin/Test$(CONFIGURATION)/XABuildPaths.cs

prepare-paths: $(XA_BUILD_PATHS_OUT)

Expand Down
69 changes: 30 additions & 39 deletions build-tools/scripts/BuildEverything.mk
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,6 @@ _MSBUILD_ARGS = \
/p:AndroidSupportedHostJitAbis=$(call join-with,:,$(ALL_HOST_ABIS)) \
/p:AndroidSupportedTargetAotAbis=$(call join-with,:,$(ALL_AOT_ABIS))

CONFIGURATIONS ?= Debug Release

.PHONY: leeroy jenkins leeroy-all opentk-jcw framework-assemblies
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The build failed because the leeroy rule was building both configurations before and Jenkins uses jenkins rule, which depends on leeroy.

So we need to either let jenkins rule to run leeroy twice or change the Jenkins configuration to run make jenkins ... twice.

Now the Jenkins build ran make in this order:

+ make prepare-deps V=1 'MSBUILD_ARGS=/p:AutoProvision=True /p:AutoProvisionUsesSudo=True /p:IgnoreMaxMonoVersion=False'
+ make prepare jenkins V=1 'MSBUILD_ARGS=/p:AutoProvision=True /p:AutoProvisionUsesSudo=True /p:IgnoreMaxMonoVersion=False'
+ make all-tests V=1
+ make all-tests CONFIGURATION=Release V=1

So the tests in the Release configuration were ran without making prepare and all in Release configuration first.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, we'll need to update Jenkins to run make leeroy twice, once per configuration value.

@radekdoulik: Thank you, I hadn't considered that problem. Doh!

.PHONY: create-vsix

Expand All @@ -90,50 +88,43 @@ jenkins: prepare leeroy $(ZIP_OUTPUT)
leeroy: leeroy-all framework-assemblies opentk-jcw

leeroy-all:
$(foreach conf, $(CONFIGURATIONS), \
$(call MSBUILD_BINLOG,leeroy-all,$(_SLN_BUILD),$(conf)) $(SOLUTION) /p:Configuration=$(conf) $(_MSBUILD_ARGS) && \
$(call CREATE_THIRD_PARTY_NOTICES,$(conf),bin/$(conf)/lib/xamarin.android/ThirdPartyNotices.txt,$(THIRD_PARTY_NOTICE_LICENSE_TYPE),True,False) && ) \
true
$(call MSBUILD_BINLOG,leeroy-all,$(_SLN_BUILD),$(CONFIGURATION)) $(SOLUTION) /p:Configuration=$(CONFIGURATION) $(_MSBUILD_ARGS) && \
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We could simplify MSBUILD_BINLOG to not take $(CONFIGURATION) as a parameter, and simply use it in the template directly.

$(call CREATE_THIRD_PARTY_NOTICES,$(CONFIGURATION),bin/$(CONFIGURATION)/lib/xamarin.android/ThirdPartyNotices.txt,$(THIRD_PARTY_NOTICE_LICENSE_TYPE),True,False)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.


framework-assemblies:
PREV_VERSION="v1.0"; \
$(foreach a, $(API_LEVELS), \
CUR_VERSION=`echo "$(ALL_FRAMEWORKS)"|tr -s " "|cut -d " " -s -f $(a)`; \
$(foreach conf, $(CONFIGURATIONS), \
REDIST_FILE=bin/$(conf)/lib/xamarin.android/xbuild-frameworks/MonoAndroid/$${CUR_VERSION}/RedistList/FrameworkList.xml; \
grep -q $${PREV_VERSION} $${REDIST_FILE}; \
if [ $$? -ne 0 ] ; then \
rm -f bin/$(conf)/lib/xamarin.android/xbuild-frameworks/MonoAndroid/$${CUR_VERSION}/RedistList/FrameworkList.xml; \
fi; \
$(call MSBUILD_BINLOG,Mono.Android,$(_SLN_BUILD),$(conf)) src/Mono.Android/Mono.Android.csproj \
/p:Configuration=$(conf) $(_MSBUILD_ARGS) \
/p:AndroidApiLevel=$(a) /p:AndroidPlatformId=$(word $(a), $(ALL_PLATFORM_IDS)) /p:AndroidFrameworkVersion=$${CUR_VERSION} \
/p:AndroidPreviousFrameworkVersion=$${PREV_VERSION} || exit 1; ) \
REDIST_FILE=bin/$(CONFIGURATION)/lib/xamarin.android/xbuild-frameworks/MonoAndroid/$${CUR_VERSION}/RedistList/FrameworkList.xml; \
grep -q $${PREV_VERSION} $${REDIST_FILE}; \
if [ $$? -ne 0 ] ; then \
rm -f bin/$(CONFIGURATION)/lib/xamarin.android/xbuild-frameworks/MonoAndroid/$${CUR_VERSION}/RedistList/FrameworkList.xml; \
fi; \
$(call MSBUILD_BINLOG,Mono.Android,$(_SLN_BUILD),$(CONFIGURATION)) src/Mono.Android/Mono.Android.csproj \
/p:Configuration=$(CONFIGURATION) $(_MSBUILD_ARGS) \
/p:AndroidApiLevel=$(a) /p:AndroidPlatformId=$(word $(a), $(ALL_PLATFORM_IDS)) /p:AndroidFrameworkVersion=$${CUR_VERSION} \
/p:AndroidPreviousFrameworkVersion=$${PREV_VERSION} || exit 1; \
PREV_VERSION=$${CUR_VERSION}; )
$(foreach conf, $(CONFIGURATIONS), \
rm -f bin/$(conf)/lib/xamarin.android/xbuild-frameworks/MonoAndroid/v1.0/Xamarin.Android.NUnitLite.dll; \
$(call MSBUILD_BINLOG,NUnitLite,$(_SLN_BUILD),$(conf)) $(MSBUILD_FLAGS) src/Xamarin.Android.NUnitLite/Xamarin.Android.NUnitLite.csproj \
/p:Configuration=$(conf) $(_MSBUILD_ARGS) \
/p:AndroidApiLevel=$(firstword $(API_LEVELS)) /p:AndroidPlatformId=$(word $(firstword $(API_LEVELS)), $(ALL_PLATFORM_IDS)) \
/p:AndroidFrameworkVersion=$(firstword $(FRAMEWORKS)) || exit 1; )
rm -f bin/$(CONFIGURATION)/lib/xamarin.android/xbuild-frameworks/MonoAndroid/v1.0/Xamarin.Android.NUnitLite.dll; \
$(call MSBUILD_BINLOG,NUnitLite,$(_SLN_BUILD),$(CONFIGURATION)) $(MSBUILD_FLAGS) src/Xamarin.Android.NUnitLite/Xamarin.Android.NUnitLite.csproj \
/p:Configuration=$(CONFIGURATION) $(_MSBUILD_ARGS) \
/p:AndroidApiLevel=$(firstword $(API_LEVELS)) /p:AndroidPlatformId=$(word $(firstword $(API_LEVELS)), $(ALL_PLATFORM_IDS)) \
/p:AndroidFrameworkVersion=$(firstword $(FRAMEWORKS)) || exit 1;
_latest_stable_framework=$$($(MSBUILD) /p:DoNotLoadOSProperties=True /nologo /v:minimal /t:GetAndroidLatestStableFrameworkVersion build-tools/scripts/Info.targets | tr -d '[[:space:]]') ; \
$(foreach conf, $(CONFIGURATIONS), \
rm -f "bin/$(conf)/lib/xamarin.android/xbuild-frameworks/MonoAndroid/$$_latest_stable_framework"/Mono.Android.Export.* ; \
$(call MSBUILD_BINLOG,Mono.Android.Export,$(_SLN_BUILD),$(conf)) $(MSBUILD_FLAGS) src/Mono.Android.Export/Mono.Android.Export.csproj \
/p:Configuration=$(conf) $(_MSBUILD_ARGS) \
/p:AndroidApiLevel=$(firstword $(API_LEVELS)) /p:AndroidPlatformId=$(word $(firstword $(API_LEVELS)), $(ALL_PLATFORM_IDS)) \
/p:AndroidFrameworkVersion=$(firstword $(FRAMEWORKS)) || exit 1; ) \
$(foreach conf, $(CONFIGURATIONS), \
rm -f "bin/$(conf)/lib/xamarin.android/xbuild-frameworks/MonoAndroid/$$_latest_stable_framework"/OpenTK-1.0.* ; \
$(call MSBUILD_BINLOG,OpenTK,$(_SLN_BUILD),$(conf)) $(MSBUILD_FLAGS) src/OpenTK-1.0/OpenTK.csproj \
/p:Configuration=$(conf) $(_MSBUILD_ARGS) \
/p:AndroidApiLevel=$(firstword $(API_LEVELS)) /p:AndroidPlatformId=$(word $(firstword $(API_LEVELS)), $(ALL_PLATFORM_IDS)) \
/p:AndroidFrameworkVersion=$(firstword $(FRAMEWORKS)) || exit 1; )
rm -f "bin/$(CONFIGURATION)/lib/xamarin.android/xbuild-frameworks/MonoAndroid/$$_latest_stable_framework"/Mono.Android.Export.* ; \
$(call MSBUILD_BINLOG,Mono.Android.Export,$(_SLN_BUILD),$(CONFIGURATION)) $(MSBUILD_FLAGS) src/Mono.Android.Export/Mono.Android.Export.csproj \
/p:Configuration=$(CONFIGURATION) $(_MSBUILD_ARGS) \
/p:AndroidApiLevel=$(firstword $(API_LEVELS)) /p:AndroidPlatformId=$(word $(firstword $(API_LEVELS)), $(ALL_PLATFORM_IDS)) \
/p:AndroidFrameworkVersion=$(firstword $(FRAMEWORKS)) || exit 1; \
rm -f "bin/$(CONFIGURATION)/lib/xamarin.android/xbuild-frameworks/MonoAndroid/$$_latest_stable_framework"/OpenTK-1.0.* ; \
$(call MSBUILD_BINLOG,OpenTK,$(_SLN_BUILD),$(CONFIGURATION)) $(MSBUILD_FLAGS) src/OpenTK-1.0/OpenTK.csproj \
/p:Configuration=$(CONFIGURATION) $(_MSBUILD_ARGS) \
/p:AndroidApiLevel=$(firstword $(API_LEVELS)) /p:AndroidPlatformId=$(word $(firstword $(API_LEVELS)), $(ALL_PLATFORM_IDS)) \
/p:AndroidFrameworkVersion=$(firstword $(FRAMEWORKS)) || exit 1;

opentk-jcw:
$(foreach a, $(API_LEVELS), \
$(foreach conf, $(CONFIGURATIONS), \
touch bin/$(conf)/lib/xamarin.android/xbuild-frameworks/MonoAndroid/*/OpenTK-1.0.dll; \
$(call MSBUILD_BINLOG,OpenTK-JCW,$(_SLN_BUILD),$(conf)) $(MSBUILD_FLAGS) src/OpenTK-1.0/OpenTK.csproj \
/t:GenerateJavaCallableWrappers /p:Configuration=$(conf) $(_MSBUILD_ARGS) \
/p:AndroidApiLevel=$(a) /p:AndroidPlatformId=$(word $(a), $(ALL_PLATFORM_IDS)) /p:AndroidFrameworkVersion=$(word $(a), $(ALL_FRAMEWORKS)) || exit 1; ))
touch bin/$(CONFIGURATION)/lib/xamarin.android/xbuild-frameworks/MonoAndroid/*/OpenTK-1.0.dll; \
$(call MSBUILD_BINLOG,OpenTK-JCW,$(_SLN_BUILD),$(CONFIGURATION)) $(MSBUILD_FLAGS) src/OpenTK-1.0/OpenTK.csproj \
/t:GenerateJavaCallableWrappers /p:Configuration=$(CONFIGURATION) $(_MSBUILD_ARGS) \
/p:AndroidApiLevel=$(a) /p:AndroidPlatformId=$(word $(a), $(ALL_PLATFORM_IDS)) /p:AndroidFrameworkVersion=$(word $(a), $(ALL_FRAMEWORKS)) || exit 1; )
32 changes: 14 additions & 18 deletions build-tools/scripts/Packaging.mk
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,16 @@ _BUNDLE_ZIPS_EXCLUDE = \
$(ZIP_OUTPUT_BASENAME)/bin/*/bundle-*.zip

create-vsix:
$(foreach conf, $(CONFIGURATIONS), \
MONO_IOMAP=all MONO_OPTIONS="$(MONO_OPTIONS)" $(call MSBUILD_BINLOG,create-vsix) /p:Configuration=$(conf) /p:CreateVsixContainer=True \
build-tools/create-vsix/create-vsix.csproj \
$(if $(VSIX),"/p:VsixPath=$(VSIX)") \
$(if $(EXPERIMENTAL),/p:IsExperimental="$(EXPERIMENTAL)") \
$(if $(PRODUCT_COMPONENT),/p:IsProductComponent="$(PRODUCT_COMPONENT)") \
$(if $(PACKAGE_VERSION),/p:ProductVersion="$(PACKAGE_VERSION)") \
$(if $(REPO_NAME),/p:XARepositoryName="$(REPO_NAME)") \
$(if $(PACKAGE_HEAD_BRANCH),/p:XAVersionBranch="$(PACKAGE_HEAD_BRANCH)") \
$(if $(PACKAGE_VERSION_REV),/p:XAVersionCommitCount="$(PACKAGE_VERSION_REV)") \
$(if $(COMMIT),/p:XAVersionHash="$(COMMIT)") && ) \
true
MONO_IOMAP=all MONO_OPTIONS="$(MONO_OPTIONS)" $(call MSBUILD_BINLOG,create-vsix) /p:Configuration=$(CONFIGURATION) /p:CreateVsixContainer=True \
build-tools/create-vsix/create-vsix.csproj \
$(if $(VSIX),"/p:VsixPath=$(VSIX)") \
$(if $(EXPERIMENTAL),/p:IsExperimental="$(EXPERIMENTAL)") \
$(if $(PRODUCT_COMPONENT),/p:IsProductComponent="$(PRODUCT_COMPONENT)") \
$(if $(PACKAGE_VERSION),/p:ProductVersion="$(PACKAGE_VERSION)") \
$(if $(REPO_NAME),/p:XARepositoryName="$(REPO_NAME)") \
$(if $(PACKAGE_HEAD_BRANCH),/p:XAVersionBranch="$(PACKAGE_HEAD_BRANCH)") \
$(if $(PACKAGE_VERSION_REV),/p:XAVersionCommitCount="$(PACKAGE_VERSION_REV)") \
$(if $(COMMIT),/p:XAVersionHash="$(COMMIT)")

package-oss-name:
@echo ZIP_OUTPUT=$(ZIP_OUTPUT)
Expand All @@ -35,12 +33,10 @@ package-oss $(ZIP_OUTPUT):
fi
_exclude_list=".__exclude_list.txt"; \
ls -1d $(_BUNDLE_ZIPS_EXCLUDE) > "$$_exclude_list" 2>/dev/null ; \
for c in $(CONFIGURATIONS) ; do \
_sl="$(ZIP_OUTPUT_BASENAME)/bin/$$c/lib/xamarin.android/xbuild/.__sys_links.txt"; \
if [ ! -f "$$_sl" ]; then continue; fi; \
for f in `cat $$_sl` ; do \
echo "$(ZIP_OUTPUT_BASENAME)/bin/$$c/lib/xamarin.android/xbuild/$$f" >> "$$_exclude_list"; \
done; \
_sl="$(ZIP_OUTPUT_BASENAME)/bin/$(CONFIGURATION)/lib/xamarin.android/xbuild/.__sys_links.txt"; \
if [ ! -f "$$_sl" ]; then continue; fi; \
for f in `cat $$_sl` ; do \
echo "$(ZIP_OUTPUT_BASENAME)/bin/$CONFIGURATION/lib/xamarin.android/xbuild/$$f" >> "$$_exclude_list"; \
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like a typo here: $CONFIGURATION vs $(CONFIGURATION).

done
echo "Exclude List:"
cat ".__exclude_list.txt"
Expand Down