Skip to content

Commit

Permalink
Merge branch 'main' into dev/update-maccatalyst-templates
Browse files Browse the repository at this point in the history
  • Loading branch information
dustin-wojciechowski authored Mar 17, 2023
2 parents 563b0fc + 97d1eac commit 7eafa83
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 12 deletions.
23 changes: 19 additions & 4 deletions Make.config
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,31 @@ CURL = curl --fail --location --connect-timeout 15 $(if $(V),--verbose,--silent)
# --retry-all-errors: ignore the definition of insanity and retry even for errors that seem like you'd get the same result (such as 404). This isn't the real purpose, because this will also retry errors that will get a different result (such as connection failures / resets), which apparently --retry doesn't cover.
CURL_RETRY = $(CURL) --retry 20 --retry-delay 2 --retry-all-errors

DOTNET_TFM=net7.0
DOTNET_MAJOR_VERSION:=$(firstword $(subst ., ,$(subst net,,$(DOTNET_TFM))))
# calculate commit distance and store it in a file so that we don't have to re-calculate it every time make is executed.

# Support for hardcoding a commit distance start offset.
NUGET_VERSION_COMMIT_DISTANCE_START=0
NUGET_VERSION_STABLE_COMMIT_DISTANCE_START=0
#
# The default is to add X000, where X is the major .NET version: we need to
# publish different versions of our NuGets for different .NET version
# (example: we need to publish one NuGet with support for Xcode 14.3 for .NET
# 6, and another one for .NET 7) - and these need to have different versions,
# and ordered correctly (the .NET 7 version must have a higher version than
# the .NET 6 version), and ideally it would be possible to just look at the
# version to see which .NET version it's targeting. Adding X000 to the commit
# distance accomplishes all these goals (as long as the commit distance itself
# doesn't need more than 3 digits).
NUGET_VERSION_COMMIT_DISTANCE_START=$(DOTNET_MAJOR_VERSION)000
NUGET_VERSION_STABLE_COMMIT_DISTANCE_START=$(DOTNET_MAJOR_VERSION)000

-include $(TOP)/Make.config.inc
$(TOP)/Make.config.inc: $(TOP)/Make.config $(TOP)/mk/mono.mk
$(Q) cd $(TOP) && ALL_DOTNET_PLATFORMS="$(ALL_DOTNET_PLATFORMS)" ./create-make-config.sh
$(Q) cd $(TOP) && \
ALL_DOTNET_PLATFORMS="$(ALL_DOTNET_PLATFORMS)" \
NUGET_VERSION_COMMIT_DISTANCE_START=$(NUGET_VERSION_COMMIT_DISTANCE_START) \
NUGET_VERSION_STABLE_COMMIT_DISTANCE_START=$(NUGET_VERSION_STABLE_COMMIT_DISTANCE_START) \
./create-make-config.sh

include $(TOP)/Make.versions

Expand Down Expand Up @@ -600,7 +616,6 @@ else
DOTNET_BCL_VERSION=$(BUNDLED_NETCORE_PLATFORMS_PACKAGE_VERSION)
endif

DOTNET_TFM=net7.0
DOTNET_VERSION_BAND=$(firstword $(subst -, ,$(DOTNET_VERSION)))
DOTNET_VERSION_PRERELEASE_COMPONENT=$(subst $(DOTNET_VERSION_BAND),,$(DOTNET_VERSION))
DOTNET_INSTALL_NAME=dotnet-sdk-$(DOTNET_VERSION)
Expand Down
4 changes: 0 additions & 4 deletions create-make-config.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,6 @@ rm -f "$OUTPUT_FILE" "$OUTPUT"
LANG=C
export LANG

# Support for hardcoding a commit distance start offset.
NUGET_VERSION_COMMIT_DISTANCE_START=0
NUGET_VERSION_STABLE_COMMIT_DISTANCE_START=0

