Skip to content

Commit 63e7116

Browse files
committed
Merge remote-tracking branch 'origin/main' into set-trimmode-partial
2 parents 381ca5e + 77a16fc commit 63e7116

File tree

42 files changed

+198
-318
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+198
-318
lines changed

.editorconfig

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -219,6 +219,9 @@ dotnet_naming_style.camelcase.required_suffix =
219219
dotnet_naming_style.camelcase.word_separator =
220220
dotnet_naming_style.camelcase.capitalization = camel_case
221221

222+
# specify StringComparison for correctness
223+
dotnet_diagnostic.CA1309.severity = error
224+
222225
# generated code from the project
223226
[*.g.cs]
224227
generated_code = true
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: Bump global.json for dotnet/installer bumps
2+
on: pull_request_target
3+
4+
jobs:
5+
bump-global-json:
6+
name: Bump global.json
7+
runs-on: ubuntu-latest
8+
if: contains(github.event.pull_request.title, 'Update dependencies from dotnet/installer') && github.actor == 'dotnet-maestro[bot]'
9+
steps:
10+
- name: 'Checkout repo'
11+
uses: actions/checkout@v3
12+
with:
13+
fetch-depth: 0
14+
repository: ${{ github.event.pull_request.head.repo.full_name }}
15+
ref: ${{ github.event.pull_request.head.sha }}
16+
17+
- name: 'Update global.json'
18+
run: |
19+
set -exo pipefail
20+
touch Make.config.inc # create a dummy file to avoid logic we don't need executed here
21+
make global.json
22+
if git diff --exit-code -- global.json; then
23+
echo "No global.json update necessary"
24+
exit 0
25+
fi
26+
git add -- global.json
27+
git config --global user.email "github-actions@xamarin.com"
28+
git config --global user.name "GitHub Actions"
29+
git checkout "$GITHUB_HEAD_REF"
30+
git commit -m "Re-generate global.json"
31+
git push

Make.config

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -604,9 +604,8 @@ endif
604604

605605
DOTNET_TFM=net6.0
606606
DOTNET_VERSION_BAND=$(firstword $(subst -, ,$(DOTNET_VERSION)))
607-
DOTNET_TARBALL=https://dotnetcli.blob.core.windows.net/dotnet/Sdk/$(DOTNET_VERSION)/dotnet-sdk-$(DOTNET_VERSION)-osx-x64.tar.gz
608-
DOTNET_TARBALL_NAME=$(notdir $(DOTNET_TARBALL))
609-
DOTNET_DIR=$(abspath $(TOP)/builds/downloads/$(basename $(basename $(DOTNET_TARBALL_NAME))))
607+
DOTNET_INSTALL_NAME=dotnet-sdk-$(DOTNET_VERSION)
608+
DOTNET_DIR=$(abspath $(TOP)/builds/downloads/$(DOTNET_INSTALL_NAME))
610609
DOTNET=$(DOTNET_DIR)/dotnet
611610
DOTNET_BCL_DIR:=$(abspath $(TOP)/packages/microsoft.netcore.app.ref/$(DOTNET_BCL_VERSION)/ref/$(DOTNET_TFM))
612611

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ endif
6161
all-local:: global.json
6262

6363
# This tells NuGet to use the exact same dotnet version we've configured in Make.config
64-
global.json: $(TOP)/Make.config.inc Makefile $(TOP)/.git/HEAD $(TOP)/.git/index
64+
global.json: $(TOP)/dotnet.config Makefile $(TOP)/.git/HEAD $(TOP)/.git/index
6565
$(Q_GEN) \
6666
printf "{\n" > $@; \
6767
printf " \"sdk\": {\n \"version\": \"$(DOTNET_VERSION)\"\n }\n" >> $@; \

builds/Makefile

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,12 @@ PREFIX=$(abspath $(IOS_DESTDIR)/$(MONOTOUCH_PREFIX)/)
66
# Keep all intermediate files always.
77
.SECONDARY:
88

