Skip to content

Commit 212d7de

Browse files
authored
[Android] Use lowered runtime flavor in Android sample app MakeFile #112940
Use lowered runtime flavor in Android sample app MakeFile and abort for unrecognized RUNTIME_FLAVOR. The previous behavior only accepted "Mono" as a RUNTIME_FLAVOR for building the runtimepack. This could cause unwanted behavior where passing RUNTIME_FLAVOR=mono would lead to building CoreCLR packs instead.
1 parent 6b8fb08 commit 212d7de

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

src/mono/sample/Android/Makefile

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ AOT=false
66
AOT_WITH_LIBRARY_FILES=false
77
INTERP=false
88
DEPLOY_AND_RUN?=true
9-
RUNTIME_FLAVOR?=Mono
9+
RUNTIME_FLAVOR?=mono
1010
R2R?=false
1111
R2R_COMPOSITE?=false
1212

@@ -22,18 +22,23 @@ REPO_DIR=$(realpath $(TOP))
2222
TASKS_DIR=$(REPO_DIR)/src/tasks
2323
DOTNET=$(REPO_DIR)/dotnet.sh
2424
BUILD_SCRIPT=$(REPO_DIR)/build.sh
25+
RUNTIME_FLAVOR_LOWER := $(shell echo $(RUNTIME_FLAVOR) | tr '[:upper:]' '[:lower:]')
2526

2627
all: appbuilder runtimepack run
2728

2829
appbuilder:
2930
$(DOTNET) build -c $(BUILD_CONFIG) $(TASKS_DIR)/AndroidAppBuilder/AndroidAppBuilder.csproj
3031

31-
ifeq ($(RUNTIME_FLAVOR),Mono)
32+
ifeq ($(RUNTIME_FLAVOR_LOWER),mono)
3233
runtimepack:
3334
$(BUILD_SCRIPT) mono+libs -os android -arch $(TARGET_ARCH) -c $(BUILD_CONFIG) -bl
34-
else
35+
else ifeq ($(RUNTIME_FLAVOR_LOWER),coreclr)
3536
runtimepack:
3637
$(BUILD_SCRIPT) clr.runtime+clr.alljits+clr.corelib+clr.nativecorelib+clr.tools+clr.packages+libs -os android -arch $(TARGET_ARCH) -c $(BUILD_CONFIG) -bl
38+
else
39+
runtimepack:
40+
@echo "Invalid RUNTIME_FLAVOR: $(RUNTIME_FLAVOR)"
41+
@exit 1
3742
endif
3843

3944
run: appbuilder

0 commit comments

Comments
 (0)