# Compute commit distances
printf "IOS_COMMIT_DISTANCE:=$(git log $(git blame -- ./Make.versions HEAD | grep IOS_PACKAGE_VERSION= | sed 's/ .*//' )..HEAD --oneline | wc -l | sed 's/ //g')\n" >> "$OUTPUT_FILE"
printf "MAC_COMMIT_DISTANCE:=$(git log $(git blame -- ./Make.versions HEAD | grep MAC_PACKAGE_VERSION= | sed 's/ .*//' )..HEAD --oneline | wc -l | sed 's/ //g')\n" >> "$OUTPUT_FILE"
Expand Down
1 change: 1 addition & 0 deletions src/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -1352,6 +1352,7 @@ define DotNetProjectFiles
$(DOTNET_BUILD_DIR)/projects/$(1)/$(1).csproj: dotnet.tmpl.csproj Makefile $$(wildcard $(CURDIR)/*.sources)
@mkdir -p $$(dir $$@)
@sed \
-e 's*%DOTNET_TFM%*$(DOTNET_TFM)*' \
-e 's*%PLATFORM%*$(1)*' \
-e 's*<!--%FILES%-->*$$(foreach file,$$($(2)_DOTNET_SOURCES),<Compile Include="../../../../$$(file)" Link="sources/$$(file)" />)*' \
-e 's*<!--%APIS%-->*$$(foreach file,$$($(2)_DOTNET_APIS),<None Include="../../../../$$(file)" Link="apis/$$(file)" />)*' \
Expand Down
4 changes: 2 additions & 2 deletions src/dotnet.tmpl.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
<!-- This is a project file to load in the IDE to get code completion, etc. It's not used for building the product assemblies, that happens in the makefile -->
<PropertyGroup>
<_TargetPlatform>%PLATFORM%</_TargetPlatform>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>%DOTNET_TFM%</TargetFramework>
<TargetFrameworkIdentifier>.NETCoreApp</TargetFrameworkIdentifier> <!-- this line shouldn't be necessary, but VSMac on one of my machines won't load the project otherwise -->
<OutputType>Library</OutputType>
<AssemblyName>Xamarin.iOS</AssemblyName>
<AssemblyName>Microsoft.%PLATFORM%</AssemblyName>
<SignAssembly>true</SignAssembly>
<AssemblyOriginatorKeyFile>..\..\..\..\..\product.snk</AssemblyOriginatorKeyFile>
<LangVersion>latest</LangVersion>
Expand Down
2 changes: 1 addition & 1 deletion tests/monotouch-test/ObjCRuntime/RegistrarTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2562,7 +2562,7 @@ public CtorChaining2 (int value)
[DllImport ("/usr/lib/libobjc.dylib")]
static extern IntPtr class_getInstanceMethod (IntPtr cls, IntPtr sel);

#if !MONOMAC // Registrar_OutExportDerivedClass is from fsharp tests
#if !MONOMAC || NET // Registrar_OutExportDerivedClass is from fsharp tests
[Test]
public void OutOverriddenWithoutOutAttribute ()
{
Expand Down
2 changes: 1 addition & 1 deletion tools/dotnet-linker/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ DOTNET_DIRECTORIES += \
# dotnet-linker.csproj.inc contains the dotnet_linker_dependencies variable used to determine if mtouch needs to be rebuilt or not.
dotnet-linker.csproj.inc: export BUILD_EXECUTABLE=$(DOTNET) build
dotnet-linker.csproj.inc: export BUILD_VERBOSITY=$(DOTNET_BUILD_VERBOSITY)
dotnet-linker.csproj.inc:
dotnet-linker.csproj.inc: dotnet-linker.csproj
-include dotnet-linker.csproj.inc

$(BUILD_DIR)/dotnet-linker%dll $(BUILD_DIR)/dotnet-linker%pdb: Makefile $(dotnet_linker_dependencies)
Expand Down

0 comments on commit 7eafa83

Please sign in to comment.