Skip to content

Commit

Permalink
[src/tests] Misc updates to the platform analyzer tests.
Browse files Browse the repository at this point in the history
* Allow for specifying a local path to the analyzer assemblies.
* Update the api availability test using locally built analyzers that includes
  dotnet/roslyn-analyzers#7569, because the public analyzers
  have a bug we run into *a lot*.
* Write more values in GeneratedMSBuildEditorConfig.editorconfig. This is be required
  in newer versions of the platform availability analyzer.
  • Loading branch information
rolfbjarne committed Feb 20, 2025
1 parent 50bfc04 commit f2d6d52
Show file tree
Hide file tree
Showing 4 changed files with 390 additions and 386 deletions.
2 changes: 1 addition & 1 deletion Make.config
Original file line number Diff line number Diff line change
Expand Up @@ -401,7 +401,7 @@ DOTNET_BCL_DIR:=$(abspath $(TOP)/packages/microsoft.netcore.app.ref/$(DOTNET_BCL
ifneq ($(DOTNET_BCL_DIR),$(shell ls -1d $(DOTNET_BCL_DIR) 2>/dev/null))
DOTNET_BCL_DIR:=$(abspath $(TOP)/packages/microsoft.netcore.app.ref/$(DOTNET_BCL_VERSION)/ref/net8.0)
endif
DOTNET_ANALYZERS_DIR=$(DOTNET_DIR)/sdk/$(DOTNET_VERSION_BAND)/Sdks/Microsoft.NET.Sdk/analyzers
DOTNET_ANALYZERS_DIR?=$(DOTNET_DIR)/sdk/$(DOTNET_VERSION_BAND)/Sdks/Microsoft.NET.Sdk/analyzers

# The sdk version band has the last two digits set to 0: https://github.com/dotnet/sdk/blob/22c4860dcb2cf6b123dd641cc4a87a50380759d5/src/Resolvers/Microsoft.NET.Sdk.WorkloadManifestReader/SdkDirectoryWorkloadManifestProvider.cs#L52-L53
DOTNET_MANIFEST_VERSION_BAND=$(shell echo $(DOTNET_VERSION_BAND) | sed 's/..$$/00/')
Expand Down
2 changes: 2 additions & 0 deletions src/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -459,6 +459,8 @@ $($(2)_DOTNET_BUILD_DIR)/GeneratedMSBuildEditorConfig.editorconfig: | $($(2)_DOT
$$(Q) rm -f "$$@.tmp"
$$(Q) printf "is_global = true\n" >> "$$@.tmp"
$$(Q) printf "build_property.TargetFramework = $(DOTNET_TFM)-$(3)\n" >> "$$@.tmp"
$$(Q) printf "build_property.TargetFrameworkIdentifier = .NETCoreApp\n" >> "$$@.tmp"
$$(Q) printf "build_property.TargetFrameworkVersion = v$(DOTNET_MAJOR_VERSION).0\n" >> "$$@.tmp"
$$(Q) mv "$$@.tmp" "$$@"

$($(2)_DOTNET_BUILD_DIR)/ILLink.LinkAttributes.xml: $(TOP)/src/ILLink.LinkAttributes.xml.in | $($(2)_DOTNET_BUILD_DIR)
Expand Down
Loading

0 comments on commit f2d6d52

Please sign in to comment.