Skip to content

Commit c015e7a

Browse files
[dotnet] use **FromWorkload** for targeting/runtime pack versions
Context: dotnet/sdk#19596 Context: dotnet/android#6184 If we use the version number string of `**FromWorkload**`, then our runtime packages don't need to be resolved from a NuGet feed. They can be resolved from the `dotnet/packs` directory. This completely eliminates the need for a `NuGet.config` file when building a .NET 6 app with a local build of the xamarin-macios. You will no longer need a feed such as: <add key="local-dotnet-feed" value="~/src/xamarin-macios/_build/nuget-feed" />
1 parent 243cc40 commit c015e7a

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

dotnet/Makefile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ nupkgs/$(1)$(4).$(2).nupkg: $(TEMPLATED_FILES) $(WORKLOAD_TARGETS) $(3) package/
168168
@# Clean the local feed
169169
$$(Q_NUGET_DEL) if test -d $(DOTNET_FEED_DIR)/$(shell echo $(1) | tr A-Z a-z)/$(2); then nuget delete $(1) $(2) -source $(abspath $(DOTNET_FEED_DIR)) -NonInteractive $(NUGET_VERBOSITY); fi
170170
@# Add the nupkg to our local feed
171-
$$(Q_NUGET_ADD) nuget add "$$@" -source $(DOTNET_FEED_DIR) -NonInteractive $(NUGET_VERBOSITY)
171+
$$(Q_NUGET_ADD) nuget add "$$@" -source $(abspath $(DOTNET_FEED_DIR)) -NonInteractive $(NUGET_VERBOSITY)
172172
endef
173173

174174
define CreateWindowsNuGetTemplate
@@ -363,6 +363,7 @@ export DOTNETSDK_WORKLOAD_MANIFEST_ROOTS:=$(abspath ./Workloads)
363363
@# The microsoft.net.sdk.maui workload has a reference to the microsoft-ios-sdk-full workload, which has been renamed, so 'dotnet workload install' fails. Just remove the maui workload, we don't need it here.
364364
$(Q) rm -Rf $(DOTNET6_DIR)/sdk-manifests/6.0.100/microsoft.net.sdk.maui
365365
$(Q) cd Workloads && $(DOTNET6) workload install --skip-manifest-update \
366+
--source $(DOTNET_FEED_DIR) --verbosity diag \
366367
$(foreach platform,$(DOTNET_PLATFORMS),$(shell echo $(platform) | tr A-Z a-z))
367368
$(Q) touch $@
368369

dotnet/targets/Xamarin.Shared.Sdk.DefaultItems.targets

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -85,10 +85,10 @@
8585
<KnownFrameworkReference Include="Microsoft.$(_PlatformName)"
8686
TargetFramework="net6.0"
8787
RuntimeFrameworkName="Microsoft.$(_PlatformName)"
88-
DefaultRuntimeFrameworkVersion="$(_ShortPackageVersion)"
89-
LatestRuntimeFrameworkVersion="$(_ShortPackageVersion)"
88+
DefaultRuntimeFrameworkVersion="**FromWorkload**"
89+
LatestRuntimeFrameworkVersion="**FromWorkload**"
9090
TargetingPackName="Microsoft.$(_PlatformName).Ref"
91-
TargetingPackVersion="$(_ShortPackageVersion)"
91+
TargetingPackVersion="**FromWorkload**"
9292
RuntimePackNamePatterns="Microsoft.$(_PlatformName).Runtime.**RID**"
9393
RuntimePackRuntimeIdentifiers="$(_RuntimePackRuntimeIdentifiers)"
9494
Profile="$(_PlatformName)"

tests/dotnet/Makefile

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ include $(TOP)/Make.config
66
# and to put any extracted packages in the 'packages' directory (to not clutter up ~/.nuget/packages)
77
NuGet.config: $(TOP)/NuGet.config Makefile
88
$(Q) $(CP) $< $@.tmp
9-
$(Q) nuget sources add -Name local-dotnet-feed -Source $(abspath $(DOTNET_FEED_DIR)) -ConfigFile $@.tmp
109
ifdef CUSTOM_DOTNET
1110
$(Q) nuget sources add -Name dev-runtime-feed -Source $(abspath $(DOTNET_RUNTIME_PATH)/artifacts/packages/Release/Shipping) -ConfigFile [email protected]
1211
endif

0 commit comments

Comments
 (0)