9+
ifeq ($(shell arch),arm64)
10+
DOTNET_ARCH=arm64
11+
else
12+
DOTNET_ARCH=x64
13+
endif
14+
915
##
1016
## Mono download vs. build
1117
##
@@ -19,7 +25,6 @@ download-mono: \
1925
downloads/$(basename $(MONO_IOS_FILENAME)): MONO_URL=$(MONO_IOS_URL)
2026
downloads/$(basename $(MONO_MAC_FILENAME)): MONO_URL=$(MONO_MAC_URL)
2127
downloads/$(basename $(MONO_MACCATALYST_FILENAME)): MONO_URL=$(MONO_MACCATALYST_URL)
22-
downloads/$(DOTNET_TARBALL_NAME): MONO_URL=$(DOTNET_TARBALL)
2328

2429
include $(TOP)/mk/colors.mk
2530

@@ -72,17 +77,17 @@ downloads/%: downloads/%.nupkg
7277
$(Q) mv $@.tmp $@
7378
$(Q) echo "Unzipped $*."
7479

75-
downloads/$(basename $(basename $(DOTNET_TARBALL_NAME))): dotnet-install.sh
80+
downloads/$(DOTNET_INSTALL_NAME): dotnet-install.sh
7681
$(Q) echo "Downloading and installing .NET $(DOTNET_VERSION) into $@..."
77-
$(Q) ./dotnet-install.sh --install-dir "$@.tmp" --version "$(DOTNET_VERSION)" --architecture x64 --no-path $$DOTNET_INSTALL_EXTRA_ARGS
82+
$(Q) ./dotnet-install.sh --install-dir "$@.tmp" --version "$(DOTNET_VERSION)" --architecture $(DOTNET_ARCH) --no-path $$DOTNET_INSTALL_EXTRA_ARGS
7883
$(Q) rm -Rf "$@"
7984
$(Q) mv "$@.tmp" "$@"
8085
$(Q) echo "Downloaded and installed .NET $(DOTNET_VERSION) into $@."
8186

8287
# This is just a helpful target to print the url to the .pkg to download and install the current .NET version into the system.
8388
print-dotnet-pkg-urls: dotnet-install.sh
8489
$(Q) rm -f $@-found-it.stamp
85-
$(Q) for url in $$(./dotnet-install.sh --version "$(DOTNET_VERSION)" --architecture x64 --no-path $$DOTNET_INSTALL_EXTRA_ARGS --dry-run | grep URL.*primary: | sed 's/.*primary: //'); do \
90+
$(Q) for url in $$(./dotnet-install.sh --version "$(DOTNET_VERSION)" --architecture $(DOTNET_ARCH) --no-path $$DOTNET_INSTALL_EXTRA_ARGS --dry-run | grep URL.*primary: | sed 's/.*primary: //'); do \
8691
pkg=$${url/tar.gz/pkg}; \
8792
if curl -LI --fail "$$pkg" >/dev/null 2>&1; then echo "$$pkg"; touch $@-found-it.stamp; break; fi; \
8893
done
@@ -126,7 +131,7 @@ DOWNLOAD_DOTNET_VERSION=$(BUNDLED_NETCORE_PLATFORMS_PACKAGE_VERSION)
126131
endif
127132
endif
128133

129-
.stamp-download-dotnet-packages: $(TOP)/Make.config downloads/$(basename $(basename $(DOTNET_TARBALL_NAME)))
134+
.stamp-download-dotnet-packages: $(TOP)/Make.config downloads/$(DOTNET_INSTALL_NAME)
130135
$(Q_GEN) cd package-download && $(DOTNET) \
131136
build \
132137
download-packages.proj \
@@ -139,8 +144,8 @@ endif
139144
/p:ToolChainManifestVersionBand="$(TOOLCHAIN_MANIFEST_VERSION_BAND)" \
140145
/bl \
141146
$(DOTNET_BUILD_VERBOSITY)
142-
$(Q) $(CP) $(TOP)/packages/microsoft.net.workload.mono.toolchain.manifest-$(TOOLCHAIN_MANIFEST_VERSION_BAND)/$(DOWNLOAD_DOTNET_VERSION)/data/WorkloadManifest.* ./downloads/dotnet-sdk-$(DOTNET_VERSION)-osx-x64/sdk-manifests/$(DOTNET_MANIFEST_VERSION_BAND)/microsoft.net.workload.mono.toolchain/
143-
$(Q) $(CP) $(TOP)/packages/microsoft.net.workload.emscripten.manifest-$(TOOLCHAIN_MANIFEST_VERSION_BAND)/$(EMSCRIPTEN_MANIFEST_PACKAGE_VERSION)/data/WorkloadManifest.* ./downloads/dotnet-sdk-$(DOTNET_VERSION)-osx-x64/sdk-manifests/$(DOTNET_MANIFEST_VERSION_BAND)/microsoft.net.workload.emscripten/
147+
$(Q) $(CP) $(TOP)/packages/microsoft.net.workload.mono.toolchain.manifest-$(TOOLCHAIN_MANIFEST_VERSION_BAND)/$(DOWNLOAD_DOTNET_VERSION)/data/WorkloadManifest.* ./downloads/$(DOTNET_INSTALL_NAME)/sdk-manifests/$(DOTNET_MANIFEST_VERSION_BAND)/microsoft.net.workload.mono.toolchain/
148+
$(Q) $(CP) $(TOP)/packages/microsoft.net.workload.emscripten.manifest-$(TOOLCHAIN_MANIFEST_VERSION_BAND)/$(EMSCRIPTEN_MANIFEST_PACKAGE_VERSION)/data/WorkloadManifest.* ./downloads/$(DOTNET_INSTALL_NAME)/sdk-manifests/$(DOTNET_MANIFEST_VERSION_BAND)/microsoft.net.workload.emscripten/
144149
$(Q) touch $@
145150

146151
.stamp-install-t4: $(TOP)/.config/dotnet-tools.json .stamp-download-dotnet-packages
@@ -152,7 +157,7 @@ endif
152157
BundledNETCorePlatformsPackageVersion.txt: .stamp-download-dotnet-packages
153158

154159
DOTNET_DOWNLOADS = \
155-
downloads/$(basename $(basename $(DOTNET_TARBALL_NAME))) \
160+
downloads/$(DOTNET_INSTALL_NAME) \
156161
.stamp-download-dotnet-packages \
157162
.stamp-install-t4 \
158163

dotnet/.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,10 @@ tmpdir
22
Workloads/Microsoft.NET.Sdk.*/LICENSE
33
WorkloadManifest.json
44
nupkgs
5+
Microsoft.*.Sdk/targets/Microsoft.*.Sdk.ImplicitNamespaceImports.props
56
Microsoft.*.Sdk/targets/Microsoft.*.Sdk.SupportedTargetPlatforms.props
67
Microsoft.*.Sdk/targets/Microsoft.*.Sdk.DefaultItems.props
78
Microsoft.*.Sdk/targets/Microsoft.*.Sdk.Versions.props
9+
Microsoft.*.Sdk/Sdk/AutoImport.props
810
_pkg
911
.stamp-*

dotnet/Makefile

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,11 @@ DOTNET_PLATFORMS_UPPERCASE:=$(shell echo $(DOTNET_PLATFORMS) | tr a-z A-Z)
1313
# Create variables prefixed with the correctly cased platform name from the upper-cased platform name. This makes some of the next sections somewhat simpler.
1414
$(foreach platform,$(DOTNET_PLATFORMS),$(eval $(platform)_NUGET_VERSION_NO_METADATA:=$($(shell echo $(platform) | tr a-z A-Z)_NUGET_VERSION_NO_METADATA)))
1515

16+
DOTNET_iOS_GLOBAL_USINGS=CoreGraphics Foundation UIKit
17+
DOTNET_tvOS_GLOBAL_USINGS=CoreGraphics Foundation UIKit
18+
DOTNET_MacCatalyst_GLOBAL_USINGS=CoreGraphics Foundation UIKit
19+
DOTNET_macOS_GLOBAL_USINGS=AppKit CoreGraphics Foundation
20+
1621
define DefineTargets
1722
$(1)_NUGET_TARGETS = \
1823
$(DOTNET_DESTDIR)/Microsoft.$(1).Sdk/data/UnixFilePermissions.xml \
@@ -101,14 +106,37 @@ Microsoft.$1.Sdk/targets/Microsoft.$1.Sdk.Versions.props: targets/Microsoft.$1.S
101106
endef
102107
$(foreach platform,$(DOTNET_PLATFORMS),$(eval $(call VersionsTemplate,$(platform),$(shell echo $(platform) | tr a-z A-Z),$(DOTNET_$(shell echo $(platform) | tr a-z A-Z)_RUNTIME_IDENTIFIERS))))
103108

109+
define AutoImports
110+
Microsoft.$(1).Sdk/Sdk/AutoImport.props: targets/AutoImport.template.props Makefile
111+
$(Q) rm -f $$@.tmp
112+
$$(Q_GEN) sed \
113+
-e "s/@PLATFORM@/$(1)/g" \
114+
$$< > $$@.tmp
115+
$(Q) mv $$@.tmp $$@
116+
endef
117+
$(foreach platform,$(DOTNET_PLATFORMS),$(eval $(call AutoImports,$(platform))))
118+
104119
define DefaultItems
105120
Microsoft.$1.Sdk/targets/Microsoft.$1.Sdk.DefaultItems.props: targets/Microsoft.Sdk.DefaultItems.template.props Makefile
106121
$$(Q_GEN) sed \
107122
-e "s/@PLATFORM@/$1/g" \
123+
-e "s/@TARGET_FRAMEWORK_VERSION@/$(subst net,,$(DOTNET_TFM))/g" \
108124
$$< > $$@
109125
endef
110126
$(foreach platform,$(DOTNET_PLATFORMS),$(eval $(call DefaultItems,$(platform))))
111127

128+
define ImplicitNamespaceImports
129+
Microsoft.$1.Sdk/targets/Microsoft.$1.Sdk.ImplicitNamespaceImports.props: targets/Microsoft.Sdk.ImplicitNamespaceImports.template.props Makefile
130+
$$(Q_GEN) sed \
131+
-e "s/@PLATFORM@/$1/g" \
132+
-e "s/@TARGET_FRAMEWORK_VERSION@/$(subst net,,$(DOTNET_TFM))/g" \
133+
-e "s/@GLOBAL_USINGS@/$(2)/g" \
134+
$$< > $$@
135+
x:: Microsoft.$1.Sdk/targets/Microsoft.$1.Sdk.ImplicitNamespaceImports.props
136+
cat Microsoft.$1.Sdk/targets/Microsoft.$1.Sdk.ImplicitNamespaceImports.props
137+
endef
138+
$(foreach platform,$(DOTNET_PLATFORMS),$(eval $(call ImplicitNamespaceImports,$(platform),$(foreach using,$(DOTNET_$(platform)_GLOBAL_USINGS),\n\t\t<Using Include=\"$(using)\" Platform=\"$(platform)\" \/>))))
139+
112140
define SupportedTargetPlatforms
113141
Microsoft.$(1).Sdk/targets/Microsoft.$(1).Sdk.SupportedTargetPlatforms.props: $(TOP)/Versions-ios.plist.in $(TOP)/Versions-mac.plist.in Makefile ./generate-target-platforms.csharp Makefile
114142
$(Q) rm -f $$@.tmp

dotnet/Microsoft.MacCatalyst.Sdk/Sdk/AutoImport.props

Lines changed: 0 additions & 4 deletions
This file was deleted.

dotnet/Microsoft.iOS.Sdk/Sdk/AutoImport.props

Lines changed: 0 additions & 4 deletions
This file was deleted.

dotnet/Microsoft.macOS.Sdk/Sdk/AutoImport.props

Lines changed: 0 additions & 4 deletions
This file was deleted.

0 commit comments

Comments
 (0)