diff --git a/.github/workflows/linux-build.yml b/.github/workflows/linux-build.yml
new file mode 100644
index 000000000000..10a2b5d4b826
--- /dev/null
+++ b/.github/workflows/linux-build.yml
@@ -0,0 +1,29 @@
+# yamllint disable rule:line-length rule:document-start rule:truthy
+name: Linux Build Verification
+on:
+ pull_request:
+
+permissions:
+ contents: read
+
+jobs:
+ linux-build:
+ name: Verify Linux Build
+ runs-on: ubuntu-latest
+
+ steps:
+ - name: 'Checkout'
+ uses: actions/checkout@v4
+ with:
+ fetch-depth: 0
+ submodules: recursive
+
+ - name: Check system dependencies
+ run: |
+ set -ex
+ ./system-dependencies.sh
+
+ - name: Build on Linux
+ run: |
+ set -ex
+ make -j$(nproc)
diff --git a/.gitignore b/.gitignore
index d7c8df4a40a7..8c0e0cdbd87a 100644
--- a/.gitignore
+++ b/.gitignore
@@ -3,6 +3,7 @@ Make.config.inc
Make.config.local
configure.inc
dotnet.config
+ProjectInspector.csproj
_ios-build
_mac-build
_build
diff --git a/.gitmodules b/.gitmodules
index a511bbb0ff18..2cdc601ebed1 100644
--- a/.gitmodules
+++ b/.gitmodules
@@ -1,5 +1,5 @@
[submodule "external/Xamarin.MacDev"]
path = external/Xamarin.MacDev
- url = ../../dotnet/macios-devtools
+ url = https://github.com/dotnet/macios-devtools
branch = main
diff --git a/Directory.Build.props b/Directory.Build.props
index 233b895ed7c0..d16e14e619ba 100644
--- a/Directory.Build.props
+++ b/Directory.Build.props
@@ -8,7 +8,11 @@
$(MicrosoftBuildPackageVersion)
$(MicrosoftBuildPackageVersion)
$(MicrosoftBuildPackageVersion)
+ 4.4.0
+ 3.22.0
+ 6.1.0
3.1.15
+ 18.0.1
4.7.2
diff --git a/Make.config b/Make.config
index 34026f4745dc..86a7f6a05e4e 100644
--- a/Make.config
+++ b/Make.config
@@ -1,5 +1,11 @@
include $(TOP)/mk/subdirs.mk
+# Detect if we're building on Linux
+UNAME_S:=$(shell uname -s)
+ifeq ($(UNAME_S),Linux)
+IS_LINUX=1
+endif
+
# Common cURL command:
# --fail: return an exit code if the connection succeeded, but returned an HTTP error code.
# --location: follow redirects
@@ -203,6 +209,7 @@ MACCATALYST_NUGET_VERSION_FULL=$(MACCATALYST_NUGET_VERSION_NO_METADATA)$(NUGET_B
# Xcode version should have both a major and a minor version (even if the minor version is 0)
XCODE_VERSION=26.2
XCODE_URL=https://dl.internalx.com/internal-files/xcodes/Xcode_26.2.xip
+ifndef IS_LINUX
XCODE_DEVELOPER_ROOT=/Applications/Xcode_26.2.0.app/Contents/Developer
XCODE_PRODUCT_BUILD_VERSION:=$(shell /usr/libexec/PlistBuddy -c 'Print :ProductBuildVersion' $(XCODE_DEVELOPER_ROOT)/../version.plist 2>/dev/null || echo " $(shell tput setaf 1 2>/dev/null)The required Xcode ($(XCODE_VERSION)) is not installed in $(basename $(basename $(XCODE_DEVELOPER_ROOT)))$(shell tput sgr0 2>/dev/null)" >&2)
@@ -224,6 +231,12 @@ endif
# Tell both Xcode and our build logic which Xcode we're using.
export DEVELOPER_DIR=$(XCODE_DEVELOPER_ROOT)
export MD_APPLE_SDK_ROOT=$(abspath $(XCODE_DEVELOPER_ROOT)/../..)
+else
+# On Linux, set placeholder Xcode values
+XCODE_PRODUCT_BUILD_VERSION=
+XCODE_IS_STABLE=true
+XCODE_IS_PREVIEW=false
+endif
# We don't need to be told there are workload updates
export DOTNET_CLI_WORKLOAD_UPDATE_NOTIFY_DISABLE=true
diff --git a/Makefile b/Makefile
index b50fb6017049..1402617f1220 100644
--- a/Makefile
+++ b/Makefile
@@ -3,6 +3,11 @@ SUBDIRS=builds runtime src msbuild tools
include $(TOP)/Make.config
include $(TOP)/mk/versions.mk
+# On Linux, skip directories that require native compilation
+ifdef IS_LINUX
+SUBDIRS := $(filter-out runtime,$(SUBDIRS))
+endif
+
SUBDIRS += dotnet
#
diff --git a/NuGet.config b/NuGet.config
index 0ec82d8d8f7f..ec1c56c185ee 100644
--- a/NuGet.config
+++ b/NuGet.config
@@ -10,10 +10,10 @@
-
+
-
+
@@ -38,10 +38,14 @@
+
+
+
+
diff --git a/builds/Makefile b/builds/Makefile
index 30d12f112f01..f82a4ed63fe6 100644
--- a/builds/Makefile
+++ b/builds/Makefile
@@ -25,7 +25,8 @@ downloads/$(DOTNET_INSTALL_NAME): dotnet-install.sh
tar -xzf $(DOTNET_CACHE_FILENAME) -C "$@.tmp"; \
else \
./dotnet-install.sh --install-dir "$@.tmp" --version "$(DOTNET_VERSION)" --architecture $(DOTNET_ARCH) --no-path --keep-zip --zip-path "downloads/$(DOTNET_FILENAME)" $$DOTNET_INSTALL_EXTRA_ARGS; \
- cp -c downloads/$(DOTNET_FILENAME) $(DOTNET_CACHE_FILENAME); \
+ mkdir -p $$(dirname $(DOTNET_CACHE_FILENAME)); \
+ $(CP) downloads/$(DOTNET_FILENAME) $(DOTNET_CACHE_FILENAME); \
echo "Cached the download of $(DOTNET_FILENAME) in ~/Library/Caches/xamarin-macios"; \
fi
$(Q) rm -Rf "$@"
diff --git a/builds/create-csproj-for-all-packagereferences.sh b/builds/create-csproj-for-all-packagereferences.sh
index 7fee50e75cab..16579b153de0 100755
--- a/builds/create-csproj-for-all-packagereferences.sh
+++ b/builds/create-csproj-for-all-packagereferences.sh
@@ -4,6 +4,13 @@ WHITE=$(tput setaf 7 || true)
RED=$(tput setaf 9 || true)
CLEAR=$(tput sgr0 || true)
+# Detect the OS to use the right sed syntax
+if [[ "$(uname -s)" == "Darwin" ]]; then
+ SED_INPLACE="sed -i ''"
+else
+ SED_INPLACE="sed -i"
+fi
+
OUTPUTPATH=
while [[ $# -gt 0 ]]; do
case $1 in
@@ -35,7 +42,7 @@ while [[ $# -gt 0 ]]; do
esac
done
-TMPPATH=$(PWD)/packagereferences.tmp.csproj
+TMPPATH="$PWD/packagereferences.tmp.csproj"
# Go to the root directory
cd "$(git rev-parse --show-toplevel)"
@@ -44,16 +51,16 @@ cd "$(git rev-parse --show-toplevel)"
git grep -e '' -h > "$TMPPATH"
# Replace double double quotes with a single double quote. This happens in source code that generates project files (for tests).
-sed -i '' 's/""/"/g' "$TMPPATH"
+$SED_INPLACE 's/""/"/g' "$TMPPATH"
# Remove packages that we build locally
-sed -i '' '/Xamarin.Tests.FrameworksInRuntimesNativeDirectory/d' "$TMPPATH"
-sed -i '' '/Xamarin.Tests.DynamicLibrariesInRuntimesNativeDirectory/d' "$TMPPATH"
-sed -i '' '/Xamarin.Tests.XCFrameworkWithStaticLibraryInRuntimesNativeDirectory/d' "$TMPPATH"
-sed -i '' '/Xamarin.Tests.XCFrameworkWithSymlinks/d' "$TMPPATH"
+$SED_INPLACE '/Xamarin.Tests.FrameworksInRuntimesNativeDirectory/d' "$TMPPATH"
+$SED_INPLACE '/Xamarin.Tests.DynamicLibrariesInRuntimesNativeDirectory/d' "$TMPPATH"
+$SED_INPLACE '/Xamarin.Tests.XCFrameworkWithStaticLibraryInRuntimesNativeDirectory/d' "$TMPPATH"
+$SED_INPLACE '/Xamarin.Tests.XCFrameworkWithSymlinks/d' "$TMPPATH"
# Get only the name and version of each package, and write that back in a PackageDownload item
-sed -i '' 's@.*.*@\t\t@g' "$TMPPATH"
+$SED_INPLACE 's@.*.*@\t\t@g' "$TMPPATH"
# Sort the references and only list each once.
sort -u -o "$TMPPATH" "$TMPPATH"
diff --git a/create-make-config.sh b/create-make-config.sh
index e5f581a73631..0bcd5739034c 100755
--- a/create-make-config.sh
+++ b/create-make-config.sh
@@ -14,13 +14,13 @@ export LANG
# Compute commit distances
for platform in $ALL_DOTNET_PLATFORMS; do
PLATFORM=$(echo "$platform" | tr '[:lower:]' '[:upper:]')
- COMMIT=$(git blame -- ./Make.versions HEAD | grep "${PLATFORM}_NUGET_OS_VERSION=" | sed 's/ .*//')
+ COMMIT=$(git blame -- ./Make.versions HEAD | grep "${PLATFORM}_NUGET_OS_VERSION=" | sed 's/ .*//' | sed 's/^\^//')
COMMIT_DISTANCE=$(git log "$COMMIT..HEAD" --oneline | wc -l | sed -e 's/ //g')
TOTAL_DISTANCE=$((NUGET_VERSION_COMMIT_DISTANCE_START+COMMIT_DISTANCE))
printf "${PLATFORM}_NUGET_COMMIT_DISTANCE:=$TOTAL_DISTANCE\\n" >> "$OUTPUT_FILE"
done
-STABLE_COMMIT=$(git blame -L '/^[#[:blank:]]*NUGET_RELEASE_BRANCH=/,+1' -- ./Make.config HEAD | sed 's/ .*//')
+STABLE_COMMIT=$(git blame -L '/^[#[:blank:]]*NUGET_RELEASE_BRANCH=/,+1' -- ./Make.config HEAD | sed 's/ .*//' | sed 's/^\^//')
STABLE_COMMIT_DISTANCE=$(git log "$STABLE_COMMIT..HEAD" --oneline | wc -l | sed -e 's/ //g')
STABLE_TOTAL_DISTANCE=$((STABLE_COMMIT_DISTANCE+NUGET_VERSION_STABLE_COMMIT_DISTANCE_START))
diff --git a/docs/building-apps/build-properties.md b/docs/building-apps/build-properties.md
index 6ead612bd047..8e9f5d456697 100644
--- a/docs/building-apps/build-properties.md
+++ b/docs/building-apps/build-properties.md
@@ -344,6 +344,20 @@ Only applicable to macOS and Mac Catalyst projects.
See [BuildIpa](#buildipa) for iOS and tvOS projects.
+## Device
+
+Specifies which mobile device or emulator to target when using `dotnet run
+--device ` or MSBuild targets that interact with devices (such as
+`Run`, `Install`, or `Uninstall`).
+
+The value can be anything the command-line tools `simctl` or `devicectl`
+accept for the device name; this is typically either the UDID or the name of
+the device. For example, for the device `My iOS Device` with UDID `00001111-012301230123ABCD`, use
+either `-p:Device="My iOS Device"` or `-p:Device=00001111-012301230123ABCD`.
+
+For more information about device selection, see the
+[.NET SDK device selection specification](https://github.com/dotnet/sdk/blob/2b9fc02a265c735f2132e4e3626e94962e48bdf5/documentation/specs/dotnet-run-for-maui.md).
+
## DeviceSpecificBuild
If the build should be specific to the selected device.
diff --git a/docs/building-apps/build-targets.md b/docs/building-apps/build-targets.md
index fb548e6691ce..86a0ff27503a 100644
--- a/docs/building-apps/build-targets.md
+++ b/docs/building-apps/build-targets.md
@@ -16,11 +16,39 @@ Builds the source code within a project and all dependencies.
Removes all files generated by the build process.
+## ComputeAvailableDevices
+
+Queries and returns a list of available iOS or tvOS devices and simulators that can be used with `dotnet run`.
+
+This target is called automatically by the .NET SDK's `dotnet run` command to
+support device selection via the `--device` option. It returns a `@(Devices)`
+item group where each device has the following metadata:
+
+- **Description**: The name of the device (e.g., "iPhone 16 - iOS 26.0" for simulators, "My iPhone 16" for physical devices)
+- **Type**: Either "Device" or "Simulator"
+- **OSVersion**: The OS version of the device
+- **UDID**: The UDID of the device
+- **RuntimeIdentifier**: The RuntimeIdentifier of the device
+
+For example, to list all available devices:
+
+```shell
+$ dotnet build -t:ComputeAvailableDevices
+```
+
+This target is part of the [.NET SDK device selection specification](https://github.com/dotnet/sdk/blob/2b9fc02a265c735f2132e4e3626e94962e48bdf5/documentation/specs/dotnet-run-for-maui.md) and enables commands like:
+
+```shell
+$ dotnet run --device UDID
+```
+
+Added in .NET 11.
+
## Run
Builds the source code within a project and all dependencies, and then deploys and runs it
-on a default simulator/device. A specific deployment target can be set by using the `$(_DeviceName)` property.
+on a default simulator/device. A specific deployment target can be set by using the `$(Device)` property.
```dotnetcli
-dotnet build -t:Run project.csproj -p:_DeviceName=$(MY_DEVICE_UDID)
+dotnet build -t:Run project.csproj -p:Device=$(MY_DEVICE_UDID)
```
diff --git a/dotnet/Makefile b/dotnet/Makefile
index 5c92eaa1beee..b8729d992617 100644
--- a/dotnet/Makefile
+++ b/dotnet/Makefile
@@ -33,7 +33,9 @@ $(1)_NUGET_TARGETS = \
$(DOTNET_DESTDIR)/$($(1)_NUGET_SDK_NAME)/targets/Microsoft.$(1).Sdk.props \
$(DOTNET_DESTDIR)/$($(1)_NUGET_SDK_NAME)/targets/Microsoft.$(1).Sdk.Versions.props \
$(DOTNET_DESTDIR)/$($(1)_NUGET_SDK_NAME)/targets/Microsoft.$(1).Sdk.targets \
+ $(DOTNET_DESTDIR)/$($(1)_NUGET_SDK_NAME)/targets/Microsoft.Sdk.Desktop.targets \
$(DOTNET_DESTDIR)/$($(1)_NUGET_SDK_NAME)/targets/Microsoft.Sdk.Eol.targets \
+ $(DOTNET_DESTDIR)/$($(1)_NUGET_SDK_NAME)/targets/Microsoft.Sdk.Mobile.targets \
$(DOTNET_DESTDIR)/$($(1)_NUGET_SDK_NAME)/targets/Xamarin.Shared.Sdk.DefaultItems.targets \
$(DOTNET_DESTDIR)/$($(1)_NUGET_SDK_NAME)/targets/Xamarin.Shared.Sdk.Publish.targets \
$(DOTNET_DESTDIR)/$($(1)_NUGET_SDK_NAME)/targets/Xamarin.Shared.Sdk.TargetFrameworkInference.props \
diff --git a/dotnet/targets/Microsoft.Sdk.Desktop.targets b/dotnet/targets/Microsoft.Sdk.Desktop.targets
new file mode 100644
index 000000000000..c963d184024f
--- /dev/null
+++ b/dotnet/targets/Microsoft.Sdk.Desktop.targets
@@ -0,0 +1,28 @@
+
+
+
+
+
+ <_OpenArguments Condition="'$(XamarinDebugMode)' != ''">$(_OpenArguments) --env __XAMARIN_DEBUG_MODE__=$(XamarinDebugMode)
+ <_OpenArguments Condition="'$(XamarinDebugPort)' != ''">$(_OpenArguments) --env __XAMARIN_DEBUG_PORT__=$(XamarinDebugPort)
+ <_OpenArguments Condition="'$(XamarinDebugHosts)' != ''">$(_OpenArguments) --env "__XAMARIN_DEBUG_HOSTS__=$(XamarinDebugHosts)"
+ <_OpenArguments Condition="'$(XamarinDebugConnectTimeout)' != ''">$(_OpenArguments) --env __XAMARIN_DEBUG_CONNECT_TIMEOUT__=$(XamarinDebugConnectTimeout)
+ <_OpenArguments Condition="'$(StandardOutputPath)' != ''">$(_OpenArguments) --stdout "$(StandardOutputPath)"
+ <_OpenArguments Condition="'$(StandardErrorPath)' != ''">$(_OpenArguments) --stderr "$(StandardErrorPath)"
+ <_OpenArguments Condition="'$(StandardInputPath)' != ''">$(_OpenArguments) --stdin "$(StandardInputPath)"
+ <_OpenArgumentsPre Condition="'$(OpenNewInstance)' == 'true'">-n
+ <_OpenArgumentsPre Condition="'$(OpenWaitForExit)' == 'true'">$(_OpenArgumentsPre) -W
+ <_OpenArguments>$(_OpenArguments) $(RunEnvironment)
+ open
+ $(_OpenArgumentsPre) -a "$(TargetDir)/$(_AppBundleName).app" $(OpenArguments) $(_OpenArguments) --args
+
+
+
+ $(TargetDir)/$(_AppBundleName).app/Contents/MacOS/$(_NativeExecutableName)
+
+
+
+
diff --git a/dotnet/targets/Microsoft.Sdk.Mobile.targets b/dotnet/targets/Microsoft.Sdk.Mobile.targets
new file mode 100644
index 000000000000..0524dea71dfd
--- /dev/null
+++ b/dotnet/targets/Microsoft.Sdk.Mobile.targets
@@ -0,0 +1,177 @@
+
+
+
+
+
+
+
+ $(_MlaunchPath)
+ $(_XamarinSdkRootDirectory)tools\bin\mlaunch
+ <_MlaunchPath Condition="'$(_MlaunchPath)' == ''">$(MlaunchPath)
+
+
+ $(_RelativeMlaunchPath)
+ $(XamarinRelativeSdkRootDirectory)tools\bin\mlaunch
+ <_RelativeMlaunchPath Condition="'$(_RelativeMlaunchPath)' == ''">$(RelativeMlaunchPath)
+
+
+ $(_DeviceName)
+
+
+
+
+
+
+
+
+
+
+
+ true
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <_MlaunchCaptureOutput Condition="'$(_MlaunchCaptureOutput)' == ''">true
+
+ <_MlaunchWaitForExit Condition="'$(_MlaunchWaitForExit)' == ''">true
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ $(MlaunchPath)
+ $(MlaunchRunArguments) --
+
+
+
+
+
+
+
+
+
+
+ <_FilterDevicesToRuntimeIdentifier Condition="'$(_XamarinUsingDefaultRuntimeIdentifier)' != 'true'">$(RuntimeIdentifier)
+
+
+
+
+
+
+
+
diff --git a/dotnet/targets/Xamarin.Shared.Sdk.DefaultItems.targets b/dotnet/targets/Xamarin.Shared.Sdk.DefaultItems.targets
index b266a902fd6f..b970adc12d0d 100644
--- a/dotnet/targets/Xamarin.Shared.Sdk.DefaultItems.targets
+++ b/dotnet/targets/Xamarin.Shared.Sdk.DefaultItems.targets
@@ -59,13 +59,8 @@
-
- <_IsDotNetSimulatorBuild Condition="$(RuntimeIdentifier.Contains('simulator')) Or $(RuntimeIdentifiers.Contains('simulator'))">true
- <_IsDotNetSimulatorBuild Condition="'$(_IsDotNetSimulatorBuild)' == ''">false
-
-
- iPhoneSimulator
+ iPhoneSimulator
iPhone
diff --git a/dotnet/targets/Xamarin.Shared.Sdk.targets b/dotnet/targets/Xamarin.Shared.Sdk.targets
index c6f3be76c3a2..e5e5b4d5f571 100644
--- a/dotnet/targets/Xamarin.Shared.Sdk.targets
+++ b/dotnet/targets/Xamarin.Shared.Sdk.targets
@@ -87,6 +87,10 @@
+
+
+
+
<_PlatformAssemblyName>Microsoft.$(_PlatformName)
@@ -2394,171 +2398,6 @@
-
-
-
-
- $(_MlaunchPath)
- $(_XamarinSdkRootDirectory)tools\bin\mlaunch
- <_MlaunchPath Condition="'$(_MlaunchPath)' == ''">$(MlaunchPath)
-
-
- $(_RelativeMlaunchPath)
- $(XamarinRelativeSdkRootDirectory)tools\bin\mlaunch
- <_RelativeMlaunchPath Condition="'$(_RelativeMlaunchPath)' == ''">$(RelativeMlaunchPath)
-
- $(_DeviceName)
-
-
-
-
-
-
-
-
-
-
-
- true
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- <_MlaunchCaptureOutput Condition="'$(_MlaunchCaptureOutput)' == ''">true
-
- <_MlaunchWaitForExit Condition="'$(_MlaunchWaitForExit)' == ''">true
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- $(MlaunchPath)
- $(MlaunchRunArguments) --
-
-
-
-
-
-
-
-
-
-
- <_OpenArguments Condition="'$(XamarinDebugMode)' != ''">$(_OpenArguments) --env __XAMARIN_DEBUG_MODE__=$(XamarinDebugMode)
- <_OpenArguments Condition="'$(XamarinDebugPort)' != ''">$(_OpenArguments) --env __XAMARIN_DEBUG_PORT__=$(XamarinDebugPort)
- <_OpenArguments Condition="'$(XamarinDebugHosts)' != ''">$(_OpenArguments) --env "__XAMARIN_DEBUG_HOSTS__=$(XamarinDebugHosts)"
- <_OpenArguments Condition="'$(XamarinDebugConnectTimeout)' != ''">$(_OpenArguments) --env __XAMARIN_DEBUG_CONNECT_TIMEOUT__=$(XamarinDebugConnectTimeout)
- <_OpenArguments Condition="'$(StandardOutputPath)' != ''">$(_OpenArguments) --stdout "$(StandardOutputPath)"
- <_OpenArguments Condition="'$(StandardErrorPath)' != ''">$(_OpenArguments) --stderr "$(StandardErrorPath)"
- <_OpenArguments Condition="'$(StandardInputPath)' != ''">$(_OpenArguments) --stdin "$(StandardInputPath)"
- <_OpenArgumentsPre Condition="'$(OpenNewInstance)' == 'true'">-n
- <_OpenArgumentsPre Condition="'$(OpenWaitForExit)' == 'true'">$(_OpenArgumentsPre) -W
- <_OpenArguments>$(_OpenArguments) $(RunEnvironment)
- open
- $(_OpenArgumentsPre) -a "$(TargetDir)/$(_AppBundleName).app" $(OpenArguments) $(_OpenArguments) --args
-
-
-
- $(TargetDir)/$(_AppBundleName).app/Contents/MacOS/$(_NativeExecutableName)
-
-
-
-
- 10.0.0-beta.25612.111
- 10.0.0-beta.25612.111
- 0.11.5-alpha.25612.111
- 10.0.0-beta.25612.111
- 10.0.2-servicing.25612.111
- 10.0.2
- 10.0.2
- 10.0.102-servicing.25612.111
- 10.0.2
- 10.0.102
+ 10.0.0-beta.26070.104
+ 10.0.0-beta.26070.104
+ 0.11.5-alpha.26070.104
+ 10.0.0-beta.26070.104
+ 10.0.3-servicing.26070.104
+ 10.0.3
+ 10.0.3
+ 10.0.103-servicing.26070.104
+ 10.0.3
+ 10.0.103
26.0.11017
18.5.9227
- 26.0.9784
+ 26.0.9785
26.0.11017
18.5.9227
- 26.0.9784
+ 26.0.9785
26.0.11017
15.5.9227
- 26.0.9784
+ 26.0.9785
26.0.11017
18.5.9227
- 26.0.9784
+ 26.0.9785
18.0.9617
18.0.9617
diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml
index f7e4b05f4027..d85b42569cd9 100644
--- a/eng/Version.Details.xml
+++ b/eng/Version.Details.xml
@@ -1,29 +1,29 @@
-
+
https://github.com/dotnet/dotnet
- 9441e5bb35fae9e956fdac4bd33ee537175e6d60
+ 455f1358f39b4d38fa3893c327a45027c4a81843
-
+
https://github.com/dotnet/dotnet
- 9441e5bb35fae9e956fdac4bd33ee537175e6d60
+ 455f1358f39b4d38fa3893c327a45027c4a81843
-
+
https://github.com/dotnet/dotnet
- 9441e5bb35fae9e956fdac4bd33ee537175e6d60
+ 455f1358f39b4d38fa3893c327a45027c4a81843
-
+
https://github.com/dotnet/dotnet
- 9441e5bb35fae9e956fdac4bd33ee537175e6d60
+ 455f1358f39b4d38fa3893c327a45027c4a81843
-
+
https://github.com/dotnet/dotnet
- 9441e5bb35fae9e956fdac4bd33ee537175e6d60
+ 455f1358f39b4d38fa3893c327a45027c4a81843
-
+
https://github.com/dotnet/dotnet
- 9441e5bb35fae9e956fdac4bd33ee537175e6d60
+ 455f1358f39b4d38fa3893c327a45027c4a81843
@@ -60,21 +60,21 @@
797d30720e5e629d23eb146935da94cb1b61047e
-
+
https://github.com/dotnet/macios
- e6a0fb79426493766332ad077290212fb1c9db4e
+ 640645001f1e0d0a311ce8f4f5976c3095e0c793
-
+
https://github.com/dotnet/macios
- e6a0fb79426493766332ad077290212fb1c9db4e
+ 640645001f1e0d0a311ce8f4f5976c3095e0c793
-
+
https://github.com/dotnet/macios
- e6a0fb79426493766332ad077290212fb1c9db4e
+ 640645001f1e0d0a311ce8f4f5976c3095e0c793
-
+
https://github.com/dotnet/macios
- e6a0fb79426493766332ad077290212fb1c9db4e
+ 640645001f1e0d0a311ce8f4f5976c3095e0c793
@@ -95,25 +95,25 @@
-
+
https://github.com/dotnet/dotnet
- 9441e5bb35fae9e956fdac4bd33ee537175e6d60
+ 455f1358f39b4d38fa3893c327a45027c4a81843
-
+
https://github.com/dotnet/dotnet
- 9441e5bb35fae9e956fdac4bd33ee537175e6d60
+ 455f1358f39b4d38fa3893c327a45027c4a81843
-
+
https://github.com/dotnet/dotnet
- 9441e5bb35fae9e956fdac4bd33ee537175e6d60
+ 455f1358f39b4d38fa3893c327a45027c4a81843
https://github.com/dotnet/xharness
31e0b8e08f57890f7b7004b93361d69cd4b21079
-
+
https://github.com/dotnet/dotnet
- 9441e5bb35fae9e956fdac4bd33ee537175e6d60
+ 455f1358f39b4d38fa3893c327a45027c4a81843
diff --git a/eng/common/core-templates/job/publish-build-assets.yml b/eng/common/core-templates/job/publish-build-assets.yml
index 3437087c80fc..b955fac6e13f 100644
--- a/eng/common/core-templates/job/publish-build-assets.yml
+++ b/eng/common/core-templates/job/publish-build-assets.yml
@@ -80,7 +80,7 @@ jobs:
# If it's not devdiv, it's dnceng
${{ if ne(variables['System.TeamProject'], 'DevDiv') }}:
name: NetCore1ESPool-Publishing-Internal
- image: windows.vs2019.amd64
+ image: windows.vs2022.amd64
os: windows
steps:
- ${{ if eq(parameters.is1ESPipeline, '') }}:
diff --git a/eng/common/core-templates/post-build/post-build.yml b/eng/common/core-templates/post-build/post-build.yml
index 9423d71ca3a2..b942a79ef02d 100644
--- a/eng/common/core-templates/post-build/post-build.yml
+++ b/eng/common/core-templates/post-build/post-build.yml
@@ -293,11 +293,11 @@ stages:
${{ else }}:
${{ if eq(parameters.is1ESPipeline, true) }}:
name: NetCore1ESPool-Publishing-Internal
- image: windows.vs2019.amd64
+ image: windows.vs2022.amd64
os: windows
${{ else }}:
name: NetCore1ESPool-Publishing-Internal
- demands: ImageOverride -equals windows.vs2019.amd64
+ demands: ImageOverride -equals windows.vs2022.amd64
steps:
- template: /eng/common/core-templates/post-build/setup-maestro-vars.yml
parameters:
diff --git a/eng/common/templates/variables/pool-providers.yml b/eng/common/templates/variables/pool-providers.yml
index e0b19c14a073..18693ea120d5 100644
--- a/eng/common/templates/variables/pool-providers.yml
+++ b/eng/common/templates/variables/pool-providers.yml
@@ -23,7 +23,7 @@
#
# pool:
# name: $(DncEngInternalBuildPool)
-# demands: ImageOverride -equals windows.vs2019.amd64
+# demands: ImageOverride -equals windows.vs2022.amd64
variables:
- ${{ if eq(variables['System.TeamProject'], 'internal') }}:
- template: /eng/common/templates-official/variables/pool-providers.yml
diff --git a/eng/common/tools.ps1 b/eng/common/tools.ps1
index bef4affa4a41..049fe6db994e 100644
--- a/eng/common/tools.ps1
+++ b/eng/common/tools.ps1
@@ -560,19 +560,26 @@ function LocateVisualStudio([object]$vsRequirements = $null){
})
}
- if (!$vsRequirements) { $vsRequirements = $GlobalJson.tools.vs }
+ if (!$vsRequirements) {
+ if (Get-Member -InputObject $GlobalJson.tools -Name 'vs' -ErrorAction SilentlyContinue) {
+ $vsRequirements = $GlobalJson.tools.vs
+ } else {
+ $vsRequirements = $null
+ }
+ }
+
$args = @('-latest', '-format', 'json', '-requires', 'Microsoft.Component.MSBuild', '-products', '*')
if (!$excludePrereleaseVS) {
$args += '-prerelease'
}
- if (Get-Member -InputObject $vsRequirements -Name 'version') {
+ if ($vsRequirements -and (Get-Member -InputObject $vsRequirements -Name 'version' -ErrorAction SilentlyContinue)) {
$args += '-version'
$args += $vsRequirements.version
}
- if (Get-Member -InputObject $vsRequirements -Name 'components') {
+ if ($vsRequirements -and (Get-Member -InputObject $vsRequirements -Name 'components' -ErrorAction SilentlyContinue)) {
foreach ($component in $vsRequirements.components) {
$args += '-requires'
$args += $component
diff --git a/external/Xamarin.MacDev b/external/Xamarin.MacDev
index 757b4f5b7e8e..f1300986199f 160000
--- a/external/Xamarin.MacDev
+++ b/external/Xamarin.MacDev
@@ -1 +1 @@
-Subproject commit 757b4f5b7e8e2f60ecbea6de3967158cc4f77069
+Subproject commit f1300986199f5489191d2c9712e57bf8a0a3d84a
diff --git a/global.json b/global.json
index 9634fbe97db7..f583f25279bc 100644
--- a/global.json
+++ b/global.json
@@ -1,6 +1,6 @@
{
"sdk": {
- "version": "10.0.102-servicing.25612.111",
+ "version": "10.0.103-servicing.26070.104",
"paths": [
"builds/downloads/dotnet",
"$host$"
@@ -8,9 +8,9 @@
"errorMessage": "The .NET SDK could not be found, please run 'make dotnet -C builds'."
},
"tools": {
- "dotnet": "10.0.102-servicing.25612.111"
+ "dotnet": "10.0.103-servicing.26070.104"
},
"msbuild-sdks": {
- "Microsoft.DotNet.Arcade.Sdk": "10.0.0-beta.25612.111"
+ "Microsoft.DotNet.Arcade.Sdk": "10.0.0-beta.26070.104"
}
}
diff --git a/macios/msbuild/Xamarin.Localization.MSBuild/TranslatedAssemblies/MSBStrings.cs.resx b/macios/msbuild/Xamarin.Localization.MSBuild/TranslatedAssemblies/MSBStrings.cs.resx
index be957d85a9c3..132f9d0f261e 100644
--- a/macios/msbuild/Xamarin.Localization.MSBuild/TranslatedAssemblies/MSBStrings.cs.resx
+++ b/macios/msbuild/Xamarin.Localization.MSBuild/TranslatedAssemblies/MSBStrings.cs.resx
@@ -1278,4 +1278,7 @@
Unable to copy the inputs to this task to the remote build server for unknown reasons. The build log may have more information.
+
+ The task '{0}' requires the property '{1}' to be set. Please file an issue at https://github.com/dotnet/macios/issues/new/choose.
+
\ No newline at end of file
diff --git a/macios/msbuild/Xamarin.Localization.MSBuild/TranslatedAssemblies/MSBStrings.de.resx b/macios/msbuild/Xamarin.Localization.MSBuild/TranslatedAssemblies/MSBStrings.de.resx
index be957d85a9c3..132f9d0f261e 100644
--- a/macios/msbuild/Xamarin.Localization.MSBuild/TranslatedAssemblies/MSBStrings.de.resx
+++ b/macios/msbuild/Xamarin.Localization.MSBuild/TranslatedAssemblies/MSBStrings.de.resx
@@ -1278,4 +1278,7 @@
Unable to copy the inputs to this task to the remote build server for unknown reasons. The build log may have more information.
+
+ The task '{0}' requires the property '{1}' to be set. Please file an issue at https://github.com/dotnet/macios/issues/new/choose.
+
\ No newline at end of file
diff --git a/macios/msbuild/Xamarin.Localization.MSBuild/TranslatedAssemblies/MSBStrings.es.resx b/macios/msbuild/Xamarin.Localization.MSBuild/TranslatedAssemblies/MSBStrings.es.resx
index be957d85a9c3..132f9d0f261e 100644
--- a/macios/msbuild/Xamarin.Localization.MSBuild/TranslatedAssemblies/MSBStrings.es.resx
+++ b/macios/msbuild/Xamarin.Localization.MSBuild/TranslatedAssemblies/MSBStrings.es.resx
@@ -1278,4 +1278,7 @@
Unable to copy the inputs to this task to the remote build server for unknown reasons. The build log may have more information.
+
+ The task '{0}' requires the property '{1}' to be set. Please file an issue at https://github.com/dotnet/macios/issues/new/choose.
+
\ No newline at end of file
diff --git a/macios/msbuild/Xamarin.Localization.MSBuild/TranslatedAssemblies/MSBStrings.fr.resx b/macios/msbuild/Xamarin.Localization.MSBuild/TranslatedAssemblies/MSBStrings.fr.resx
index be957d85a9c3..132f9d0f261e 100644
--- a/macios/msbuild/Xamarin.Localization.MSBuild/TranslatedAssemblies/MSBStrings.fr.resx
+++ b/macios/msbuild/Xamarin.Localization.MSBuild/TranslatedAssemblies/MSBStrings.fr.resx
@@ -1278,4 +1278,7 @@
Unable to copy the inputs to this task to the remote build server for unknown reasons. The build log may have more information.
+
+ The task '{0}' requires the property '{1}' to be set. Please file an issue at https://github.com/dotnet/macios/issues/new/choose.
+
\ No newline at end of file
diff --git a/macios/msbuild/Xamarin.Localization.MSBuild/TranslatedAssemblies/MSBStrings.it.resx b/macios/msbuild/Xamarin.Localization.MSBuild/TranslatedAssemblies/MSBStrings.it.resx
index be957d85a9c3..132f9d0f261e 100644
--- a/macios/msbuild/Xamarin.Localization.MSBuild/TranslatedAssemblies/MSBStrings.it.resx
+++ b/macios/msbuild/Xamarin.Localization.MSBuild/TranslatedAssemblies/MSBStrings.it.resx
@@ -1278,4 +1278,7 @@
Unable to copy the inputs to this task to the remote build server for unknown reasons. The build log may have more information.
+
+ The task '{0}' requires the property '{1}' to be set. Please file an issue at https://github.com/dotnet/macios/issues/new/choose.
+
\ No newline at end of file
diff --git a/macios/msbuild/Xamarin.Localization.MSBuild/TranslatedAssemblies/MSBStrings.ja.resx b/macios/msbuild/Xamarin.Localization.MSBuild/TranslatedAssemblies/MSBStrings.ja.resx
index be957d85a9c3..132f9d0f261e 100644
--- a/macios/msbuild/Xamarin.Localization.MSBuild/TranslatedAssemblies/MSBStrings.ja.resx
+++ b/macios/msbuild/Xamarin.Localization.MSBuild/TranslatedAssemblies/MSBStrings.ja.resx
@@ -1278,4 +1278,7 @@
Unable to copy the inputs to this task to the remote build server for unknown reasons. The build log may have more information.
+
+ The task '{0}' requires the property '{1}' to be set. Please file an issue at https://github.com/dotnet/macios/issues/new/choose.
+
\ No newline at end of file
diff --git a/macios/msbuild/Xamarin.Localization.MSBuild/TranslatedAssemblies/MSBStrings.ko.resx b/macios/msbuild/Xamarin.Localization.MSBuild/TranslatedAssemblies/MSBStrings.ko.resx
index be957d85a9c3..132f9d0f261e 100644
--- a/macios/msbuild/Xamarin.Localization.MSBuild/TranslatedAssemblies/MSBStrings.ko.resx
+++ b/macios/msbuild/Xamarin.Localization.MSBuild/TranslatedAssemblies/MSBStrings.ko.resx
@@ -1278,4 +1278,7 @@
Unable to copy the inputs to this task to the remote build server for unknown reasons. The build log may have more information.
+
+ The task '{0}' requires the property '{1}' to be set. Please file an issue at https://github.com/dotnet/macios/issues/new/choose.
+
\ No newline at end of file
diff --git a/macios/msbuild/Xamarin.Localization.MSBuild/TranslatedAssemblies/MSBStrings.pl.resx b/macios/msbuild/Xamarin.Localization.MSBuild/TranslatedAssemblies/MSBStrings.pl.resx
index be957d85a9c3..132f9d0f261e 100644
--- a/macios/msbuild/Xamarin.Localization.MSBuild/TranslatedAssemblies/MSBStrings.pl.resx
+++ b/macios/msbuild/Xamarin.Localization.MSBuild/TranslatedAssemblies/MSBStrings.pl.resx
@@ -1278,4 +1278,7 @@
Unable to copy the inputs to this task to the remote build server for unknown reasons. The build log may have more information.
+
+ The task '{0}' requires the property '{1}' to be set. Please file an issue at https://github.com/dotnet/macios/issues/new/choose.
+
\ No newline at end of file
diff --git a/macios/msbuild/Xamarin.Localization.MSBuild/TranslatedAssemblies/MSBStrings.pt-BR.resx b/macios/msbuild/Xamarin.Localization.MSBuild/TranslatedAssemblies/MSBStrings.pt-BR.resx
index be957d85a9c3..132f9d0f261e 100644
--- a/macios/msbuild/Xamarin.Localization.MSBuild/TranslatedAssemblies/MSBStrings.pt-BR.resx
+++ b/macios/msbuild/Xamarin.Localization.MSBuild/TranslatedAssemblies/MSBStrings.pt-BR.resx
@@ -1278,4 +1278,7 @@
Unable to copy the inputs to this task to the remote build server for unknown reasons. The build log may have more information.
+
+ The task '{0}' requires the property '{1}' to be set. Please file an issue at https://github.com/dotnet/macios/issues/new/choose.
+
\ No newline at end of file
diff --git a/macios/msbuild/Xamarin.Localization.MSBuild/TranslatedAssemblies/MSBStrings.ru.resx b/macios/msbuild/Xamarin.Localization.MSBuild/TranslatedAssemblies/MSBStrings.ru.resx
index be957d85a9c3..132f9d0f261e 100644
--- a/macios/msbuild/Xamarin.Localization.MSBuild/TranslatedAssemblies/MSBStrings.ru.resx
+++ b/macios/msbuild/Xamarin.Localization.MSBuild/TranslatedAssemblies/MSBStrings.ru.resx
@@ -1278,4 +1278,7 @@
Unable to copy the inputs to this task to the remote build server for unknown reasons. The build log may have more information.
+
+ The task '{0}' requires the property '{1}' to be set. Please file an issue at https://github.com/dotnet/macios/issues/new/choose.
+
\ No newline at end of file
diff --git a/macios/msbuild/Xamarin.Localization.MSBuild/TranslatedAssemblies/MSBStrings.tr.resx b/macios/msbuild/Xamarin.Localization.MSBuild/TranslatedAssemblies/MSBStrings.tr.resx
index be957d85a9c3..132f9d0f261e 100644
--- a/macios/msbuild/Xamarin.Localization.MSBuild/TranslatedAssemblies/MSBStrings.tr.resx
+++ b/macios/msbuild/Xamarin.Localization.MSBuild/TranslatedAssemblies/MSBStrings.tr.resx
@@ -1278,4 +1278,7 @@
Unable to copy the inputs to this task to the remote build server for unknown reasons. The build log may have more information.
+
+ The task '{0}' requires the property '{1}' to be set. Please file an issue at https://github.com/dotnet/macios/issues/new/choose.
+
\ No newline at end of file
diff --git a/macios/msbuild/Xamarin.Localization.MSBuild/TranslatedAssemblies/MSBStrings.zh-Hans.resx b/macios/msbuild/Xamarin.Localization.MSBuild/TranslatedAssemblies/MSBStrings.zh-Hans.resx
index be957d85a9c3..132f9d0f261e 100644
--- a/macios/msbuild/Xamarin.Localization.MSBuild/TranslatedAssemblies/MSBStrings.zh-Hans.resx
+++ b/macios/msbuild/Xamarin.Localization.MSBuild/TranslatedAssemblies/MSBStrings.zh-Hans.resx
@@ -1278,4 +1278,7 @@
Unable to copy the inputs to this task to the remote build server for unknown reasons. The build log may have more information.
+
+ The task '{0}' requires the property '{1}' to be set. Please file an issue at https://github.com/dotnet/macios/issues/new/choose.
+
\ No newline at end of file
diff --git a/macios/msbuild/Xamarin.Localization.MSBuild/TranslatedAssemblies/MSBStrings.zh-Hant.resx b/macios/msbuild/Xamarin.Localization.MSBuild/TranslatedAssemblies/MSBStrings.zh-Hant.resx
index be957d85a9c3..132f9d0f261e 100644
--- a/macios/msbuild/Xamarin.Localization.MSBuild/TranslatedAssemblies/MSBStrings.zh-Hant.resx
+++ b/macios/msbuild/Xamarin.Localization.MSBuild/TranslatedAssemblies/MSBStrings.zh-Hant.resx
@@ -1278,4 +1278,7 @@
Unable to copy the inputs to this task to the remote build server for unknown reasons. The build log may have more information.
+
+ The task '{0}' requires the property '{1}' to be set. Please file an issue at https://github.com/dotnet/macios/issues/new/choose.
+
\ No newline at end of file
diff --git a/msbuild/Makefile b/msbuild/Makefile
index e91a7e09dabd..c7dc8d9e0059 100644
--- a/msbuild/Makefile
+++ b/msbuild/Makefile
@@ -115,15 +115,20 @@ DOTNET_IOS_WINDOWS_FILES += Messaging/Xamarin.Messaging.Build/obj/$(CONFIG)/Buil
.dotnet-windows: .build-stamp .copy-windows-files
+ifndef IS_LINUX
all-local:: .dotnet-windows
dotnet:: .dotnet-windows
+endif
##
## Common targets ##
##
# we must install locally during 'make all', because the F# build depends on the msbuild targets/assemblies.
-all-local:: $(MSBUILD_PRODUCTS) .stamp-test-xml
+all-local:: $(MSBUILD_PRODUCTS)
+ifndef IS_LINUX
+all-local:: .stamp-test-xml
+endif
# I haven't found a way to execute ilrepack.exe on .NET (it will probably have to be built for .NET), so run it using Mono.
diff --git a/msbuild/Xamarin.Localization.MSBuild/MSBStrings.resx b/msbuild/Xamarin.Localization.MSBuild/MSBStrings.resx
index cae2cb561191..73f4ff1ab063 100644
--- a/msbuild/Xamarin.Localization.MSBuild/MSBStrings.resx
+++ b/msbuild/Xamarin.Localization.MSBuild/MSBStrings.resx
@@ -1619,4 +1619,8 @@
Unable to copy the inputs to this task to the remote build server for unknown reasons. The build log may have more information.
+
+
+ The task '{0}' requires the property '{1}' to be set. Please file an issue at https://github.com/dotnet/macios/issues/new/choose.
+
diff --git a/msbuild/Xamarin.Localization.MSBuild/Xamarin.Localization.MSBuild.csproj b/msbuild/Xamarin.Localization.MSBuild/Xamarin.Localization.MSBuild.csproj
index 9601983371f1..dc64d52af0f8 100644
--- a/msbuild/Xamarin.Localization.MSBuild/Xamarin.Localization.MSBuild.csproj
+++ b/msbuild/Xamarin.Localization.MSBuild/Xamarin.Localization.MSBuild.csproj
@@ -1,7 +1,7 @@
- netstandard2.0
+ netstandard2.0;net$(BundledNETCoreAppTargetFrameworkVersion)
true
../../product.snk
enable
diff --git a/msbuild/Xamarin.MacDev.Tasks.sln b/msbuild/Xamarin.MacDev.Tasks.sln
deleted file mode 100644
index 4b23455cffda..000000000000
--- a/msbuild/Xamarin.MacDev.Tasks.sln
+++ /dev/null
@@ -1,126 +0,0 @@
-
-Microsoft Visual Studio Solution File, Format Version 12.00
-# Visual Studio 14
-VisualStudioVersion = 14.0.24720.0
-MinimumVisualStudioVersion = 10.0.40219.1
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Xamarin.MacDev", "..\external\Xamarin.MacDev\Xamarin.MacDev\Xamarin.MacDev.csproj", "{CC3D9353-20C4-467A-8522-A9DED6F0C753}"
-EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Xamarin.MacDev.Tasks", "Xamarin.MacDev.Tasks\Xamarin.MacDev.Tasks.csproj", "{534D7C5A-0E1C-4C58-9E48-21B1A98919EB}"
-EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Xamarin.Localization.MSBuild", "Xamarin.Localization.MSBuild\Xamarin.Localization.MSBuild.csproj", "{947E3C4C-8891-49D7-B665-23F785489D3F}"
-EndProject
-Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "tests", "tests", "{D669990B-EE95-4282-AAC4-17CA05AE0575}"
-EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Xamarin.MacDev.Tests", "..\tests\msbuild\Xamarin.MacDev.Tests\Xamarin.MacDev.Tests.csproj", "{14A12D59-A630-42F1-BC19-A63A9D87DB3B}"
-EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Xamarin.MacDev.Tasks.Tests", "..\tests\msbuild\Xamarin.MacDev.Tasks.Tests\Xamarin.MacDev.Tasks.Tests.csproj", "{17E54157-C5DA-414C-8C28-7F642E6E4FB0}"
-EndProject
-Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Messaging", "Messaging", "{F70FD520-F1A7-44F4-A7D5-2E3F471F7CC2}"
-EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Xamarin.iOS.Tasks.Windows", "Xamarin.iOS.Tasks.Windows\Xamarin.iOS.Tasks.Windows.csproj", "{37C7273B-CB32-49B8-8820-1AB0940C7934}"
-EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Xamarin.Messaging.Build", "Messaging\Xamarin.Messaging.Build\Xamarin.Messaging.Build.csproj", "{F515F859-A90B-4EF1-A0F2-D1BDD2C3FF36}"
-EndProject
-Global
- GlobalSection(SolutionConfigurationPlatforms) = preSolution
- Debug|Any CPU = Debug|Any CPU
- Release|Any CPU = Release|Any CPU
- Debug-net461|Any CPU = Debug-net461|Any CPU
- Debug-netstandard2.0|Any CPU = Debug-netstandard2.0|Any CPU
- EndGlobalSection
- GlobalSection(ProjectConfigurationPlatforms) = postSolution
- {CC3D9353-20C4-467A-8522-A9DED6F0C753}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {CC3D9353-20C4-467A-8522-A9DED6F0C753}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {CC3D9353-20C4-467A-8522-A9DED6F0C753}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {CC3D9353-20C4-467A-8522-A9DED6F0C753}.Release|Any CPU.Build.0 = Release|Any CPU
- {CC3D9353-20C4-467A-8522-A9DED6F0C753}.Debug-net461|Any CPU.ActiveCfg = Debug|Any CPU
- {CC3D9353-20C4-467A-8522-A9DED6F0C753}.Debug-net461|Any CPU.Build.0 = Debug|Any CPU
- {CC3D9353-20C4-467A-8522-A9DED6F0C753}.Debug-netstandard2.0|Any CPU.ActiveCfg = Debug|Any CPU
- {CC3D9353-20C4-467A-8522-A9DED6F0C753}.Debug-netstandard2.0|Any CPU.Build.0 = Debug|Any CPU
- {534D7C5A-0E1C-4C58-9E48-21B1A98919EB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {534D7C5A-0E1C-4C58-9E48-21B1A98919EB}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {534D7C5A-0E1C-4C58-9E48-21B1A98919EB}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {534D7C5A-0E1C-4C58-9E48-21B1A98919EB}.Release|Any CPU.Build.0 = Release|Any CPU
- {534D7C5A-0E1C-4C58-9E48-21B1A98919EB}.Debug-net461|Any CPU.ActiveCfg = Debug|Any CPU
- {534D7C5A-0E1C-4C58-9E48-21B1A98919EB}.Debug-net461|Any CPU.Build.0 = Debug|Any CPU
- {534D7C5A-0E1C-4C58-9E48-21B1A98919EB}.Debug-netstandard2.0|Any CPU.ActiveCfg = Debug|Any CPU
- {534D7C5A-0E1C-4C58-9E48-21B1A98919EB}.Debug-netstandard2.0|Any CPU.Build.0 = Debug|Any CPU
- {947E3C4C-8891-49D7-B665-23F785489D3F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {947E3C4C-8891-49D7-B665-23F785489D3F}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {947E3C4C-8891-49D7-B665-23F785489D3F}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {947E3C4C-8891-49D7-B665-23F785489D3F}.Release|Any CPU.Build.0 = Release|Any CPU
- {947E3C4C-8891-49D7-B665-23F785489D3F}.Debug-net461|Any CPU.ActiveCfg = Debug|Any CPU
- {947E3C4C-8891-49D7-B665-23F785489D3F}.Debug-net461|Any CPU.Build.0 = Debug|Any CPU
- {947E3C4C-8891-49D7-B665-23F785489D3F}.Debug-netstandard2.0|Any CPU.ActiveCfg = Debug|Any CPU
- {947E3C4C-8891-49D7-B665-23F785489D3F}.Debug-netstandard2.0|Any CPU.Build.0 = Debug|Any CPU
- {14A12D59-A630-42F1-BC19-A63A9D87DB3B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {14A12D59-A630-42F1-BC19-A63A9D87DB3B}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {14A12D59-A630-42F1-BC19-A63A9D87DB3B}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {14A12D59-A630-42F1-BC19-A63A9D87DB3B}.Release|Any CPU.Build.0 = Release|Any CPU
- {14A12D59-A630-42F1-BC19-A63A9D87DB3B}.Debug-net461|Any CPU.ActiveCfg = Debug|Any CPU
- {14A12D59-A630-42F1-BC19-A63A9D87DB3B}.Debug-net461|Any CPU.Build.0 = Debug|Any CPU
- {14A12D59-A630-42F1-BC19-A63A9D87DB3B}.Debug-netstandard2.0|Any CPU.ActiveCfg = Debug|Any CPU
- {14A12D59-A630-42F1-BC19-A63A9D87DB3B}.Debug-netstandard2.0|Any CPU.Build.0 = Debug|Any CPU
- {17E54157-C5DA-414C-8C28-7F642E6E4FB0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {17E54157-C5DA-414C-8C28-7F642E6E4FB0}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {17E54157-C5DA-414C-8C28-7F642E6E4FB0}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {17E54157-C5DA-414C-8C28-7F642E6E4FB0}.Release|Any CPU.Build.0 = Release|Any CPU
- {17E54157-C5DA-414C-8C28-7F642E6E4FB0}.Debug-net461|Any CPU.ActiveCfg = Debug-netstandard2.0|Any CPU
- {17E54157-C5DA-414C-8C28-7F642E6E4FB0}.Debug-net461|Any CPU.Build.0 = Debug-netstandard2.0|Any CPU
- {17E54157-C5DA-414C-8C28-7F642E6E4FB0}.Debug-netstandard2.0|Any CPU.ActiveCfg = Debug-netstandard2.0|Any CPU
- {17E54157-C5DA-414C-8C28-7F642E6E4FB0}.Debug-netstandard2.0|Any CPU.Build.0 = Debug-netstandard2.0|Any CPU
- {37C7273B-CB32-49B8-8820-1AB0940C7934}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {37C7273B-CB32-49B8-8820-1AB0940C7934}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {37C7273B-CB32-49B8-8820-1AB0940C7934}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {37C7273B-CB32-49B8-8820-1AB0940C7934}.Release|Any CPU.Build.0 = Release|Any CPU
- {37C7273B-CB32-49B8-8820-1AB0940C7934}.Debug-net461|Any CPU.ActiveCfg = Debug|Any CPU
- {37C7273B-CB32-49B8-8820-1AB0940C7934}.Debug-net461|Any CPU.Build.0 = Debug|Any CPU
- {37C7273B-CB32-49B8-8820-1AB0940C7934}.Debug-netstandard2.0|Any CPU.ActiveCfg = Debug|Any CPU
- {37C7273B-CB32-49B8-8820-1AB0940C7934}.Debug-netstandard2.0|Any CPU.Build.0 = Debug|Any CPU
- {F515F859-A90B-4EF1-A0F2-D1BDD2C3FF36}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {F515F859-A90B-4EF1-A0F2-D1BDD2C3FF36}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {F515F859-A90B-4EF1-A0F2-D1BDD2C3FF36}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {F515F859-A90B-4EF1-A0F2-D1BDD2C3FF36}.Release|Any CPU.Build.0 = Release|Any CPU
- {F515F859-A90B-4EF1-A0F2-D1BDD2C3FF36}.Debug-net461|Any CPU.ActiveCfg = Debug|Any CPU
- {F515F859-A90B-4EF1-A0F2-D1BDD2C3FF36}.Debug-net461|Any CPU.Build.0 = Debug|Any CPU
- {F515F859-A90B-4EF1-A0F2-D1BDD2C3FF36}.Debug-netstandard2.0|Any CPU.ActiveCfg = Debug|Any CPU
- {F515F859-A90B-4EF1-A0F2-D1BDD2C3FF36}.Debug-netstandard2.0|Any CPU.Build.0 = Debug|Any CPU
- EndGlobalSection
- GlobalSection(SolutionProperties) = preSolution
- HideSolutionNode = FALSE
- EndGlobalSection
- GlobalSection(MonoDevelopProperties) = preSolution
- Policies = $0
- $0.TextStylePolicy = $1
- $1.scope = text/x-csharp
- $1.FileWidth = 80
- $1.TabWidth = 8
- $1.IndentWidth = 8
- $0.CSharpFormattingPolicy = $2
- $2.IndentSwitchSection = False
- $2.NewLinesForBracesInProperties = False
- $2.NewLinesForBracesInAccessors = False
- $2.NewLinesForBracesInAnonymousMethods = False
- $2.NewLinesForBracesInControlBlocks = False
- $2.NewLinesForBracesInAnonymousTypes = False
- $2.NewLinesForBracesInObjectCollectionArrayInitializers = False
- $2.NewLinesForBracesInLambdaExpressionBody = False
- $2.NewLineForElse = False
- $2.NewLineForCatch = False
- $2.NewLineForFinally = False
- $2.NewLineForMembersInObjectInit = False
- $2.NewLineForMembersInAnonymousTypes = False
- $2.NewLineForClausesInQuery = False
- $2.SpacingAfterMethodDeclarationName = True
- $2.SpaceAfterMethodCallName = True
- $2.SpaceAfterCast = True
- $2.SpaceBeforeOpenSquareBracket = True
- $2.scope = text/x-csharp
- $2.NewLinesForBracesInTypes = False
- EndGlobalSection
- GlobalSection(NestedProjects) = preSolution
- {14A12D59-A630-42F1-BC19-A63A9D87DB3B} = {D669990B-EE95-4282-AAC4-17CA05AE0575}
- {17E54157-C5DA-414C-8C28-7F642E6E4FB0} = {D669990B-EE95-4282-AAC4-17CA05AE0575}
- {F515F859-A90B-4EF1-A0F2-D1BDD2C3FF36} = {F70FD520-F1A7-44F4-A7D5-2E3F471F7CC2}
- EndGlobalSection
-EndGlobal
diff --git a/msbuild/Xamarin.MacDev.Tasks.slnx b/msbuild/Xamarin.MacDev.Tasks.slnx
new file mode 100644
index 000000000000..e3c799a54619
--- /dev/null
+++ b/msbuild/Xamarin.MacDev.Tasks.slnx
@@ -0,0 +1,39 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/msbuild/Xamarin.MacDev.Tasks/BundleResource.cs b/msbuild/Xamarin.MacDev.Tasks/BundleResource.cs
index dfdc1bc19b29..6b58fffb930e 100644
--- a/msbuild/Xamarin.MacDev.Tasks/BundleResource.cs
+++ b/msbuild/Xamarin.MacDev.Tasks/BundleResource.cs
@@ -134,9 +134,9 @@ public static string GetVirtualProjectPath (T task, ITaskItem item) where T :
// Then find the directory we should use to compute the result relative to.
string relativeToDirectory; // this is an absolute path.
if (isDefaultItem) {
- relativeToDirectory = Path.GetDirectoryName (localMSBuildProjectFullPath);
+ relativeToDirectory = Path.GetDirectoryName (localMSBuildProjectFullPath)!;
} else {
- relativeToDirectory = Path.GetDirectoryName (localDefiningProjectFullPath);
+ relativeToDirectory = Path.GetDirectoryName (localDefiningProjectFullPath)!;
}
var originalRelativeToDirectory = relativeToDirectory;
diff --git a/msbuild/Xamarin.MacDev.Tasks/Decompress.cs b/msbuild/Xamarin.MacDev.Tasks/Decompress.cs
index 019dc2d7b8ba..2d4f755378de 100644
--- a/msbuild/Xamarin.MacDev.Tasks/Decompress.cs
+++ b/msbuild/Xamarin.MacDev.Tasks/Decompress.cs
@@ -128,7 +128,7 @@ public static bool TryDecompress (XamarinTask task, string zip, string resource,
}
if (rv) {
- Directory.CreateDirectory (Path.GetDirectoryName (stampFile));
+ Directory.CreateDirectory (Path.GetDirectoryName (stampFile)!);
using var touched = new FileStream (stampFile, FileMode.Create, FileAccess.Write);
createdFiles.Add (stampFile);
}
@@ -240,7 +240,7 @@ static bool TryDecompressUsingSystemIOCompression (XamarinTask task, string zip,
if (isDir) {
Directory.CreateDirectory (targetPath);
} else {
- Directory.CreateDirectory (Path.GetDirectoryName (targetPath));
+ Directory.CreateDirectory (Path.GetDirectoryName (targetPath)!);
using var streamWrite = File.OpenWrite (targetPath);
using var streamRead = entry.Open ();
#if NET
diff --git a/msbuild/Xamarin.MacDev.Tasks/Extensions/ITaskItemExtensions.cs b/msbuild/Xamarin.MacDev.Tasks/Extensions/ITaskItemExtensions.cs
index d5002fd63ee4..b9871530c602 100644
--- a/msbuild/Xamarin.MacDev.Tasks/Extensions/ITaskItemExtensions.cs
+++ b/msbuild/Xamarin.MacDev.Tasks/Extensions/ITaskItemExtensions.cs
@@ -25,7 +25,7 @@ public static Dictionary CloneCustomMetadataToDictionary (this I
var custom = item.CloneCustomMetadata ();
var rv = new Dictionary (custom.Count, StringComparer.OrdinalIgnoreCase);
foreach (DictionaryEntry entry in custom)
- rv [(string) entry.Key] = (string) entry.Value;
+ rv [(string) entry.Key] = (string) entry.Value!;
return rv;
}
}
diff --git a/msbuild/Xamarin.MacDev.Tasks/LinkerOptions.cs b/msbuild/Xamarin.MacDev.Tasks/LinkerOptions.cs
index f58ca920e0cb..4088341654d1 100644
--- a/msbuild/Xamarin.MacDev.Tasks/LinkerOptions.cs
+++ b/msbuild/Xamarin.MacDev.Tasks/LinkerOptions.cs
@@ -55,7 +55,7 @@ public void BuildNativeReferenceFlags (TaskLoggingHelper Log, ITaskItem [] Nativ
var path = item.ItemSpec;
// in case the full path to the library is given (msbuild)
if (Path.GetExtension (path) != ".framework")
- path = Path.GetDirectoryName (path);
+ path = Path.GetDirectoryName (path)!;
Frameworks.Add (path);
} else if (kind == NativeReferenceKind.Dynamic) {
var path = item.ItemSpec;
diff --git a/msbuild/Xamarin.MacDev.Tasks/StringParserService.cs b/msbuild/Xamarin.MacDev.Tasks/StringParserService.cs
index 345383043f1d..e3fea4b9790c 100644
--- a/msbuild/Xamarin.MacDev.Tasks/StringParserService.cs
+++ b/msbuild/Xamarin.MacDev.Tasks/StringParserService.cs
@@ -31,9 +31,8 @@ public static string Parse (string text, IDictionary tags)
}
var tag = text.Substring (startIndex, i - startIndex);
- string value;
- if (!tags.TryGetValue (tag, out value)) {
+ if (!tags.TryGetValue (tag, out var value)) {
builder.Append ('$').Append (open).Append (tag).Append (close);
} else {
builder.Append (value);
diff --git a/msbuild/Xamarin.MacDev.Tasks/Tasks/ACTool.cs b/msbuild/Xamarin.MacDev.Tasks/Tasks/ACTool.cs
index f7dfbcd5a93d..eb09d5ad18dd 100644
--- a/msbuild/Xamarin.MacDev.Tasks/Tasks/ACTool.cs
+++ b/msbuild/Xamarin.MacDev.Tasks/Tasks/ACTool.cs
@@ -214,7 +214,7 @@ protected override void AppendCommandLineArguments (IDictionary
args.Add ("--include-all-app-icons");
args.Add ("--output-partial-info-plist");
- args.Add (Path.GetFullPath (partialAppManifestPath));
+ args.Add (Path.GetFullPath (partialAppManifestPath!));
}
IEnumerable GetCompiledBundleResources (PDictionary output, string intermediateBundleDir)
@@ -297,8 +297,8 @@ public override bool Execute ()
var catalogFullPath = imageAsset.GetMetadata ("FullPath");
// get the parent (which will typically be .appiconset, .launchimage, .imageset, .iconset, etc)
- var catalog = Path.GetDirectoryName (vpath);
- catalogFullPath = Path.GetDirectoryName (catalogFullPath);
+ var catalog = Path.GetDirectoryName (vpath)!;
+ catalogFullPath = Path.GetDirectoryName (catalogFullPath)!;
var assetType = Path.GetExtension (catalog).TrimStart ('.');
@@ -368,7 +368,7 @@ public override bool Execute ()
}
var dest = Path.Combine (intermediateCloneDir, vpath);
- var dir = Path.GetDirectoryName (dest);
+ var dir = Path.GetDirectoryName (dest)!;
Directory.CreateDirectory (dir);
@@ -404,13 +404,13 @@ public override bool Execute ()
if (Platform == ApplePlatform.TVOS) {
if (assetType.Equals ("imagestack", StringComparison.OrdinalIgnoreCase)) {
- imageStacksInAssets.Add (Path.GetFileNameWithoutExtension (Path.GetDirectoryName (vpath)));
+ imageStacksInAssets.Add (Path.GetFileNameWithoutExtension (Path.GetDirectoryName (vpath)!));
} else if (assetType.Equals ("brandassets", StringComparison.OrdinalIgnoreCase)) {
- brandAssetsInAssets.Add (Path.GetFileNameWithoutExtension (Path.GetDirectoryName (vpath)));
+ brandAssetsInAssets.Add (Path.GetFileNameWithoutExtension (Path.GetDirectoryName (vpath)!));
}
} else {
if (assetType.Equals ("appiconset", StringComparison.OrdinalIgnoreCase))
- appIconsInAssets.Add (Path.GetFileNameWithoutExtension (Path.GetDirectoryName (vpath)));
+ appIconsInAssets.Add (Path.GetFileNameWithoutExtension (Path.GetDirectoryName (vpath)!));
}
if (unique.Add (catalog)) {
diff --git a/msbuild/Xamarin.MacDev.Tasks/Tasks/AOTCompile.cs b/msbuild/Xamarin.MacDev.Tasks/Tasks/AOTCompile.cs
index 3adaa8afd0d9..3249cdaa9b48 100644
--- a/msbuild/Xamarin.MacDev.Tasks/Tasks/AOTCompile.cs
+++ b/msbuild/Xamarin.MacDev.Tasks/Tasks/AOTCompile.cs
@@ -36,9 +36,6 @@ public class AOTCompile : XamarinParallelTask, ITaskCallback, ICancelableTask {
[Required]
public string OutputDirectory { get; set; } = string.Empty;
- [Required]
- public string SdkDevPath { get; set; } = string.Empty;
-
#region Output
[Output]
public ITaskItem []? AssemblyFiles { get; set; }
@@ -242,7 +239,7 @@ public override bool Execute ()
}
// All the assemblies to AOT must be in the same directory
- var assemblyDirectories = inputs.Select (v => Path.GetDirectoryName (Path.GetFullPath (v))).Distinct ().ToArray ();
+ var assemblyDirectories = inputs.Select (v => Path.GetDirectoryName (Path.GetFullPath (v))!).Distinct ().ToArray ();
if (assemblyDirectories.Length > 1) {
// The assemblies are not in the same directory, so copy them somewhere else (to InputDirectory)
Directory.CreateDirectory (InputDirectory);
@@ -341,7 +338,7 @@ public override bool Execute ()
environment [item.ItemSpec] = item.GetMetadata ("Value");
ForEach (listOfArguments, (arg) => {
- ExecuteAsync (AOTCompilerPath, arg.Arguments, environment: environment, sdkDevPath: SdkDevPath, showErrorIfFailure: false /* we show our own error below */)
+ ExecuteAsync (AOTCompilerPath, arg.Arguments, environment: environment, showErrorIfFailure: false /* we show our own error below */)
.ContinueWith ((v) => {
if (v.Result.ExitCode != 0)
Log.LogError (MSBStrings.E7118 /* Failed to AOT compile {0}, the AOT compiler exited with code {1} */, Path.GetFileName (arg.Input), v.Result.ExitCode);
diff --git a/msbuild/Xamarin.MacDev.Tasks/Tasks/AlTool.cs b/msbuild/Xamarin.MacDev.Tasks/Tasks/AlTool.cs
index 366f00d9ada1..a36744ecd43e 100644
--- a/msbuild/Xamarin.MacDev.Tasks/Tasks/AlTool.cs
+++ b/msbuild/Xamarin.MacDev.Tasks/Tasks/AlTool.cs
@@ -27,9 +27,6 @@ public abstract class ALToolTaskBase : XamarinTask, ICancelableTask {
[Required]
public string FilePath { get; set; } = string.Empty;
- [Required]
- public string SdkDevPath { get; set; } = string.Empty;
-
protected abstract string ALToolAction { get; }
public override bool Execute ()
@@ -44,7 +41,7 @@ public override bool Execute ()
return false;
cancellationTokenSource = new CancellationTokenSource ();
- var rv = ExecuteAsync (Log, executable, args, sdkDevPath: SdkDevPath, cancellationToken: cancellationTokenSource.Token).Result;
+ var rv = ExecuteAsync (executable, args, cancellationToken: cancellationTokenSource.Token).Result;
LogErrorsFromOutput (rv.Output.MergedOutput);
return !Log.HasLoggedErrors;
}
diff --git a/msbuild/Xamarin.MacDev.Tasks/Tasks/Archive.cs b/msbuild/Xamarin.MacDev.Tasks/Tasks/Archive.cs
index 9fe3509612f2..f59676f4517d 100644
--- a/msbuild/Xamarin.MacDev.Tasks/Tasks/Archive.cs
+++ b/msbuild/Xamarin.MacDev.Tasks/Tasks/Archive.cs
@@ -156,7 +156,7 @@ public override bool Execute ()
ArchiveMSym (MSYMDir, archiveDir);
// Archive the Bitcode symbol maps
- var bcSymbolMaps = Directory.GetFiles (Path.GetDirectoryName (DSYMDir), "*.bcsymbolmap");
+ var bcSymbolMaps = Directory.GetFiles (Path.GetDirectoryName (DSYMDir)!, "*.bcsymbolmap");
if (bcSymbolMaps.Length > 0) {
var bcSymbolMapsDir = Path.Combine (archiveDir, "BCSymbolMaps");
@@ -306,7 +306,7 @@ void ArchiveAppExtension (ITaskItem appex, string archiveDir)
}
// Note: App Extension dSYM dirs exist alongside the main app bundle now that they are generated from the main app's MSBuild targets
- var dsymDir = Path.Combine (Path.GetDirectoryName (AppBundleDir.ItemSpec), Path.GetFileName (appex.ItemSpec) + ".dSYM");
+ var dsymDir = Path.Combine (Path.GetDirectoryName (AppBundleDir.ItemSpec)!, Path.GetFileName (appex.ItemSpec) + ".dSYM");
ArchiveDSym (dsymDir, archiveDir);
var msymDir = appex.ItemSpec + ".mSYM";
diff --git a/msbuild/Xamarin.MacDev.Tasks/Tasks/BGen.cs b/msbuild/Xamarin.MacDev.Tasks/Tasks/BGen.cs
index 803842390a4f..1dce72ab1386 100644
--- a/msbuild/Xamarin.MacDev.Tasks/Tasks/BGen.cs
+++ b/msbuild/Xamarin.MacDev.Tasks/Tasks/BGen.cs
@@ -215,7 +215,7 @@ public virtual List GenerateCommandLineArguments ()
};
// OutputAssembly is optional so it can be null
if (!string.IsNullOrEmpty (target)) {
- var d = Path.GetDirectoryName (target);
+ var d = Path.GetDirectoryName (target)!;
var n = Path.GetFileName (target);
customTags.Add ("targetpath", Path.Combine (d, n));
customTags.Add ("targetdir", d);
@@ -243,12 +243,12 @@ public override bool Execute ()
TaskItemFixer.FixItemSpecs (Log, item => OutputPath, References.Where (x => !x.IsFrameworkItem ()).ToArray ());
- var success = ExecuteRemotely (out var taskRunner);
-
- if (success)
+ if (ExecuteRemotely (out var taskRunner)) {
GetGeneratedSourcesAsync (taskRunner).Wait ();
+ return true;
+ }
- return success;
+ return false;
} catch (Exception ex) {
Log.LogErrorFromException (ex);
@@ -286,7 +286,7 @@ public override bool Execute ()
return false;
cancellationTokenSource = new CancellationTokenSource ();
- ExecuteAsync (Log, executable, args, environment: env, cancellationToken: cancellationTokenSource.Token).Wait ();
+ ExecuteAsync (executable, args, environment: env, cancellationToken: cancellationTokenSource.Token).Wait ();
return !Log.HasLoggedErrors;
}
diff --git a/msbuild/Xamarin.MacDev.Tasks/Tasks/Codesign.cs b/msbuild/Xamarin.MacDev.Tasks/Tasks/Codesign.cs
index 8d43e4cc110c..cf5a9f923574 100644
--- a/msbuild/Xamarin.MacDev.Tasks/Tasks/Codesign.cs
+++ b/msbuild/Xamarin.MacDev.Tasks/Tasks/Codesign.cs
@@ -341,7 +341,7 @@ bool TryGenerateCommandLineArguments (ITaskItem item, out IList args)
// on macOS apps {item.ItemSpec} can be a symlink to `Versions/Current/{item.ItemSpec}`
// and `Current` also a symlink to `A`... and `_CodeSignature` will be found there
var path = item.ItemSpec;
- var parent = Path.GetDirectoryName (path);
+ var parent = Path.GetDirectoryName (path)!;
// so do not don't sign `A.framework/A`, sign `A.framework` which will always sign the *bundle*
if ((Path.GetExtension (parent) == ".framework") && (Path.GetFileName (path) == Path.GetFileNameWithoutExtension (parent)))
@@ -362,7 +362,7 @@ void Sign (SignInfo info)
var environment = new Dictionary () {
{ "CODESIGN_ALLOCATE", GetCodesignAllocate (item) },
};
- var rv = ExecuteAsync (fileName, arguments, null, environment).Result;
+ var rv = ExecuteAsync (fileName, arguments, environment).Result;
var exitCode = rv.ExitCode;
var messages = rv.Output.StandardOutput;
@@ -464,7 +464,7 @@ bool ExecuteUnsafe ()
// while also not codesigning directories before files inside them.
foreach (var res in resourcesToSign) {
var path = res.ItemSpec;
- var parent = Path.GetDirectoryName (path);
+ var parent = Path.GetDirectoryName (path)!;
// so do not don't sign `A.framework/A`, sign `A.framework` which will always sign the *bundle*
if (Path.GetExtension (parent) == ".framework" && Path.GetFileName (path) == Path.GetFileNameWithoutExtension (parent))
diff --git a/msbuild/Xamarin.MacDev.Tasks/Tasks/CompileAppManifest.cs b/msbuild/Xamarin.MacDev.Tasks/Tasks/CompileAppManifest.cs
index c17f2793a349..4ba5f04dc0de 100644
--- a/msbuild/Xamarin.MacDev.Tasks/Tasks/CompileAppManifest.cs
+++ b/msbuild/Xamarin.MacDev.Tasks/Tasks/CompileAppManifest.cs
@@ -258,7 +258,11 @@ bool SetMinimumOSVersion (PDictionary plist)
}
}
+#if NET
if (string.IsNullOrEmpty (minimumOSVersionInManifest)) {
+#else
+ if (string.IsNullOrEmpty (minimumOSVersionInManifest) || minimumOSVersionInManifest is null) {
+#endif
// Nothing is specified in the Info.plist - use SupportedOSPlatformVersion, and if that's not set, then use the sdkVersion
if (!string.IsNullOrEmpty (convertedSupportedOSPlatformVersion)) {
minimumOSVersion = convertedSupportedOSPlatformVersion;
@@ -294,7 +298,7 @@ bool SetMinimumOSVersion (PDictionary plist)
return true;
}
- protected string? GetMinimumOSVersion (PDictionary plist, out Version version)
+ protected string? GetMinimumOSVersion (PDictionary plist, out Version? version)
{
var rv = plist.Get (PlatformFrameworkHelper.GetMinimumOSVersionKey (Platform))?.Value;
Version.TryParse (rv, out version);
diff --git a/msbuild/Xamarin.MacDev.Tasks/Tasks/CompileEntitlements.cs b/msbuild/Xamarin.MacDev.Tasks/Tasks/CompileEntitlements.cs
index 4287190635c9..4f0e68874e2e 100644
--- a/msbuild/Xamarin.MacDev.Tasks/Tasks/CompileEntitlements.cs
+++ b/msbuild/Xamarin.MacDev.Tasks/Tasks/CompileEntitlements.cs
@@ -558,7 +558,7 @@ public override bool Execute ()
var compiledEntitlementsFullPath = Path.GetFullPath (CompiledEntitlements!.ItemSpec);
var compiledEntitlementsFullPathItem = new TaskItem (compiledEntitlementsFullPath);
- Directory.CreateDirectory (Path.GetDirectoryName (compiledEntitlementsFullPath));
+ Directory.CreateDirectory (Path.GetDirectoryName (compiledEntitlementsFullPath)!);
if (BundleEntitlementsInExecutable) {
// Any entitlements the app desires are stored inside the executable for simulator builds,
diff --git a/msbuild/Xamarin.MacDev.Tasks/Tasks/CompileITunesMetadata.cs b/msbuild/Xamarin.MacDev.Tasks/Tasks/CompileITunesMetadata.cs
index 682279e0ef9a..11f35be9658f 100644
--- a/msbuild/Xamarin.MacDev.Tasks/Tasks/CompileITunesMetadata.cs
+++ b/msbuild/Xamarin.MacDev.Tasks/Tasks/CompileITunesMetadata.cs
@@ -69,7 +69,7 @@ public override bool Execute ()
metadata.Add ("softwareVersionBundleId", (PString) BundleIdentifier);
}
- Directory.CreateDirectory (Path.GetDirectoryName (OutputPath!.ItemSpec));
+ Directory.CreateDirectory (Path.GetDirectoryName (OutputPath!.ItemSpec)!);
metadata.Save (OutputPath.ItemSpec, true);
return !Log.HasLoggedErrors;
diff --git a/msbuild/Xamarin.MacDev.Tasks/Tasks/CompileNativeCode.cs b/msbuild/Xamarin.MacDev.Tasks/Tasks/CompileNativeCode.cs
index ea95c3530e4a..affd9e1f3fae 100644
--- a/msbuild/Xamarin.MacDev.Tasks/Tasks/CompileNativeCode.cs
+++ b/msbuild/Xamarin.MacDev.Tasks/Tasks/CompileNativeCode.cs
@@ -25,9 +25,6 @@ public class CompileNativeCode : XamarinTask, ICancelableTask, ITaskCallback {
[Required]
public string MinimumOSVersion { get; set; } = "";
- [Required]
- public string SdkDevPath { get; set; } = "";
-
[Required]
public string SdkRoot { get; set; } = "";
@@ -142,7 +139,7 @@ public override bool Execute ()
arguments.Add ("-c");
arguments.Add (src);
- processes [i] = ExecuteAsync ("xcrun", arguments, sdkDevPath: SdkDevPath);
+ processes [i] = ExecuteAsync ("xcrun", arguments);
}
System.Threading.Tasks.Task.WaitAll (processes);
diff --git a/msbuild/Xamarin.MacDev.Tasks/Tasks/CompileSceneKitAssets.cs b/msbuild/Xamarin.MacDev.Tasks/Tasks/CompileSceneKitAssets.cs
index 3f50e6199dee..82d47a98272b 100644
--- a/msbuild/Xamarin.MacDev.Tasks/Tasks/CompileSceneKitAssets.cs
+++ b/msbuild/Xamarin.MacDev.Tasks/Tasks/CompileSceneKitAssets.cs
@@ -37,9 +37,6 @@ public class CompileSceneKitAssets : XamarinTask, ICancelableTask, IHasProjectDi
[Required]
public ITaskItem [] SceneKitAssets { get; set; } = Array.Empty ();
- [Required]
- public string SdkDevPath { get; set; } = "";
-
[Required]
public string SdkPlatform { get; set; } = "";
@@ -86,15 +83,14 @@ Task CopySceneKitAssets (string scnassets, string output, string intermediate)
args.Add ($"--resources-folder-path={AppBundleName}");
var executable = GetExecutable (args, ToolName, CopySceneKitAssetsPath);
-
- return ExecuteAsync (executable, args, sdkDevPath: SdkDevPath, environment: environment, showErrorIfFailure: true);
+ return ExecuteAsync (executable, args, environment: environment, showErrorIfFailure: true);
}
static bool TryGetScnAssetsPath (string file, out string scnassets)
{
scnassets = file;
while (scnassets.Length > 0 && Path.GetExtension (scnassets).ToLowerInvariant () != ".scnassets")
- scnassets = Path.GetDirectoryName (scnassets);
+ scnassets = Path.GetDirectoryName (scnassets)!;
return scnassets.Length > 0;
}
diff --git a/msbuild/Xamarin.MacDev.Tasks/Tasks/ComputeBundleLocation.cs b/msbuild/Xamarin.MacDev.Tasks/Tasks/ComputeBundleLocation.cs
index a99e1df29bf4..9861a14ec597 100644
--- a/msbuild/Xamarin.MacDev.Tasks/Tasks/ComputeBundleLocation.cs
+++ b/msbuild/Xamarin.MacDev.Tasks/Tasks/ComputeBundleLocation.cs
@@ -211,7 +211,7 @@ static bool TryGetFrameworkDirectory (string path, out string? frameworkDirector
if (path.EndsWith (".framework", StringComparison.OrdinalIgnoreCase)) {
// We might be inside a .xcframework, so check for that first
- if (TryGetFrameworkDirectory (Path.GetDirectoryName (path), out var xcframeworkDirectory) && xcframeworkDirectory!.EndsWith (".xcframework", StringComparison.OrdinalIgnoreCase)) {
+ if (TryGetFrameworkDirectory (Path.GetDirectoryName (path)!, out var xcframeworkDirectory) && xcframeworkDirectory!.EndsWith (".xcframework", StringComparison.OrdinalIgnoreCase)) {
frameworkDirectory = xcframeworkDirectory;
return true;
}
@@ -220,7 +220,7 @@ static bool TryGetFrameworkDirectory (string path, out string? frameworkDirector
return true;
}
- return TryGetFrameworkDirectory (Path.GetDirectoryName (path), out frameworkDirectory);
+ return TryGetFrameworkDirectory (Path.GetDirectoryName (path)!, out frameworkDirectory);
}
// Check if the input, or any of it's parent directories is a *.resources directory or a *.resources.zip file next to a *.dll.
@@ -240,7 +240,7 @@ static bool IsBindingResourcePackage (string path, out PublishFolderType type)
return true;
}
- return IsBindingResourcePackage (Path.GetDirectoryName (path), out type);
+ return IsBindingResourcePackage (Path.GetDirectoryName (path)!, out type);
}
static string GetVirtualAppBundlePath (ITaskItem item)
@@ -294,7 +294,7 @@ PublishFolderType ComputePublishFolderType (IList items, ITaskItem it
var filename = item.ItemSpec;
var targetPath = item.GetMetadata ("TargetPath");
if (!string.IsNullOrEmpty (targetPath))
- filename = Path.Combine (Path.GetDirectoryName (filename), Path.GetFileName (targetPath));
+ filename = Path.Combine (Path.GetDirectoryName (filename)!, Path.GetFileName (targetPath));
// Check if the item came from @(BundleResource), @(Content) or @(EmbeddedResource)
if (resourceFilesSet.Contains (Path.GetFullPath (item.ItemSpec)))
diff --git a/msbuild/Xamarin.MacDev.Tasks/Tasks/ComputeCodesignItems.cs b/msbuild/Xamarin.MacDev.Tasks/Tasks/ComputeCodesignItems.cs
index 0173f0474810..78a1d6d2bc49 100644
--- a/msbuild/Xamarin.MacDev.Tasks/Tasks/ComputeCodesignItems.cs
+++ b/msbuild/Xamarin.MacDev.Tasks/Tasks/ComputeCodesignItems.cs
@@ -77,7 +77,7 @@ public override bool Execute ()
continue;
// Create a new item for the app bundle, and copy any metadata over.
- var bundlePath = Path.Combine (Path.GetDirectoryName (AppBundleDir), bundle.ItemSpec);
+ var bundlePath = Path.Combine (Path.GetDirectoryName (AppBundleDir)!, bundle.ItemSpec);
var item = new TaskItem (bundlePath);
bundle.CopyMetadataTo (item);
@@ -88,12 +88,12 @@ public override bool Execute ()
var additionalStampFiles = new List ();
// We must touch the dSYM directory's Info.plist, to ensure that we don't end up running dsymutil again after codesigning in the next build
var generateDSymItem = GenerateDSymItems.FirstOrDefault (v => {
- return string.Equals (Path.Combine (Path.GetDirectoryName (AppBundleDir), Path.GetDirectoryName (v.ItemSpec)), item.ItemSpec, StringComparison.OrdinalIgnoreCase);
+ return string.Equals (Path.Combine (Path.GetDirectoryName (AppBundleDir)!, Path.GetDirectoryName (v.ItemSpec)!), item.ItemSpec, StringComparison.OrdinalIgnoreCase);
});
if (generateDSymItem is not null)
additionalStampFiles.Add (generateDSymItem.GetMetadata ("dSYMUtilStampFile"));
// We must touch the stamp file for native stripping, to ensure that we don't want to run strip again after codesigning in the next build
- var nativeStripItem = NativeStripItems.FirstOrDefault (v => string.Equals (Path.Combine (Path.GetDirectoryName (AppBundleDir), Path.GetDirectoryName (v.ItemSpec)), item.ItemSpec, StringComparison.OrdinalIgnoreCase));
+ var nativeStripItem = NativeStripItems.FirstOrDefault (v => string.Equals (Path.Combine (Path.GetDirectoryName (AppBundleDir)!, Path.GetDirectoryName (v.ItemSpec)!), item.ItemSpec, StringComparison.OrdinalIgnoreCase));
if (nativeStripItem is not null)
additionalStampFiles.Add (nativeStripItem.GetMetadata ("StripStampFile"));
// Set the CodesignAdditionalFilesToTouch metadata
@@ -111,7 +111,7 @@ public override bool Execute ()
// - *.framework directories
// - *.xpc directories
foreach (var bundle in CodesignBundle) {
- var bundlePath = Path.Combine (Path.GetDirectoryName (Path.GetDirectoryName (appBundlePath)), bundle.ItemSpec);
+ var bundlePath = Path.Combine (Path.GetDirectoryName (Path.GetDirectoryName (appBundlePath)!)!, bundle.ItemSpec);
var filesToSign = FindFilesToSign (bundlePath);
foreach (var lib in filesToSign) {
if (Array.Find (CodesignItems, (v) => string.Equals (v.ItemSpec, lib, StringComparison.OrdinalIgnoreCase)) is not null)
@@ -207,7 +207,7 @@ void RemoveFilesToNotSign (List output, string appBundlePath)
// Canonicalize the paths and split into files and directories
var canonicalizedItemsToSkip = SkipCodesignItems
- .Select (v => Path.Combine (Path.GetDirectoryName (appBundlePath), v.ItemSpec))
+ .Select (v => Path.Combine (Path.GetDirectoryName (appBundlePath)!, v.ItemSpec))
.ToArray ();
var canonicalizedDirectoriesToSkip = canonicalizedItemsToSkip
.Where (v => Directory.Exists (v))
diff --git a/msbuild/Xamarin.MacDev.Tasks/Tasks/CoreMLCompiler.cs b/msbuild/Xamarin.MacDev.Tasks/Tasks/CoreMLCompiler.cs
index f30f62555eb7..1d17ae488e84 100644
--- a/msbuild/Xamarin.MacDev.Tasks/Tasks/CoreMLCompiler.cs
+++ b/msbuild/Xamarin.MacDev.Tasks/Tasks/CoreMLCompiler.cs
@@ -30,11 +30,6 @@ public class CoreMLCompiler : XamarinTask, ICancelableTask, IHasProjectDir, IHas
[Required]
public string ResourcePrefix { get; set; } = "";
- string sdkDevPath = "";
- public string SdkDevPath {
- get { return string.IsNullOrEmpty (sdkDevPath) ? "/" : sdkDevPath; }
- set { sdkDevPath = value; }
- }
#endregion
#region Outputs
@@ -60,7 +55,7 @@ int Compile (ITaskItem item, string outputDir, string log, string partialPlist)
args.Add (partialPlist);
var executable = GetExecutable (args, ToolName, CoreMlcPath);
- var rv = ExecuteAsync (executable, args, sdkDevPath).Result;
+ var rv = ExecuteAsync (executable, args).Result;
var exitCode = rv.ExitCode;
var output = rv.Output.StandardOutput;
File.WriteAllText (log, output);
@@ -115,7 +110,7 @@ IEnumerable GetCompiledOutput (string baseOutputDir, IDictionary GenerateCommandLineCommands ()
PkgPackagePath = Path.GetFullPath (PkgPackagePath);
args.Add (PkgPackagePath);
- Directory.CreateDirectory (Path.GetDirectoryName (PkgPackagePath));
+ Directory.CreateDirectory (Path.GetDirectoryName (PkgPackagePath)!);
return args;
}
@@ -133,10 +133,10 @@ void AppendExtraArgs (List args, string extraArgs)
string [] argv = StringUtils.ParseArguments (extraArgs);
var customTags = new Dictionary (StringComparer.OrdinalIgnoreCase) {
- { "projectdir", Path.GetDirectoryName (this.ProjectPath) },
+ { "projectdir", Path.GetDirectoryName (this.ProjectPath)! },
{ "appbundledir", this.AppBundleDir },
- { "targetpath", Path.Combine (Path.GetDirectoryName (target), Path.GetFileName (target)) },
- { "targetdir", Path.GetDirectoryName (target) },
+ { "targetpath", Path.Combine (Path.GetDirectoryName (target)!, Path.GetFileName (target)) },
+ { "targetdir", Path.GetDirectoryName (target)! },
{ "targetname", Path.GetFileName (target) },
{ "targetext", Path.GetExtension (target) },
};
diff --git a/msbuild/Xamarin.MacDev.Tasks/Tasks/CreatePkgInfo.cs b/msbuild/Xamarin.MacDev.Tasks/Tasks/CreatePkgInfo.cs
index a4a3d5d24001..75752b084692 100644
--- a/msbuild/Xamarin.MacDev.Tasks/Tasks/CreatePkgInfo.cs
+++ b/msbuild/Xamarin.MacDev.Tasks/Tasks/CreatePkgInfo.cs
@@ -27,7 +27,7 @@ public override bool Execute ()
return ExecuteRemotely ();
if (!File.Exists (OutputPath.ItemSpec)) {
- Directory.CreateDirectory (Path.GetDirectoryName (OutputPath.ItemSpec));
+ Directory.CreateDirectory (Path.GetDirectoryName (OutputPath.ItemSpec)!);
using (var stream = File.OpenWrite (OutputPath.ItemSpec)) {
stream.Write (PkgInfoData, 0, PkgInfoData.Length);
diff --git a/msbuild/Xamarin.MacDev.Tasks/Tasks/DSymUtil.cs b/msbuild/Xamarin.MacDev.Tasks/Tasks/DSymUtil.cs
index 58011d2fbc90..bb3abba9483c 100644
--- a/msbuild/Xamarin.MacDev.Tasks/Tasks/DSymUtil.cs
+++ b/msbuild/Xamarin.MacDev.Tasks/Tasks/DSymUtil.cs
@@ -21,9 +21,6 @@ public class DSymUtil : XamarinTask, ITaskCallback {
[Required]
public ITaskItem [] Executable { get; set; } = Array.Empty ();
- [Required]
- public string SdkDevPath { get; set; } = string.Empty;
-
#endregion
#region Outputs
@@ -65,7 +62,7 @@ void ExecuteDSymUtil (ITaskItem item, List contentFiles)
args.Add (dSymDir);
args.Add (Path.GetFullPath (item.ItemSpec));
- ExecuteAsync ("xcrun", args, sdkDevPath: SdkDevPath).Wait ();
+ ExecuteAsync ("xcrun", args).Wait ();
var contentsDir = Path.Combine (dSymDir, "Contents");
if (Directory.Exists (contentsDir))
diff --git a/msbuild/Xamarin.MacDev.Tasks/Tasks/DetectDebugNetworkConfiguration.cs b/msbuild/Xamarin.MacDev.Tasks/Tasks/DetectDebugNetworkConfiguration.cs
index 47d1ca2a496c..02cbc8d5b6e5 100644
--- a/msbuild/Xamarin.MacDev.Tasks/Tasks/DetectDebugNetworkConfiguration.cs
+++ b/msbuild/Xamarin.MacDev.Tasks/Tasks/DetectDebugNetworkConfiguration.cs
@@ -64,9 +64,8 @@ public override bool Execute ()
try {
socket.Connect ("8.8.8.8", 53);
- var ipEndPoint = (IPEndPoint) socket.LocalEndPoint;
-
- ips.Add (ipEndPoint.Address.ToString ());
+ if (socket.LocalEndPoint is IPEndPoint ipEndPoint)
+ ips.Add (ipEndPoint.Address.ToString ());
} catch {
Log.LogError (7001, null, MSBStrings.E7001);
return false;
@@ -75,9 +74,7 @@ public override bool Execute ()
}
} else {
foreach (var host in hosts) {
- IPAddress ip;
-
- if (IPAddress.TryParse (host, out ip))
+ if (IPAddress.TryParse (host, out var ip))
ips.Add (ip.ToString ());
}
}
diff --git a/msbuild/Xamarin.MacDev.Tasks/Tasks/DetectSdkLocation.cs b/msbuild/Xamarin.MacDev.Tasks/Tasks/DetectSdkLocation.cs
index 8b62df6c88e7..1f393504e6a8 100644
--- a/msbuild/Xamarin.MacDev.Tasks/Tasks/DetectSdkLocation.cs
+++ b/msbuild/Xamarin.MacDev.Tasks/Tasks/DetectSdkLocation.cs
@@ -15,13 +15,10 @@ public class DetectSdkLocations : XamarinTask, ICancelableTask {
const string SdkVersionDefaultValue = "default";
#region Inputs
- public string TargetArchitectures {
- get; set;
- } = "";
-
- public string IsDotNetSimulatorBuild {
+ [Required]
+ public bool SdkIsSimulator {
get; set;
- } = "";
+ }
#endregion Inputs
@@ -33,13 +30,9 @@ public string SdkRoot {
} = "";
[Output]
- public string SdkDevPath {
- get; set;
- } = "";
-
- [Output]
- public bool SdkIsSimulator {
- get; set;
+ public new string SdkDevPath {
+ get => base.SdkDevPath;
+ set => base.SdkDevPath = value;
}
[Output]
@@ -115,7 +108,7 @@ protected void EnsureSdkPath ()
}
Log.LogWarning (MSBStrings.E0173 /* The {0} SDK version '{1}' is not installed. Using newer version '{2}' instead'. */, PlatformName, requestedSdkVersion, sdkVersion);
}
- SdkVersion = sdkVersion.ToString ();
+ SdkVersion = sdkVersion.ToString () ?? "";
SdkRoot = currentSdk.GetSdkPath (SdkVersion, SdkIsSimulator);
if (string.IsNullOrEmpty (SdkRoot))
@@ -154,8 +147,6 @@ bool ExecuteImpl ()
AppleSdkSettings.Init ();
- SetIsSimulator ();
-
if (EnsureAppleSdkRoot ())
EnsureSdkPath ();
EnsureXamarinSdkRoot ();
@@ -165,25 +156,6 @@ bool ExecuteImpl ()
return !Log.HasLoggedErrors;
}
- void SetIsSimulator ()
- {
- switch (Platform) {
- case ApplePlatform.MacCatalyst:
- case ApplePlatform.MacOSX:
- return;
- }
-
- TargetArchitecture architectures;
- if (string.IsNullOrEmpty (TargetArchitectures) || !Enum.TryParse (TargetArchitectures, out architectures))
- architectures = TargetArchitecture.Default;
-
- if (!string.IsNullOrEmpty (IsDotNetSimulatorBuild)) {
- SdkIsSimulator = string.Equals (IsDotNetSimulatorBuild, "true", StringComparison.OrdinalIgnoreCase);
- } else {
- SdkIsSimulator = (architectures & (TargetArchitecture.i386 | TargetArchitecture.x86_64)) != 0;
- }
- }
-
protected bool EnsureAppleSdkRoot ()
{
var currentSdk = CurrentSdk;
diff --git a/msbuild/Xamarin.MacDev.Tasks/Tasks/DetectSigningIdentity.cs b/msbuild/Xamarin.MacDev.Tasks/Tasks/DetectSigningIdentity.cs
index f3797f0c3bca..96bd8d1455b3 100644
--- a/msbuild/Xamarin.MacDev.Tasks/Tasks/DetectSigningIdentity.cs
+++ b/msbuild/Xamarin.MacDev.Tasks/Tasks/DetectSigningIdentity.cs
@@ -405,8 +405,14 @@ bool TryGetSigningCertificates ([NotNullWhen (true)] out IList
}
class SigningIdentityComparer : IComparer {
- public int Compare (CodeSignIdentity x, CodeSignIdentity y)
+ public int Compare (CodeSignIdentity? x, CodeSignIdentity? y)
{
+ if (x is null && y is null)
+ return 0;
+ if (x is null)
+ return -1;
+ if (y is null)
+ return 1;
// reverse sort by provisioning profile creation date
return y.Profile!.CreationDate.CompareTo (x.Profile!.CreationDate);
}
diff --git a/msbuild/Xamarin.MacDev.Tasks/Tasks/Ditto.cs b/msbuild/Xamarin.MacDev.Tasks/Tasks/Ditto.cs
index 89abe8e02b67..c1d40d685b6a 100644
--- a/msbuild/Xamarin.MacDev.Tasks/Tasks/Ditto.cs
+++ b/msbuild/Xamarin.MacDev.Tasks/Tasks/Ditto.cs
@@ -61,7 +61,7 @@ public override bool Execute ()
// This is executed directly on Windows for remote builds
var stampPath = StampFile?.ItemSpec;
if (!string.IsNullOrEmpty (stampPath)) {
- Directory.CreateDirectory (Path.GetDirectoryName (stampPath));
+ Directory.CreateDirectory (Path.GetDirectoryName (stampPath)!);
var src = Source?.ItemSpec;
var destination = Destination?.ItemSpec;
File.WriteAllText (stampPath, $"{src} -> {destination}");
@@ -103,7 +103,7 @@ bool ExecuteImpl ()
}
cancellationTokenSource = new CancellationTokenSource ();
- ExecuteAsync (Log, executable, args, cancellationToken: cancellationTokenSource.Token).Wait ();
+ ExecuteAsync (executable, args, cancellationToken: cancellationTokenSource.Token).Wait ();
// Create a list of all the files we've copied
if (CreateOutputFiles) {
diff --git a/msbuild/Xamarin.MacDev.Tasks/Tasks/EmbedProvisionProfile.cs b/msbuild/Xamarin.MacDev.Tasks/Tasks/EmbedProvisionProfile.cs
index a738d93a8c9f..146d4b3a9b0e 100644
--- a/msbuild/Xamarin.MacDev.Tasks/Tasks/EmbedProvisionProfile.cs
+++ b/msbuild/Xamarin.MacDev.Tasks/Tasks/EmbedProvisionProfile.cs
@@ -60,7 +60,7 @@ public override bool Execute ()
return true;
}
- Directory.CreateDirectory (Path.GetDirectoryName (embedded));
+ Directory.CreateDirectory (Path.GetDirectoryName (embedded)!);
profile.Save (embedded);
return true;
diff --git a/msbuild/Xamarin.MacDev.Tasks/Tasks/FilterStaticFrameworks.cs b/msbuild/Xamarin.MacDev.Tasks/Tasks/FilterStaticFrameworks.cs
index 33b62637243f..2bc6874fd2e6 100644
--- a/msbuild/Xamarin.MacDev.Tasks/Tasks/FilterStaticFrameworks.cs
+++ b/msbuild/Xamarin.MacDev.Tasks/Tasks/FilterStaticFrameworks.cs
@@ -82,7 +82,7 @@ public override bool Execute ()
frameworkExecutablePath = GetFrameworkExecutablePath (frameworkExecutablePath, Platform, Log);
}
- if (OnlyFilterFrameworks && !Path.GetDirectoryName (frameworkExecutablePath).EndsWith (".framework", StringComparison.OrdinalIgnoreCase)) {
+ if (OnlyFilterFrameworks && !Path.GetDirectoryName (frameworkExecutablePath)!.EndsWith (".framework", StringComparison.OrdinalIgnoreCase)) {
Log.LogMessage (MessageImportance.Low, $"Skipped processing {item.ItemSpec} because it's not a framework");
continue;
}
@@ -120,9 +120,16 @@ public IEnumerable GetAdditionalItemsToBeCopied ()
if (FrameworkToPublish is not null) {
foreach (var item in FrameworkToPublish) {
var fw = item.ItemSpec;
+ var finfo = new FileInfo (fw);
// Copy all the files from the framework to the mac (copying only the executable won't work if it's just a symlink to elsewhere)
- if (File.Exists (fw))
+ if (finfo.Exists) {
+ if (finfo.Length == 0) {
+ // an empty file is most likely an output file from the Mac, so don't overwrite the corresponding file on the Mac with the empty output file from Windows
+ Log.LogMessage (MessageImportance.Low, "Not copying {0} to the Mac, it's an empty file.", fw);
+ continue;
+ }
fw = Path.GetDirectoryName (fw);
+ }
if (!Directory.Exists (fw))
continue;
foreach (var file in Directory.EnumerateFiles (fw, "*.*", SearchOption.AllDirectories)) {
diff --git a/msbuild/Xamarin.MacDev.Tasks/Tasks/FindILLink.cs b/msbuild/Xamarin.MacDev.Tasks/Tasks/FindILLink.cs
index 464a3ac771ce..68072e722367 100644
--- a/msbuild/Xamarin.MacDev.Tasks/Tasks/FindILLink.cs
+++ b/msbuild/Xamarin.MacDev.Tasks/Tasks/FindILLink.cs
@@ -24,7 +24,7 @@ protected override bool ExecuteLocally ()
return false;
if (!string.IsNullOrEmpty (illinkTaskPath))
- ILLinkPath = Path.Combine (Path.GetDirectoryName (illinkTaskPath), "illink.dll");
+ ILLinkPath = Path.Combine (Path.GetDirectoryName (illinkTaskPath)!, "illink.dll");
if (!File.Exists (ILLinkPath))
Log.LogError (MSBStrings.E7115 /*"The illink assembly doesn't exist: '{0}'" */, ILLinkPath);
diff --git a/msbuild/Xamarin.MacDev.Tasks/Tasks/GetAvailableDevices.cs b/msbuild/Xamarin.MacDev.Tasks/Tasks/GetAvailableDevices.cs
new file mode 100644
index 000000000000..7b26fc4fb179
--- /dev/null
+++ b/msbuild/Xamarin.MacDev.Tasks/Tasks/GetAvailableDevices.cs
@@ -0,0 +1,447 @@
+using System;
+using System.IO;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text.Json;
+using System.Threading;
+
+using Microsoft.Build.Framework;
+using Microsoft.Build.Utilities;
+
+using Xamarin.Localization.MSBuild;
+using Xamarin.Messaging.Build.Client;
+using Xamarin.Utils;
+
+namespace Xamarin.MacDev.Tasks;
+
+public class GetAvailableDevices : XamarinTask, ICancelableTask {
+ // The app manifest is optional, we won't compile it if it hasn't already been compiled,
+ // but we'll read it if it exist (in the app bundle).
+ public string AppBundleManifestPath { get; set; } = string.Empty;
+
+ [Output]
+ public ITaskItem [] Devices { get; set; } = Array.Empty ();
+
+ [Output]
+ public ITaskItem [] DiscardedDevices { get; set; } = Array.Empty ();
+
+ public string RuntimeIdentifier { get; set; } = "";
+
+ public bool Verbose { get; set; }
+
+ CancellationTokenSource? cancellationTokenSource;
+
+ public override bool Execute ()
+ {
+ if (ShouldExecuteRemotely ())
+ return ExecuteRemotely ();
+
+ cancellationTokenSource = new CancellationTokenSource ();
+
+ // run devicectl and simctl in parallel
+ var devicectlTask = RunDeviceCtlAsync ();
+ var simctlTask = RunSimCtlAsync ();
+
+ System.Threading.Tasks.Task.WhenAll (new [] { devicectlTask, simctlTask }).Wait (cancellationTokenSource.Token);
+
+ var devices = new List ();
+ devices.AddRange (devicectlTask.Result);
+ devices.AddRange (simctlTask.Result);
+
+ // filter to the current platform
+ foreach (var d in devices.Where (d => !d.Discarded && d.Platform != Platform))
+ d.DiscardedReason = $"Device platform '{d.Platform.AsString ()}' does not match the requested platform '{Platform.AsString ()}'";
+
+ // filter to the current RuntimeIdentifier, if specified
+ if (!string.IsNullOrEmpty (RuntimeIdentifier)) {
+ foreach (var d in devices.Where (d => string.IsNullOrEmpty (d.DiscardedReason) && d.RuntimeIdentifiers.Any () && !d.RuntimeIdentifiers.Contains (RuntimeIdentifier)))
+ d.DiscardedReason = $"Device runtime identifier(s) '{string.Join ("', '", d.RuntimeIdentifiers)}' incompatible with the requested runtime identifier '{RuntimeIdentifier}'";
+ }
+
+ // filter to values we find in the app manifest, if it exists
+ if (File.Exists (AppBundleManifestPath)) {
+ var appManifest = PDictionary.FromFile (AppBundleManifestPath)!;
+
+ var uiDeviceFamily = appManifest.GetUIDeviceFamily ();
+ // an iPhone app can run on an iPad, but an iPad app cannot run on an iPhone
+ var onlyShowIPads = uiDeviceFamily == IPhoneDeviceType.IPad;
+ if (onlyShowIPads) {
+ foreach (var d in devices.Where (d => !d.Discarded && d.DeviceType != IPhoneDeviceType.IPad))
+ d.DiscardedReason = "Device is not an iPad, but the app only supports iPads";
+ }
+
+ string minimumOSVersionString;
+ switch (Platform) {
+ case ApplePlatform.iOS:
+ case ApplePlatform.TVOS:
+ minimumOSVersionString = appManifest.GetMinimumOSVersion ();
+ break;
+ case ApplePlatform.MacCatalyst:
+ case ApplePlatform.MacOSX:
+ minimumOSVersionString = appManifest.GetMinimumSystemVersion ();
+ break;
+ default:
+ throw new InvalidOperationException (string.Format (MSBStrings.InvalidPlatform, Platform));
+ }
+ if (Version.TryParse (minimumOSVersionString, out var minimumOSVersion)) {
+ foreach (var d in devices.Where (d => !d.Discarded && d.MinimumOSVersion < minimumOSVersion))
+ d.DiscardedReason = $"Device OS version '{d.MinimumOSVersion}' is lower than the app's minimum OS version '{minimumOSVersion}'";
+ foreach (var d in devices.Where (d => !d.Discarded && d.MaximumOSVersion < minimumOSVersion))
+ d.DiscardedReason = $"Device maximum OS version '{d.MaximumOSVersion}' is lower than the app's minimum OS version '{minimumOSVersion}'";
+ }
+ }
+
+ // Set the 'RuntimeIdentifier' metadata on every device
+ foreach (var d in devices) {
+ if (!d.RuntimeIdentifiers.Any ())
+ continue;
+ if (d.RuntimeIdentifiers.Count () == 1) {
+ d.Item.SetMetadata ("RuntimeIdentifier", d.RuntimeIdentifiers.First ());
+ continue;
+ }
+ // if we have multiple runtime identifiers, we're running in the simulator, and one is x64 and the other is arm64.
+ // if we can run on arm64, then pick the arm64 simulator, otherwise pick the x64 simulator
+ d.Item.SetMetadata ("RuntimeIdentifier", d.RuntimeIdentifiers.Single (v => v.Contains ("arm64") == CanRunArm64));
+ }
+
+ DiscardedDevices = devices.Where (d => d.Discarded).Select (v => {
+ v.Item.SetMetadata ("DiscardedReason", v.DiscardedReason);
+ return v.Item;
+ }).ToArray ();
+
+ // sort the devices, so we return them in a stable order
+ var sortedDevices = devices
+ .Where (d => !d.Discarded) // discard discarded devices
+ .OrderByDescending (d => d.MinimumOSVersion) // newer devices first (probably has duplicates)
+ .ThenBy (d => d.Item.GetMetadata ("Name")) // then sort by name (may have duplicates)
+ .ThenBy (d => d.Item.ItemSpec); // and finally by UDID, which should be unique
+
+ Devices = sortedDevices.Select (d => d.Item).ToArray ();
+
+ if (Verbose) {
+ foreach (var dd in DiscardedDevices)
+ Log.LogWarning ("Discarded '{0}' because: {1}", dd.ItemSpec, dd.GetMetadata ("DiscardedReason"));
+ }
+
+ return true;
+ }
+
+ class DeviceInfo {
+ public ITaskItem Item { get; set; }
+ public IEnumerable RuntimeIdentifiers { get; set; }
+ public ApplePlatform Platform { get; set; }
+ public IPhoneDeviceType DeviceType { get; set; }
+ public Version MinimumOSVersion { get; set; }
+ public Version MaximumOSVersion { get; set; }
+ public string DiscardedReason { get; set; }
+ public bool Discarded { get => !string.IsNullOrEmpty (DiscardedReason); }
+ public DeviceInfo (ITaskItem item, IEnumerable runtimeIdentifiers, ApplePlatform platform, IPhoneDeviceType deviceType, Version minimumOSVersion, Version maximumOSVersion, string discardedReason)
+ {
+ Item = item;
+ RuntimeIdentifiers = runtimeIdentifiers;
+ Platform = platform;
+ DeviceType = deviceType;
+ MinimumOSVersion = minimumOSVersion;
+ MaximumOSVersion = maximumOSVersion;
+ DiscardedReason = discardedReason;
+ }
+ }
+
+ protected virtual async System.Threading.Tasks.Task ExecuteCtlAsync (params string [] args)
+ {
+ var tmpfile = Path.GetTempFileName ();
+ try {
+ var arguments = new List (args) {
+ "--json-output=" + tmpfile
+ };
+ await ExecuteAsync ("xcrun", arguments, cancellationToken: cancellationTokenSource!.Token);
+ return File.ReadAllText (tmpfile);
+ } finally {
+ File.Delete (tmpfile);
+ }
+ }
+
+ async System.Threading.Tasks.Task ExecuteCtlToJsonAsync (params string [] args)
+ {
+ var json = await ExecuteCtlAsync (args);
+ var options = new JsonDocumentOptions {
+ AllowTrailingCommas = true,
+ CommentHandling = JsonCommentHandling.Skip,
+ };
+ return JsonDocument.Parse (string.IsNullOrEmpty (json) ? "{}" : json, options);
+ }
+
+ async System.Threading.Tasks.Task> RunDeviceCtlAsync ()
+ {
+ var doc = await ExecuteCtlToJsonAsync ("devicectl", "list", "devices");
+ var array = doc.FindProperty ("result", "devices")?.EnumerateIfArray ();
+ var rv = new List ();
+ if (array is not null) {
+ foreach (var device in array) {
+ var name = device.GetStringPropertyOrEmpty ("deviceProperties", "name");
+ var udid = device.GetStringPropertyOrEmpty ("hardwareProperties", "udid");
+
+ var deviceProperties = device.GetNullableProperty ("deviceProperties");
+ var buildVersion = deviceProperties.GetStringPropertyOrEmpty ("osBuildUpdate");
+ var productVersion = deviceProperties.GetStringPropertyOrEmpty ("osVersionNumber");
+
+ var hardwareProperties = device.GetNullableProperty ("hardwareProperties");
+ var deviceClass = hardwareProperties.GetStringPropertyOrEmpty ("deviceType");
+ var hardwareModel = hardwareProperties.GetStringPropertyOrEmpty ("hardwareModel");
+ var hardwarePlatform = hardwareProperties.GetStringPropertyOrEmpty ("platform");
+ var productType = hardwareProperties.GetStringPropertyOrEmpty ("productType");
+ var serialNumber = hardwareProperties.GetStringPropertyOrEmpty ("serialNumber");
+ var uniqueChipID = hardwareProperties.GetUInt64Property ("ecid");
+
+ var cpuType = hardwareProperties.GetNullableProperty ("cpuType");
+ var cpuArchitecture = cpuType.GetStringPropertyOrEmpty ("name");
+
+ var connectionProperties = device.GetNullableProperty ("connectionProperties");
+ var transportType = connectionProperties.GetStringPropertyOrEmpty ("transportType");
+ var pairingState = connectionProperties.GetStringPropertyOrEmpty ("pairingState");
+
+ var item = new TaskItem (udid);
+ item.SetMetadata ("Name", name);
+ item.SetMetadata ("BuildVersion", buildVersion);
+ item.SetMetadata ("DeviceClass", deviceClass);
+ item.SetMetadata ("HardwareModel", hardwareModel);
+ item.SetMetadata ("Platform", hardwarePlatform);
+ item.SetMetadata ("ProductType", productType);
+ item.SetMetadata ("SerialNumber", serialNumber);
+ item.SetMetadata ("UniqueChipID", uniqueChipID?.ToString () ?? string.Empty);
+ item.SetMetadata ("CPUArchitecture", cpuArchitecture);
+ item.SetMetadata ("TransportType", transportType);
+ item.SetMetadata ("PairingState", pairingState);
+
+ // we provide the following metadata for both simulator and device
+ item.SetMetadata ("Description", name);
+ item.SetMetadata ("Type", "Device");
+ item.SetMetadata ("OSVersion", productVersion);
+ item.SetMetadata ("UDID", udid);
+
+ // compute the platform and runtime identifier
+ var runtimeIdentifier = "";
+ ApplePlatform platform;
+ IPhoneDeviceType deviceType;
+ var discardedReason = "";
+ switch (deviceClass.ToLowerInvariant ()) {
+ case "iphone":
+ case "ipod":
+ runtimeIdentifier += "ios-";
+ platform = ApplePlatform.iOS;
+ deviceType = IPhoneDeviceType.IPhone;
+ break;
+ case "ipad":
+ runtimeIdentifier += "ios-";
+ platform = ApplePlatform.iOS;
+ deviceType = IPhoneDeviceType.IPad;
+ break;
+ case "appletv":
+ runtimeIdentifier += "tvos-";
+ platform = ApplePlatform.TVOS;
+ deviceType = IPhoneDeviceType.TV;
+ break;
+ case "applewatch":
+ case "visionos":
+ default:
+ platform = ApplePlatform.None;
+ deviceType = IPhoneDeviceType.NotSet;
+ discardedReason = $"'{deviceClass}' devices are not supported";
+ break;
+ }
+
+ if (string.IsNullOrEmpty (discardedReason)) {
+ switch (cpuArchitecture.ToLowerInvariant ()) {
+ case "arm64":
+ case "arm64e":
+ // arm64 and arm64e are both arm64 for our purposes
+ runtimeIdentifier += "arm64";
+ break;
+ default:
+ discardedReason = $"Unknown CPU architecture '{cpuArchitecture}'";
+ break;
+ }
+ }
+
+ Version.TryParse (productVersion, out var minimumOSVersion);
+ var maximumOSVersion = new Version (65535, 255, 255);
+
+ rv.Add (new DeviceInfo (item, [runtimeIdentifier], platform, deviceType, minimumOSVersion ?? new Version (0, 0), maximumOSVersion, discardedReason));
+ }
+ }
+ return rv;
+ }
+
+ async System.Threading.Tasks.Task> RunSimCtlAsync ()
+ {
+ var doc = await ExecuteCtlToJsonAsync ("simctl", "list", "--json");
+ var rv = new List ();
+
+ var runtimes = new Dictionary ();
+ if (doc.TryGetProperty ("runtimes", out var runtimesElement)) {
+ foreach (var runtime in runtimesElement.EnumerateIfArray ()) {
+ var name = runtime.GetStringProperty ("identifier") ?? string.Empty;
+ runtimes [name] = runtime;
+ }
+ }
+
+ var deviceTypes = new Dictionary ();
+ if (doc.TryGetProperty ("devicetypes", out var deviceTypesElement)) {
+ foreach (var deviceType in deviceTypesElement.EnumerateIfArray ()) {
+ var name = deviceType.GetStringProperty ("identifier") ?? string.Empty;
+ deviceTypes [name] = deviceType;
+ }
+ }
+
+ if (doc.TryGetProperty ("devices", out var devicesElement)) {
+ foreach (var runtime in devicesElement.EnumerateObject ()) {
+ var runtimeName = runtime.Name;
+ var hasRuntime = runtimes.TryGetValue (runtimeName, out var runtimeElement);
+ var runtimePlatform = hasRuntime ? runtimeElement.GetStringProperty ("platform") ?? string.Empty : string.Empty;
+ var runtimeVersion = hasRuntime ? runtimeElement.GetStringProperty ("version") ?? string.Empty : string.Empty;
+ var supportedArchitectures = hasRuntime ? runtimeElement.GetProperty ("supportedArchitectures").EnumerateIfArray ().Select (v => v.GetString () ?? "") : Enumerable.Empty ();
+ foreach (var element in runtime.Value.EnumerateIfArray ()) {
+ var udid = element.GetStringProperty ("udid") ?? string.Empty;
+ var isAvailable = element.GetBooleanProperty ("isAvailable") ?? false;
+ var availabilityError = element.GetStringProperty ("availabilityError") ?? string.Empty;
+ var deviceTypeIdentifier = element.GetStringProperty ("deviceTypeIdentifier") ?? string.Empty;
+ var state = element.GetStringProperty ("state") ?? string.Empty;
+ var name = element.GetStringProperty ("name") ?? string.Empty;
+
+ var item = new TaskItem (udid);
+ item.SetMetadata ("Runtime", runtimeName);
+ item.SetMetadata ("IsAvailable", isAvailable.ToString ());
+ item.SetMetadata ("AvailabilityError", availabilityError);
+ item.SetMetadata ("DeviceTypeIdentifier", deviceTypeIdentifier);
+ item.SetMetadata ("State", state);
+ item.SetMetadata ("Name", name);
+ item.SetMetadata ("SupportedArchitectures", string.Join (",", supportedArchitectures));
+
+ // we provide the following metadata for both simulator and device
+ item.SetMetadata ("Description", name);
+ item.SetMetadata ("Type", "Simulator");
+ item.SetMetadata ("OSVersion", runtimeVersion);
+ item.SetMetadata ("UDID", udid);
+
+ var discardedReason = "";
+ var runtimeIdentifier = "";
+ var runtimeIdentifiers = new List ();
+ if (isAvailable) {
+ switch (runtimePlatform.ToLowerInvariant ()) {
+ case "ios":
+ runtimeIdentifier += "iossimulator-";
+ break;
+ case "tvos":
+ runtimeIdentifier += "tvossimulator-";
+ break;
+ default:
+ discardedReason = $"'{runtimePlatform}' simulators are not supported";
+ break;
+ }
+
+ // pick the first architecture as the simulator architecture
+ if (string.IsNullOrEmpty (discardedReason)) {
+ foreach (var arch in supportedArchitectures) {
+ switch (arch.ToLowerInvariant ()) {
+ case "x64":
+ case "x86_64":
+ runtimeIdentifiers.Add (runtimeIdentifier + "x64");
+ break;
+ case "arm64":
+ runtimeIdentifiers.Add (runtimeIdentifier + "arm64");
+ if (!CanRunArm64)
+ discardedReason = $"Can't run an arm64 simulator on an x86_64 macOS desktop.";
+ break;
+ default:
+ discardedReason = $"Unknown CPU architecture '{arch}'";
+ break;
+ }
+ }
+ }
+ } else {
+ discardedReason = $"Device is not available: {availabilityError}";
+ }
+
+ var platformName = runtimeName.Replace ("com.apple.CoreSimulator.SimRuntime.", "").Split ('-') [0];
+ var platform = ApplePlatform.None;
+ if (string.IsNullOrEmpty (discardedReason)) {
+ switch (platformName.ToLowerInvariant ()) {
+ case "ios":
+ platform = ApplePlatform.iOS;
+ break;
+ case "tvos":
+ platform = ApplePlatform.TVOS;
+ break;
+ case "watchos":
+ case "visionos":
+ default:
+ discardedReason = $"'{platformName}' simulators are not supported";
+ break;
+ }
+ }
+ var deviceType = IPhoneDeviceType.NotSet;
+ var minimumOSVersion = new Version (0, 0);
+ var maximumOSVersion = new Version (65535, 255, 255);
+ if (string.IsNullOrEmpty (discardedReason)) {
+ if (deviceTypes.TryGetValue (deviceTypeIdentifier, out var deviceTypeElement)) {
+ var productFamily = deviceTypeElement.GetStringProperty ("productFamily") ?? string.Empty;
+ switch (productFamily.ToLowerInvariant ()) {
+ case "iphone":
+ case "ipod":
+ deviceType = IPhoneDeviceType.IPhone;
+ break;
+ case "ipad":
+ deviceType = IPhoneDeviceType.IPad;
+ break;
+ case "appletv":
+ case "apple tv":
+ deviceType = IPhoneDeviceType.TV;
+ break;
+ default:
+ discardedReason = $"Unknown product family '{productFamily}'";
+ break;
+ }
+ if (Version.TryParse (deviceTypeElement.GetStringProperty ("minRuntimeVersionString"), out var parsedMinimumOSVersion))
+ minimumOSVersion = parsedMinimumOSVersion;
+ if (Version.TryParse (deviceTypeElement.GetStringProperty ("maxRuntimeVersionString"), out var parsedMaximumOSVersion))
+ maximumOSVersion = parsedMaximumOSVersion;
+ } else {
+ discardedReason = $"Unknown device type identifier '{deviceTypeIdentifier}'";
+ }
+ }
+
+ rv.Add (new DeviceInfo (item, runtimeIdentifiers, platform, deviceType, minimumOSVersion, maximumOSVersion, discardedReason));
+ }
+ }
+ }
+ return rv;
+ }
+
+ public void Cancel ()
+ {
+ if (ShouldExecuteRemotely ())
+ BuildConnection.CancelAsync (BuildEngine4).Wait ();
+
+ cancellationTokenSource?.Cancel ();
+ }
+
+ // Return true if the current machine can run ARM64 binaries.
+ static bool? canRunArm64;
+ public static bool CanRunArm64 {
+ get {
+ if (!canRunArm64.HasValue) {
+ int rv = 0;
+ IntPtr size = (IntPtr) sizeof (int);
+ if (sysctlbyname ("hw.optional.arm64", ref rv, ref size, IntPtr.Zero, IntPtr.Zero) == 0) {
+ canRunArm64 = rv == 1;
+ } else {
+ canRunArm64 = false;
+ }
+ }
+ return canRunArm64.Value;
+ }
+ }
+
+ [DllImport ("libc")]
+ static extern int sysctlbyname (string name, ref int value, ref IntPtr size, IntPtr zero, IntPtr zeroAgain);
+}
diff --git a/msbuild/Xamarin.MacDev.Tasks/Tasks/GetFullPaths.cs b/msbuild/Xamarin.MacDev.Tasks/Tasks/GetFullPaths.cs
index 9c1249946635..dbac5618c101 100644
--- a/msbuild/Xamarin.MacDev.Tasks/Tasks/GetFullPaths.cs
+++ b/msbuild/Xamarin.MacDev.Tasks/Tasks/GetFullPaths.cs
@@ -65,7 +65,16 @@ bool ExecuteLocally ()
return !Log.HasLoggedErrors;
}
- public bool ShouldCopyToBuildServer (ITaskItem item) => true;
+ public bool ShouldCopyToBuildServer (ITaskItem item)
+ {
+ var finfo = new FileInfo (item.ItemSpec);
+ if (finfo.Exists && finfo.Length == 0) {
+ // an empty file is most likely an output file from the Mac, so don't overwrite the corresponding file on the Mac with the empty output file from Windows
+ Log.LogMessage (MessageImportance.Low, "Not copying {0} to the Mac, it's an empty file.", item.ItemSpec);
+ return false;
+ }
+ return true;
+ }
public bool ShouldCreateOutputFile (ITaskItem item) => false;
diff --git a/msbuild/Xamarin.MacDev.Tasks/Tasks/GetMlaunchArguments.cs b/msbuild/Xamarin.MacDev.Tasks/Tasks/GetMlaunchArguments.cs
index 0c0f8efc00f6..10e0d706a290 100644
--- a/msbuild/Xamarin.MacDev.Tasks/Tasks/GetMlaunchArguments.cs
+++ b/msbuild/Xamarin.MacDev.Tasks/Tasks/GetMlaunchArguments.cs
@@ -27,9 +27,6 @@ public class GetMlaunchArguments : XamarinTask, ICancelableTask {
public string AppManifestPath { get; set; } = string.Empty;
- [Required]
- public string SdkDevPath { get; set; } = string.Empty;
-
public ITaskItem [] AdditionalArguments { get; set; } = Array.Empty ();
public string DeviceName { get; set; } = string.Empty;
public ITaskItem [] EnvironmentVariables { get; set; } = Array.Empty ();
@@ -71,12 +68,14 @@ public IPhoneDeviceType DeviceType {
string productFamily;
switch (DeviceType) {
case IPhoneDeviceType.IPhone:
- case IPhoneDeviceType.IPad:
- case IPhoneDeviceType.TV:
- productFamily = DeviceType.ToString ();
+ productFamily = "iPhone";
break;
+ case IPhoneDeviceType.IPad:
case IPhoneDeviceType.IPhoneAndIPad:
- productFamily = "IPad";
+ productFamily = "iPad";
+ break;
+ case IPhoneDeviceType.TV:
+ productFamily = "Apple TV";
break;
default:
throw new InvalidOperationException ($"Invalid device type: {DeviceType}");
@@ -86,13 +85,13 @@ public IPhoneDeviceType DeviceType {
var xml = new XmlDocument ();
xml.LoadXml (output);
// Get the device types for the product family we're looking for
- var nodes = xml.SelectNodes ($"/MTouch/Simulator/SupportedDeviceTypes/SimDeviceType[ProductFamilyId='{productFamily}']").Cast ();
+ var nodes = xml.SelectNodes ($"/MTouch/Simulator/SupportedDeviceTypes/SimDeviceType[ProductFamilyId='{productFamily}']")?.Cast () ?? Array.Empty ();
// Create a list of them all
var deviceTypes = new List<(long Min, long Max, string Identifier)> ();
foreach (var node in nodes) {
- var minRuntimeVersionValue = node.SelectSingleNode ("MinRuntimeVersion").InnerText;
- var maxRuntimeVersionValue = node.SelectSingleNode ("MaxRuntimeVersion").InnerText;
- var identifier = node.SelectSingleNode ("Identifier").InnerText;
+ var minRuntimeVersionValue = node.SelectSingleNode ("MinRuntimeVersion")?.InnerText ?? string.Empty;
+ var maxRuntimeVersionValue = node.SelectSingleNode ("MaxRuntimeVersion")?.InnerText ?? string.Empty;
+ var identifier = node.SelectSingleNode ("Identifier")?.InnerText ?? string.Empty;
if (!long.TryParse (minRuntimeVersionValue, out var minRuntimeVersion))
continue;
if (!long.TryParse (maxRuntimeVersionValue, out var maxRuntimeVersion))
@@ -112,7 +111,7 @@ public IPhoneDeviceType DeviceType {
var tmpfile = Path.GetTempFileName ();
try {
var output = new StringBuilder ();
- var result = ExecuteAsync (MlaunchPath, new string [] { "--listsim", tmpfile }, SdkDevPath).Result;
+ var result = ExecuteAsync (MlaunchPath, new string [] { "--listsim", tmpfile }).Result;
if (result.ExitCode != 0)
return string.Empty;
simulator_list = File.ReadAllText (tmpfile);
@@ -130,7 +129,7 @@ public IPhoneDeviceType DeviceType {
var tmpfile = Path.GetTempFileName ();
try {
var output = new StringBuilder ();
- var result = ExecuteAsync (MlaunchPath, new string [] { $"--listdev:{tmpfile}", "--output-format:xml", "--use-amdevice:false" }, SdkDevPath).Result;
+ var result = ExecuteAsync (MlaunchPath, new string [] { $"--listdev:{tmpfile}", "--output-format:xml", "--use-amdevice:false" }).Result;
if (result.ExitCode != 0)
return string.Empty;
device_list = File.ReadAllText (tmpfile);
@@ -153,28 +152,13 @@ public IPhoneDeviceType DeviceType {
if (deviceTypes is null)
return rv;
- // Which product family are we looking for?
- string productFamily;
- switch (DeviceType) {
- case IPhoneDeviceType.IPhone:
- case IPhoneDeviceType.IPad:
- case IPhoneDeviceType.TV:
- productFamily = DeviceType.ToString ();
- break;
- case IPhoneDeviceType.IPhoneAndIPad:
- productFamily = "IPad";
- break;
- default:
- throw new InvalidOperationException ($"Invalid device type: {DeviceType}");
- }
-
// Load mlaunch's output
var xml = new XmlDocument ();
xml.LoadXml (output);
// Get the device types for the product family we're looking for
- var nodes = xml.SelectNodes ($"/MTouch/Simulator/AvailableDevices/SimDevice").Cast ();
+ var nodes = xml.SelectNodes ($"/MTouch/Simulator/AvailableDevices/SimDevice")?.Cast () ?? Array.Empty ();
foreach (var node in nodes) {
- var simDeviceType = node.SelectSingleNode ("SimDeviceType").InnerText;
+ var simDeviceType = node.SelectSingleNode ("SimDeviceType")?.InnerText ?? string.Empty;
if (!deviceTypes.Contains (simDeviceType))
continue;
var udid = node.Attributes? ["UDID"]?.Value ?? string.Empty;
@@ -226,10 +210,10 @@ public IPhoneDeviceType DeviceType {
var xml = new XmlDocument ();
xml.LoadXml (output);
// Get the device types for the device classes we're looking for
- var nodes = xml.SelectNodes ($"/MTouch/Device{deviceClassCondition}").Cast ();
+ var nodes = xml.SelectNodes ($"/MTouch/Device{deviceClassCondition}")?.Cast () ?? Array.Empty ();
foreach (var node in nodes) {
- var deviceIdentifier = node.SelectSingleNode ("DeviceIdentifier").InnerText;
- var name = node.SelectSingleNode ("Name").InnerText;
+ var deviceIdentifier = node.SelectSingleNode ("DeviceIdentifier")?.InnerText ?? string.Empty;
+ var name = node.SelectSingleNode ("Name")?.InnerText ?? string.Empty;
var productVersionString = node.SelectSingleNode ("ProductVersion")?.InnerText;
string? notApplicableBecause = null;
@@ -343,7 +327,7 @@ static string GetTerminalName (int fd)
if (isatty (fd) != 1)
return string.Empty;
- return Marshal.PtrToStringAuto (ttyname (fd));
+ return Marshal.PtrToStringAuto (ttyname (fd)) ?? string.Empty;
}
void ShowHelp ()
diff --git a/msbuild/Xamarin.MacDev.Tasks/Tasks/GetPropertyListValue.cs b/msbuild/Xamarin.MacDev.Tasks/Tasks/GetPropertyListValue.cs
index 2710251abd02..95294ffee6c8 100644
--- a/msbuild/Xamarin.MacDev.Tasks/Tasks/GetPropertyListValue.cs
+++ b/msbuild/Xamarin.MacDev.Tasks/Tasks/GetPropertyListValue.cs
@@ -86,7 +86,11 @@ public override bool Execute ()
return false;
}
- Value = value is IPValueObject pvalue ? pvalue.Value.ToString () : value.ToString ();
+ if (value is IPValueObject pvalue) {
+ Value = pvalue.Value.ToString () ?? string.Empty;
+ } else {
+ Value = value.ToString () ?? string.Empty;
+ }
return !Log.HasLoggedErrors;
}
diff --git a/msbuild/Xamarin.MacDev.Tasks/Tasks/IBTool.cs b/msbuild/Xamarin.MacDev.Tasks/Tasks/IBTool.cs
index 5ae4938b055e..f71e3ab3a680 100644
--- a/msbuild/Xamarin.MacDev.Tasks/Tasks/IBTool.cs
+++ b/msbuild/Xamarin.MacDev.Tasks/Tasks/IBTool.cs
@@ -117,9 +117,7 @@ IEnumerable GetCompilationDirectoryOutput (string baseOutputDir, IDic
continue;
}
- IDictionary metadata;
-
- if (!mapping.TryGetValue (path, out metadata))
+ if (!mapping.TryGetValue (path, out var metadata))
continue;
var compiled = new TaskItem (path, metadata);
@@ -127,7 +125,7 @@ IEnumerable GetCompilationDirectoryOutput (string baseOutputDir, IDic
// adjust the LogicalName since the LogicalName metadata is based on the generic output name
// (e.g. it does not include things like ~ipad or ~iphone)
var logicalName = compiled.GetMetadata ("LogicalName");
- var logicalDir = Path.GetDirectoryName (logicalName);
+ var logicalDir = Path.GetDirectoryName (logicalName)!;
var fileName = Path.GetFileName (path);
compiled.SetMetadata ("LogicalName", Path.Combine (logicalDir, fileName));
@@ -188,8 +186,7 @@ bool CompileInterfaceDefinitions (IEnumerable interfaceDefinitions, s
foreach (var item in interfaceDefinitions) {
var bundleName = item.GetMetadata ("LogicalName");
var manifest = new TaskItem (Path.Combine (baseManifestDir, bundleName));
- var manifestDir = Path.GetDirectoryName (manifest.ItemSpec);
- ITaskItem duplicate;
+ var manifestDir = Path.GetDirectoryName (manifest.ItemSpec)!;
string output;
if (!File.Exists (item.ItemSpec)) {
@@ -197,7 +194,7 @@ bool CompileInterfaceDefinitions (IEnumerable interfaceDefinitions, s
continue;
}
- if (unique.TryGetValue (bundleName, out duplicate)) {
+ if (unique.TryGetValue (bundleName, out var duplicate)) {
Log.LogError (null, null, null, item.ItemSpec, 0, 0, 0, 0, MSBStrings.E0159, item.ItemSpec, duplicate.ItemSpec);
continue;
}
@@ -206,7 +203,7 @@ bool CompileInterfaceDefinitions (IEnumerable interfaceDefinitions, s
var resourceTags = item.GetMetadata ("ResourceTags");
var path = Path.Combine (baseOutputDir, bundleName);
- var outputDir = Path.GetDirectoryName (path);
+ var outputDir = Path.GetDirectoryName (path)!;
var name = GetPathWithoutExtension (path);
var extension = Path.GetExtension (path);
var expected = new TaskItem (path);
@@ -218,7 +215,7 @@ bool CompileInterfaceDefinitions (IEnumerable interfaceDefinitions, s
if (EnableOnDemandResources && !string.IsNullOrEmpty (resourceTags))
expected.SetMetadata ("ResourceTags", resourceTags);
- output = Path.GetDirectoryName (path);
+ output = Path.GetDirectoryName (path)!;
if (InterfaceDefinitionChanged (item, manifest)) {
Directory.CreateDirectory (manifestDir);
diff --git a/msbuild/Xamarin.MacDev.Tasks/Tasks/ILStrip.cs b/msbuild/Xamarin.MacDev.Tasks/Tasks/ILStrip.cs
index d40f12632b25..eec478573062 100644
--- a/msbuild/Xamarin.MacDev.Tasks/Tasks/ILStrip.cs
+++ b/msbuild/Xamarin.MacDev.Tasks/Tasks/ILStrip.cs
@@ -26,7 +26,7 @@ public override bool Execute ()
foreach (var item in Assemblies) {
var outputPath = item.GetMetadata ("OutputPath");
- Directory.CreateDirectory (Path.GetDirectoryName (outputPath));
+ Directory.CreateDirectory (Path.GetDirectoryName (outputPath)!);
}
var result = base.Execute ();
diff --git a/msbuild/Xamarin.MacDev.Tasks/Tasks/InstallNameTool.cs b/msbuild/Xamarin.MacDev.Tasks/Tasks/InstallNameTool.cs
index 8430835aefee..341c6dbe1b01 100644
--- a/msbuild/Xamarin.MacDev.Tasks/Tasks/InstallNameTool.cs
+++ b/msbuild/Xamarin.MacDev.Tasks/Tasks/InstallNameTool.cs
@@ -15,9 +15,6 @@ public class InstallNameTool : XamarinTask, ITaskCallback {
[Required]
public ITaskItem [] DynamicLibrary { get; set; } = [];
- [Required]
- public string SdkDevPath { get; set; } = "";
-
// This isn't consumed from the targets files, but it's needed for VSX to create corresponding
// files on Windows.
[Output]
@@ -40,7 +37,7 @@ public override bool Execute ()
var temporaryTarget = target + ".tmp";
// install_name_tool modifies the file in-place, so copy it first to a temporary file first.
- Directory.CreateDirectory (Path.GetDirectoryName (temporaryTarget));
+ Directory.CreateDirectory (Path.GetDirectoryName (temporaryTarget)!);
File.Copy (src, temporaryTarget, true);
var arguments = new List ();
@@ -50,7 +47,7 @@ public override bool Execute ()
arguments.Add (input.GetMetadata ("DynamicLibraryId"));
arguments.Add (temporaryTarget);
- processes [i] = ExecuteAsync ("xcrun", arguments, sdkDevPath: SdkDevPath).ContinueWith ((v) => {
+ processes [i] = ExecuteAsync ("xcrun", arguments).ContinueWith ((v) => {
if (v.IsFaulted)
throw v.Exception;
if (v.Status == TaskStatus.RanToCompletion) {
diff --git a/msbuild/Xamarin.MacDev.Tasks/Tasks/LinkNativeCode.cs b/msbuild/Xamarin.MacDev.Tasks/Tasks/LinkNativeCode.cs
index ad7f93d0114c..fb7a540cd330 100644
--- a/msbuild/Xamarin.MacDev.Tasks/Tasks/LinkNativeCode.cs
+++ b/msbuild/Xamarin.MacDev.Tasks/Tasks/LinkNativeCode.cs
@@ -21,9 +21,6 @@ public class LinkNativeCode : XamarinTask, ITaskCallback {
// A path to entitlements to be embedded into the executable
public string EntitlementsInExecutable { get; set; } = string.Empty;
- [Required]
- public string SdkDevPath { get; set; } = string.Empty;
-
[Required]
public bool SdkIsSimulator { get; set; }
@@ -57,7 +54,7 @@ public class LinkNativeCode : XamarinTask, ITaskCallback {
public override bool Execute ()
{
if (ShouldExecuteRemotely ()) {
- outputPath = PathUtils.ConvertToMacPath (Path.GetDirectoryName (OutputFile.ItemSpec));
+ outputPath = PathUtils.ConvertToMacPath (Path.GetDirectoryName (OutputFile.ItemSpec)!);
return ExecuteRemotely ();
}
@@ -94,14 +91,14 @@ bool ExecuteUnsafe ()
foreach (var framework in linkerArguments.Frameworks) {
var fullPath = Path.GetFullPath (framework);
arguments.Add ("-F");
- arguments.Add (Path.GetDirectoryName (fullPath));
+ arguments.Add (Path.GetDirectoryName (fullPath)!);
arguments.Add ("-framework");
arguments.Add (Path.GetFileNameWithoutExtension (fullPath));
}
foreach (var framework in linkerArguments.WeakFrameworks) {
var fullPath = Path.GetFullPath (framework);
arguments.Add ("-F");
- arguments.Add (Path.GetDirectoryName (fullPath));
+ arguments.Add (Path.GetDirectoryName (fullPath)!);
arguments.Add ("-weak_framework");
arguments.Add (Path.GetFileNameWithoutExtension (fullPath));
}
@@ -185,7 +182,7 @@ bool ExecuteUnsafe ()
if (framework.EndsWith (".framework", StringComparison.Ordinal)) {
// user framework, we need to pass -F to the linker so that the linker finds the user framework.
arguments.Add ("-F");
- arguments.Add (Path.GetDirectoryName (Path.GetFullPath (framework)));
+ arguments.Add (Path.GetDirectoryName (Path.GetFullPath (framework))!);
framework = Path.GetFileNameWithoutExtension (framework);
hasEmbeddedFrameworks = true;
}
@@ -213,7 +210,7 @@ bool ExecuteUnsafe ()
arguments.Add (flag.ItemSpec);
}
- var rv = ExecuteAsync ("xcrun", arguments, sdkDevPath: SdkDevPath, showErrorIfFailure: false).Result;
+ var rv = ExecuteAsync ("xcrun", arguments, showErrorIfFailure: false).Result;
if (rv.ExitCode != 0) {
var stderr = rv.Output.MergedOutput;
#if NET
@@ -284,7 +281,7 @@ string ConvertEntitlementsToDerEntitlements (string entitlements)
"-o", derEntitlements,
"--raw",
};
- ExecuteAsync ("xcrun", arguments, sdkDevPath: SdkDevPath).Wait ();
+ ExecuteAsync ("xcrun", arguments).Wait ();
return derEntitlements;
}
diff --git a/msbuild/Xamarin.MacDev.Tasks/Tasks/MacDevMessage.cs b/msbuild/Xamarin.MacDev.Tasks/Tasks/MacDevMessage.cs
index 69d98c904a63..54b25d5fd505 100644
--- a/msbuild/Xamarin.MacDev.Tasks/Tasks/MacDevMessage.cs
+++ b/msbuild/Xamarin.MacDev.Tasks/Tasks/MacDevMessage.cs
@@ -30,7 +30,7 @@ public class MacDevMessage : Task {
public override bool Execute ()
{
- var msg = MSBStrings.ResourceManager.GetString (ResourceName, MSBStrings.Culture);
+ var msg = MSBStrings.ResourceManager.GetString (ResourceName, MSBStrings.Culture) ?? $"Could not find the resource '{ResourceName}'.";
var args = FormatArguments.Select (v => v.ItemSpec).ToArray ();
var message = string.Format (msg, args);
if (Error) {
diff --git a/msbuild/Xamarin.MacDev.Tasks/Tasks/MergeAppBundles.cs b/msbuild/Xamarin.MacDev.Tasks/Tasks/MergeAppBundles.cs
index 5f8fcf89c516..dd9f8bf3ad13 100644
--- a/msbuild/Xamarin.MacDev.Tasks/Tasks/MergeAppBundles.cs
+++ b/msbuild/Xamarin.MacDev.Tasks/Tasks/MergeAppBundles.cs
@@ -46,9 +46,6 @@ public partial class MergeAppBundles : XamarinTask {
[Required]
public string OutputAppBundle { get; set; } = "";
- [Required]
- public string SdkDevPath { get; set; } = "";
-
#endregion
enum FileType {
@@ -112,7 +109,7 @@ public void FindDependentFiles ()
return false;
// if the name of the immediate subdirectory isn't a valid culture, then it's not a dependent assembly of ours
- var immediateSubDir = Path.GetFileName (Path.GetDirectoryName (v.RelativePath));
+ var immediateSubDir = Path.GetFileName (Path.GetDirectoryName (v.RelativePath)!);
var cultureInfo = CultureInfo.GetCultureInfo (immediateSubDir);
if (cultureInfo is null)
return false;
@@ -207,7 +204,7 @@ public void CopyTo (string outputDirectory, string? subDirectory = null)
if (Type == FileType.Directory) {
Directory.CreateDirectory (outputFile);
} else if (Type == FileType.Symlink) {
- Directory.CreateDirectory (Path.GetDirectoryName (outputFile));
+ Directory.CreateDirectory (Path.GetDirectoryName (outputFile)!);
var symlinkTarget = PathUtils.GetSymlinkTarget (FullPath);
if (File.Exists (outputFile) && PathUtils.IsSymlink (outputFile) && PathUtils.GetSymlinkTarget (outputFile) == symlinkTarget) {
File.SetLastWriteTimeUtc (outputFile, DateTime.UtcNow); // update the timestamp, because the file the symlink points to might have changed.
@@ -217,7 +214,7 @@ public void CopyTo (string outputDirectory, string? subDirectory = null)
PathUtils.Symlink (symlinkTarget, outputFile);
}
} else {
- Directory.CreateDirectory (Path.GetDirectoryName (outputFile));
+ Directory.CreateDirectory (Path.GetDirectoryName (outputFile)!);
if (!FileCopier.IsUptodate (FullPath, outputFile, Task.FileCopierReportErrorCallback, Task.FileCopierLogCallback))
File.Copy (FullPath, outputFile, true);
}
@@ -441,7 +438,7 @@ void MergeMachOFiles (string output, IList input)
arguments.Add ("-output");
arguments.Add (output);
arguments.AddRange (sourceFiles);
- ExecuteAsync ("lipo", arguments, sdkDevPath: SdkDevPath).Wait ();
+ ExecuteAsync ("lipo", arguments).Wait ();
}
FileType GetFileType (string path)
diff --git a/msbuild/Xamarin.MacDev.Tasks/Tasks/Metal.cs b/msbuild/Xamarin.MacDev.Tasks/Tasks/Metal.cs
index 8e5c4b298ebe..b9def4690661 100644
--- a/msbuild/Xamarin.MacDev.Tasks/Tasks/Metal.cs
+++ b/msbuild/Xamarin.MacDev.Tasks/Tasks/Metal.cs
@@ -32,9 +32,6 @@ public class Metal : XamarinTask, IHasProjectDir, IHasResourcePrefix {
[Required]
public string ResourcePrefix { get; set; } = string.Empty;
- [Required]
- public string SdkDevPath { get; set; } = string.Empty;
-
[Required]
public string SdkVersion { get; set; } = string.Empty;
@@ -65,7 +62,7 @@ public override bool Execute ()
var logicalName = BundleResource.GetLogicalName (this, SourceFile!);
var path = Path.Combine (intermediate, logicalName);
var args = new List ();
- var dir = Path.GetDirectoryName (path);
+ var dir = Path.GetDirectoryName (path)!;
Directory.CreateDirectory (dir);
@@ -96,7 +93,7 @@ public override bool Execute ()
args.Add (SourceFile!.ItemSpec);
cancellationTokenSource = new CancellationTokenSource ();
- ExecuteAsync (Log, executable, args, environment: env, cancellationToken: cancellationTokenSource.Token).Wait ();
+ ExecuteAsync (executable, args, environment: env, cancellationToken: cancellationTokenSource.Token).Wait ();
return !Log.HasLoggedErrors;
}
diff --git a/msbuild/Xamarin.MacDev.Tasks/Tasks/MetalLib.cs b/msbuild/Xamarin.MacDev.Tasks/Tasks/MetalLib.cs
index 804c846c14fe..ecdf6648cd42 100644
--- a/msbuild/Xamarin.MacDev.Tasks/Tasks/MetalLib.cs
+++ b/msbuild/Xamarin.MacDev.Tasks/Tasks/MetalLib.cs
@@ -25,9 +25,6 @@ public class MetalLib : XamarinTask, ITaskCallback {
[Required]
public string OutputLibrary { get; set; } = string.Empty;
- [Required]
- public string SdkDevPath { get; set; } = string.Empty;
-
[Required]
public string SdkRoot { get; set; } = string.Empty;
@@ -38,7 +35,7 @@ public override bool Execute ()
if (ShouldExecuteRemotely ())
return ExecuteRemotely ();
- var dir = Path.GetDirectoryName (OutputLibrary);
+ var dir = Path.GetDirectoryName (OutputLibrary)!;
Directory.CreateDirectory (dir);
var env = new Dictionary {
@@ -54,7 +51,7 @@ public override bool Execute ()
var executable = GetExecutable (args, "metallib", MetalLibPath);
cancellationTokenSource = new CancellationTokenSource ();
- ExecuteAsync (Log, executable, args, environment: env, cancellationToken: cancellationTokenSource.Token).Wait ();
+ ExecuteAsync (executable, args, environment: env, cancellationToken: cancellationTokenSource.Token).Wait ();
return !Log.HasLoggedErrors;
}
diff --git a/msbuild/Xamarin.MacDev.Tasks/Tasks/OptimizeImage.cs b/msbuild/Xamarin.MacDev.Tasks/Tasks/OptimizeImage.cs
index 6fef2efe045f..d6839c846fa3 100644
--- a/msbuild/Xamarin.MacDev.Tasks/Tasks/OptimizeImage.cs
+++ b/msbuild/Xamarin.MacDev.Tasks/Tasks/OptimizeImage.cs
@@ -29,9 +29,6 @@ public class OptimizeImage : XamarinParallelTask, ICancelableTask {
public string PngCrushPath { get; set; } = string.Empty;
- [Required]
- public string SdkDevPath { get; set; } = string.Empty;
-
#endregion
static List GenerateCommandLineCommands (string inputImage, string outputImage)
@@ -82,7 +79,7 @@ public override bool Execute ()
var inputImage = this.InputImages [index].ItemSpec;
var outputImage = this.OutputImages [index].ItemSpec;
- Directory.CreateDirectory (Path.GetDirectoryName (outputImage));
+ Directory.CreateDirectory (Path.GetDirectoryName (outputImage)!);
var args = GenerateCommandLineCommands (inputImage, outputImage);
listOfArguments.Add ((args, inputImage));
@@ -92,7 +89,7 @@ public override bool Execute ()
ForEach (listOfArguments, (arg) => {
var args = arg.Arguments;
var executable = GetExecutable (args, "pngcrush", PngCrushPath);
- ExecuteAsync (Log, executable, args, sdkDevPath: SdkDevPath, showErrorIfFailure: false /* we show our own error below */, cancellationToken: cancellationTokenSource.Token)
+ ExecuteAsync (executable, args, showErrorIfFailure: false /* we show our own error below */, cancellationToken: cancellationTokenSource.Token)
.ContinueWith ((v) => {
Execution execution = v.Result;
if (execution.ExitCode != 0)
diff --git a/msbuild/Xamarin.MacDev.Tasks/Tasks/OptimizePropertyList.cs b/msbuild/Xamarin.MacDev.Tasks/Tasks/OptimizePropertyList.cs
index a98b1f365849..5e61f5e0e2f0 100644
--- a/msbuild/Xamarin.MacDev.Tasks/Tasks/OptimizePropertyList.cs
+++ b/msbuild/Xamarin.MacDev.Tasks/Tasks/OptimizePropertyList.cs
@@ -46,11 +46,11 @@ public override bool Execute ()
if (ShouldExecuteRemotely ())
return ExecuteRemotely ();
- Directory.CreateDirectory (Path.GetDirectoryName (Output!.ItemSpec));
+ Directory.CreateDirectory (Path.GetDirectoryName (Output!.ItemSpec)!);
var args = GenerateCommandLineCommands ();
var executable = GetExecutable (args, "plutil", PlutilPath);
cancellationTokenSource = new CancellationTokenSource ();
- ExecuteAsync (Log, executable, args, cancellationToken: cancellationTokenSource.Token).Wait ();
+ ExecuteAsync (executable, args, cancellationToken: cancellationTokenSource.Token).Wait ();
return !Log.HasLoggedErrors;
}
diff --git a/msbuild/Xamarin.MacDev.Tasks/Tasks/PrepareNativeReferences.cs b/msbuild/Xamarin.MacDev.Tasks/Tasks/PrepareNativeReferences.cs
index b6f29028ea84..51468eedf399 100644
--- a/msbuild/Xamarin.MacDev.Tasks/Tasks/PrepareNativeReferences.cs
+++ b/msbuild/Xamarin.MacDev.Tasks/Tasks/PrepareNativeReferences.cs
@@ -92,12 +92,13 @@ void AppendStringProperty (StringBuilder builder, ITaskItem item, string propert
new bool ExecuteRemotely ()
{
- var success = base.ExecuteRemotely (out var taskRunner);
-
- if (success && LinkWithAttributes is not null)
- taskRunner.GetFileAsync (this, LinkWithAttributes.ItemSpec).Wait ();
+ if (base.ExecuteRemotely (out var taskRunner)) {
+ if (LinkWithAttributes is not null)
+ taskRunner.GetFileAsync (this, LinkWithAttributes.ItemSpec).Wait ();
+ return true;
+ }
- return success;
+ return false;
}
public override bool Execute ()
@@ -159,7 +160,7 @@ public override bool Execute ()
skipLinkWithGeneration = String.Equals (existingLinkWithText, linkWithText, StringComparison.Ordinal);
}
if (!skipLinkWithGeneration) {
- Directory.CreateDirectory (Path.GetDirectoryName (linkWithPath));
+ Directory.CreateDirectory (Path.GetDirectoryName (linkWithPath)!);
File.WriteAllText (linkWithPath, linkWithText);
}
diff --git a/msbuild/Xamarin.MacDev.Tasks/Tasks/ReadItemsFromFile.cs b/msbuild/Xamarin.MacDev.Tasks/Tasks/ReadItemsFromFile.cs
index 743baa151cc6..e2fbad4cfaa2 100644
--- a/msbuild/Xamarin.MacDev.Tasks/Tasks/ReadItemsFromFile.cs
+++ b/msbuild/Xamarin.MacDev.Tasks/Tasks/ReadItemsFromFile.cs
@@ -45,11 +45,12 @@ public override bool Execute ()
var document = XDocument.Load (stream);
var items = document.Root
- .Elements (ItemGroupElementName)
- .SelectMany (element => element.Elements ())
- .Select (element => this.CreateItemFromElement (element, file.ItemSpec))
- .ToList ();
- result.AddRange (items);
+ ?.Elements (ItemGroupElementName)
+ ?.SelectMany (element => element.Elements ())
+ ?.Select (element => this.CreateItemFromElement (element, file.ItemSpec))
+ ?.ToList ();
+ if (items is not null)
+ result.AddRange (items);
}
if (Items is not null)
@@ -62,7 +63,7 @@ public override bool Execute ()
ITaskItem CreateItemFromElement (XElement element, string sourceFile)
{
- var item = new TaskItem (element.Attribute (IncludeAttributeName).Value);
+ var item = new TaskItem (element.Attribute (IncludeAttributeName)!.Value);
foreach (var metadata in element.Elements ()) {
item.SetMetadata (metadata.Name.LocalName, metadata.Value);
diff --git a/msbuild/Xamarin.MacDev.Tasks/Tasks/ResolveNativeReferences.cs b/msbuild/Xamarin.MacDev.Tasks/Tasks/ResolveNativeReferences.cs
index a40e837b802b..73c8dcc7dee5 100644
--- a/msbuild/Xamarin.MacDev.Tasks/Tasks/ResolveNativeReferences.cs
+++ b/msbuild/Xamarin.MacDev.Tasks/Tasks/ResolveNativeReferences.cs
@@ -153,9 +153,9 @@ void ProcessNativeReference (ITaskItem item, string name, List native
{
// '.' can be used to represent a file (instead of the directory)
if (Path.GetFileName (name) == ".")
- name = Path.GetDirectoryName (name);
+ name = Path.GetDirectoryName (name)!;
- var parentDirectory = Path.GetDirectoryName (name);
+ var parentDirectory = Path.GetDirectoryName (name)!;
// framework
if (name.EndsWith (".framework", StringComparison.OrdinalIgnoreCase)) {
@@ -163,7 +163,7 @@ void ProcessNativeReference (ITaskItem item, string name, List native
nr.ItemSpec = GetActualLibrary (name);
nr.SetMetadata ("Kind", "Framework");
nr.SetMetadata ("PublishFolderType", "AppleFramework");
- nr.SetMetadata ("RelativePath", Path.Combine (FrameworksDirectory, Path.GetFileName (Path.GetDirectoryName (nr.ItemSpec))));
+ nr.SetMetadata ("RelativePath", Path.Combine (FrameworksDirectory, Path.GetFileName (Path.GetDirectoryName (nr.ItemSpec))!));
native_frameworks.Add (nr);
return;
} else if (parentDirectory.EndsWith (".framework", StringComparison.OrdinalIgnoreCase) && Path.GetFileName (name) == Path.GetFileNameWithoutExtension (parentDirectory)) {
@@ -171,7 +171,7 @@ void ProcessNativeReference (ITaskItem item, string name, List native
nr.ItemSpec = GetActualLibrary (name);
nr.SetMetadata ("Kind", "Framework");
nr.SetMetadata ("PublishFolderType", "AppleFramework");
- nr.SetMetadata ("RelativePath", Path.Combine (FrameworksDirectory, Path.GetFileName (Path.GetDirectoryName (nr.ItemSpec))));
+ nr.SetMetadata ("RelativePath", Path.Combine (FrameworksDirectory, Path.GetFileName (Path.GetDirectoryName (nr.ItemSpec))!));
native_frameworks.Add (nr);
return;
}
@@ -214,7 +214,7 @@ void ProcessNativeReference (ITaskItem item, string name, List native
nr.ItemSpec = GetActualLibrary (frameworkPath);
nr.SetMetadata ("Kind", "Framework");
nr.SetMetadata ("PublishFolderType", "AppleFramework");
- nr.SetMetadata ("RelativePath", Path.Combine (FrameworksDirectory, Path.GetFileName (Path.GetDirectoryName (nr.ItemSpec))));
+ nr.SetMetadata ("RelativePath", Path.Combine (FrameworksDirectory, Path.GetFileName (Path.GetDirectoryName (nr.ItemSpec)!)));
native_frameworks.Add (nr);
return;
}
@@ -296,7 +296,7 @@ void SetMetadataNativeLibrary (ITaskItem item, string nativeLibraryPath)
item.SetMetadata ("Kind", "Framework");
item.SetMetadata ("PublishFolderType", "AppleFramework");
}
- item.SetMetadata ("RelativePath", Path.Combine (FrameworksDirectory, Path.GetFileName (Path.GetDirectoryName (item.ItemSpec))));
+ item.SetMetadata ("RelativePath", Path.Combine (FrameworksDirectory, Path.GetFileName (Path.GetDirectoryName (item.ItemSpec)!)));
}
void ProcessSidecar (ITaskItem r, string resources, List native_frameworks, List createdFiles, CancellationToken? cancellationToken)
@@ -305,11 +305,11 @@ void ProcessSidecar (ITaskItem r, string resources, List native_frame
return;
var isCompressed = CompressionHelper.IsCompressed (resources);
- XmlDocument document = new XmlDocument ();
+ var document = new XmlDocument ();
document.LoadXmlWithoutNetworkAccess (manifestContents);
foreach (XmlNode referenceNode in document.GetElementsByTagName ("NativeReference")) {
ITaskItem t = new TaskItem (r);
- var name = referenceNode.Attributes ["Name"].Value.Trim ('\\', '/');
+ var name = referenceNode.Attributes? ["Name"]?.Value.Trim ('\\', '/') ?? string.Empty;
if (name.EndsWith (".xcframework", StringComparison.Ordinal) || name.EndsWith (".xcframework.zip", StringComparison.Ordinal)) {
if (!TryResolveXCFramework (this, TargetFrameworkMoniker, SdkIsSimulator, Architectures, resources, name, GetIntermediateDecompressionDir (resources), createdFiles, cancellationToken, out var nativeLibraryPath))
continue;
@@ -324,7 +324,7 @@ void ProcessSidecar (ITaskItem r, string resources, List native_frame
t.ItemSpec = GetActualLibrary (frameworkPath);
t.SetMetadata ("Kind", "Framework");
t.SetMetadata ("PublishFolderType", "AppleFramework");
- t.SetMetadata ("RelativePath", Path.Combine (FrameworksDirectory, Path.GetFileName (Path.GetDirectoryName (t.ItemSpec))));
+ t.SetMetadata ("RelativePath", Path.Combine (FrameworksDirectory, Path.GetFileName (Path.GetDirectoryName (t.ItemSpec)!)));
} else if (name.EndsWith (".dylib", StringComparison.Ordinal)) {
// macOS
string? dylibPath;
@@ -387,7 +387,7 @@ public static bool TryResolveXCFramework (XamarinTask task, string targetFramewo
resourcePath = path;
xcframework = Path.GetFileNameWithoutExtension (path); // Remove the .zip extension
} else {
- resourcePath = Path.GetDirectoryName (path);
+ resourcePath = Path.GetDirectoryName (path)!;
xcframework = Path.GetFileName (path);
}
return TryResolveXCFramework (task, targetFrameworkMoniker, isSimulator, architectures, resourcePath, xcframework, intermediateDecompressionDir, createdFiles, cancellationToken, out nativeLibraryPath);
@@ -434,7 +434,7 @@ public static bool TryResolveXCFramework (XamarinTask task, string targetFramewo
return true;
}
- var zipResource = Path.Combine (xcframework, Path.GetDirectoryName (nativeLibraryRelativePath));
+ var zipResource = Path.Combine (xcframework, Path.GetDirectoryName (nativeLibraryRelativePath)!);
if (!CompressionHelper.TryDecompress (task, resourcePath, zipResource, intermediateDecompressionDir, createdFiles, cancellationToken, out var decompressedPath))
return false;
@@ -561,7 +561,7 @@ public IEnumerable GetAdditionalItemsToBeCopied ()
var rv = new List ();
rv.AddRange (CreateItemsForAllFilesRecursively (NativeReferences));
foreach (var reference in References) {
- var resourcesPackage = Path.Combine (Path.GetDirectoryName (reference.ItemSpec), Path.GetFileNameWithoutExtension (reference.ItemSpec)) + ".resources";
+ var resourcesPackage = Path.Combine (Path.GetDirectoryName (reference.ItemSpec)!, Path.GetFileNameWithoutExtension (reference.ItemSpec)) + ".resources";
if (Directory.Exists (resourcesPackage)) {
var resources = CreateItemsForAllFilesRecursively (new string [] { resourcesPackage });
rv.AddRange (resources);
diff --git a/msbuild/Xamarin.MacDev.Tasks/Tasks/ResolveUniversalTypeIdentifiers.cs b/msbuild/Xamarin.MacDev.Tasks/Tasks/ResolveUniversalTypeIdentifiers.cs
index 31afa9916b51..2d51788f4545 100644
--- a/msbuild/Xamarin.MacDev.Tasks/Tasks/ResolveUniversalTypeIdentifiers.cs
+++ b/msbuild/Xamarin.MacDev.Tasks/Tasks/ResolveUniversalTypeIdentifiers.cs
@@ -37,7 +37,7 @@ public override bool Execute ()
var contentFiles = ImageAssets
.Where (asset => Path.GetFileName (asset.ItemSpec) == "Contents.json" &&
- Path.GetDirectoryName (asset.ItemSpec).EndsWith (".dataset"))
+ Path.GetDirectoryName (asset.ItemSpec)!.EndsWith (".dataset"))
.Select (x => x.ItemSpec);
foreach (var filePath in contentFiles) {
@@ -55,9 +55,10 @@ public override bool Execute ()
}
var dataItemsToComplete = dataset
- .DataItems
- .Where (item => string.IsNullOrEmpty (item.UniversalTypeIdentifier) &&
- !string.IsNullOrEmpty (item.Filename)).ToList ();
+ ?.DataItems
+ ?.Where (item => string.IsNullOrEmpty (item.UniversalTypeIdentifier) &&
+ !string.IsNullOrEmpty (item.Filename)).ToList ()
+ ?? [];
foreach (var data in dataItemsToComplete) {
var file = ImageAssets.FirstOrDefault (x => Path.GetFileName (x.ItemSpec) == data.Filename);
diff --git a/msbuild/Xamarin.MacDev.Tasks/Tasks/ScnTool.cs b/msbuild/Xamarin.MacDev.Tasks/Tasks/ScnTool.cs
index 5f8e9617c1a8..199aae1f61bf 100644
--- a/msbuild/Xamarin.MacDev.Tasks/Tasks/ScnTool.cs
+++ b/msbuild/Xamarin.MacDev.Tasks/Tasks/ScnTool.cs
@@ -39,9 +39,6 @@ public class ScnTool : XamarinParallelTask, IHasProjectDir, IHasResourcePrefix {
[Required]
public string SdkVersion { get; set; } = string.Empty;
- [Required]
- public string SdkDevPath { get; set; } = string.Empty;
-
#endregion
#region Outputs
@@ -81,7 +78,7 @@ public override bool Execute ()
var args = GenerateCommandLineCommands (inputScene, outputScene);
listOfArguments.Add (new (args, asset));
- Directory.CreateDirectory (Path.GetDirectoryName (outputScene));
+ Directory.CreateDirectory (Path.GetDirectoryName (outputScene)!);
var bundleResource = new TaskItem (outputScene);
asset.CopyMetadataTo (bundleResource);
@@ -91,7 +88,7 @@ public override bool Execute ()
}
ForEach (listOfArguments, (arg) => {
- ExecuteAsync ("xcrun", arg.Arguments, sdkDevPath: SdkDevPath).Wait ();
+ ExecuteAsync ("xcrun", arg.Arguments).Wait ();
});
BundleResources = bundleResources.ToArray ();
diff --git a/msbuild/Xamarin.MacDev.Tasks/Tasks/SmartCopy.cs b/msbuild/Xamarin.MacDev.Tasks/Tasks/SmartCopy.cs
index b2b65f4b14e2..d7a2738e80ff 100644
--- a/msbuild/Xamarin.MacDev.Tasks/Tasks/SmartCopy.cs
+++ b/msbuild/Xamarin.MacDev.Tasks/Tasks/SmartCopy.cs
@@ -59,7 +59,7 @@ void EnsureDirectoryExists (string path)
void CopyFile (string source, string target, string targetItemSpec)
{
- var dirName = Path.GetDirectoryName (target);
+ var dirName = Path.GetDirectoryName (target)!;
EnsureDirectoryExists (dirName);
@@ -99,7 +99,7 @@ public override bool Execute ()
for (int i = 0; i < SourceFiles.Length; i++) {
var target = DestinationFiles [i].GetMetadata ("FullPath");
var source = SourceFiles [i].GetMetadata ("FullPath");
- var targetDir = Path.GetDirectoryName (target);
+ var targetDir = Path.GetDirectoryName (target)!;
EnsureDirectoryExists (targetDir);
@@ -170,10 +170,10 @@ struct Stat {
public uint st_uid;
public uint st_gid;
public uint st_rdev;
- public timespec st_atimespec;
- public timespec st_mtimespec;
- public timespec st_ctimespec;
- public timespec st_birthtimespec;
+ public Timespec st_atimespec;
+ public Timespec st_mtimespec;
+ public Timespec st_ctimespec;
+ public Timespec st_birthtimespec;
public ulong st_size;
public ulong st_blocks;
public uint st_blksize;
@@ -184,7 +184,7 @@ struct Stat {
public ulong st_qspare_2;
}
- struct timespec {
+ struct Timespec {
public IntPtr tv_sec;
public IntPtr tv_nsec;
}
diff --git a/msbuild/Xamarin.MacDev.Tasks/Tasks/SpotlightIndexer.cs b/msbuild/Xamarin.MacDev.Tasks/Tasks/SpotlightIndexer.cs
index eff7361b6429..7d35f420e79d 100644
--- a/msbuild/Xamarin.MacDev.Tasks/Tasks/SpotlightIndexer.cs
+++ b/msbuild/Xamarin.MacDev.Tasks/Tasks/SpotlightIndexer.cs
@@ -33,7 +33,7 @@ public override bool Execute ()
};
var executable = GetExecutable (args, "mdimport", MdimportPath);
cancellationTokenSource = new CancellationTokenSource ();
- ExecuteAsync (Log, executable, args, cancellationToken: cancellationTokenSource.Token).Wait ();
+ ExecuteAsync (executable, args, cancellationToken: cancellationTokenSource.Token).Wait ();
return !Log.HasLoggedErrors;
}
diff --git a/msbuild/Xamarin.MacDev.Tasks/Tasks/TaskItemFixer.cs b/msbuild/Xamarin.MacDev.Tasks/Tasks/TaskItemFixer.cs
index 1fd422b25065..2eb9ba3c07d3 100644
--- a/msbuild/Xamarin.MacDev.Tasks/Tasks/TaskItemFixer.cs
+++ b/msbuild/Xamarin.MacDev.Tasks/Tasks/TaskItemFixer.cs
@@ -12,7 +12,7 @@ public static void FixItemSpecs (TaskLoggingHelper log, Func
var targetPath = Path.Combine (itemPathFactory (item), Path.GetFileName (item.ItemSpec));
if (!Directory.Exists (Path.GetDirectoryName (targetPath)))
- Directory.CreateDirectory (Path.GetDirectoryName (targetPath));
+ Directory.CreateDirectory (Path.GetDirectoryName (targetPath)!);
// HACK: If the target path is a network directory, GetLastWriteTimeUtc returns some a difference of some milliseconds
// for the same file. So we just use Year/Month/Day/Hour/Minute/Second to decide if we should copy the item to the target location.
diff --git a/msbuild/Xamarin.MacDev.Tasks/Tasks/TextureAtlas.cs b/msbuild/Xamarin.MacDev.Tasks/Tasks/TextureAtlas.cs
index 5316bf815b4d..b2240c760e42 100644
--- a/msbuild/Xamarin.MacDev.Tasks/Tasks/TextureAtlas.cs
+++ b/msbuild/Xamarin.MacDev.Tasks/Tasks/TextureAtlas.cs
@@ -31,7 +31,7 @@ protected override string ToolName {
protected override void AppendCommandLineArguments (IDictionary environment, List args, ITaskItem input, ITaskItem output)
{
args.Add (input.GetMetadata ("FullPath"));
- args.Add (Path.GetDirectoryName (output.GetMetadata ("FullPath")));
+ args.Add (Path.GetDirectoryName (output.GetMetadata ("FullPath"))!);
}
protected override string GetBundleRelativeOutputPath (ITaskItem input)
@@ -92,7 +92,7 @@ protected override IEnumerable EnumerateInputs ()
// group the atlas textures by their parent .atlas directories
foreach (var item in atlasTextures) {
var logicalName = item.GetMetadata ("LogicalName");
- var atlasName = Path.GetDirectoryName (logicalName);
+ var atlasName = Path.GetDirectoryName (logicalName)!;
if (!atlases.TryGetValue (atlasName, out var atlas)) {
var atlasItem = new TaskItem (atlasName);
diff --git a/msbuild/Xamarin.MacDev.Tasks/Tasks/UnpackLibraryResources.cs b/msbuild/Xamarin.MacDev.Tasks/Tasks/UnpackLibraryResources.cs
index d0081325f780..564ef4c6807d 100644
--- a/msbuild/Xamarin.MacDev.Tasks/Tasks/UnpackLibraryResources.cs
+++ b/msbuild/Xamarin.MacDev.Tasks/Tasks/UnpackLibraryResources.cs
@@ -198,7 +198,7 @@ public void WriteResourceTo (AssemblyResource resource, string path)
if (peReader is null)
throw new ObjectDisposedException ("this");
- Directory.CreateDirectory (Path.GetDirectoryName (path));
+ Directory.CreateDirectory (Path.GetDirectoryName (path)!);
var manifestResource = resource.ManifestResource;
var resourceDirectory = peReader.GetSectionData (peReader.PEHeaders.CorHeader!.ResourcesDirectory.RelativeVirtualAddress);
diff --git a/msbuild/Xamarin.MacDev.Tasks/Tasks/Unzip.cs b/msbuild/Xamarin.MacDev.Tasks/Tasks/Unzip.cs
index 5a4c4afaf1d5..ef0fa1e51056 100644
--- a/msbuild/Xamarin.MacDev.Tasks/Tasks/Unzip.cs
+++ b/msbuild/Xamarin.MacDev.Tasks/Tasks/Unzip.cs
@@ -44,12 +44,13 @@ public class Unzip : XamarinTask, ITaskCallback {
public override bool Execute ()
{
if (ShouldExecuteRemotely ()) {
- var rv = ExecuteRemotely (out var taskRunner);
+ if (ExecuteRemotely (out var taskRunner)) {
+ if (CopyToWindows)
+ CopyFilesToWindowsAsync (taskRunner, TouchedFiles).Wait ();
+ return true;
+ }
- if (rv && CopyToWindows)
- CopyFilesToWindowsAsync (taskRunner, TouchedFiles).Wait ();
-
- return rv;
+ return false;
}
return ExecuteLocally ();
diff --git a/msbuild/Xamarin.MacDev.Tasks/Tasks/WriteAppManifest.cs b/msbuild/Xamarin.MacDev.Tasks/Tasks/WriteAppManifest.cs
index 0a63679e95f4..6e56f518a1a4 100644
--- a/msbuild/Xamarin.MacDev.Tasks/Tasks/WriteAppManifest.cs
+++ b/msbuild/Xamarin.MacDev.Tasks/Tasks/WriteAppManifest.cs
@@ -47,7 +47,7 @@ public override bool Execute ()
// write the resulting app manifest
var appBundleManifestPath = AppBundleManifest!.ItemSpec;
- Directory.CreateDirectory (Path.GetDirectoryName (appBundleManifestPath));
+ Directory.CreateDirectory (Path.GetDirectoryName (appBundleManifestPath)!);
plist.Save (appBundleManifestPath, true, true);
return !Log.HasLoggedErrors;
diff --git a/msbuild/Xamarin.MacDev.Tasks/Tasks/WriteItemsToFile.cs b/msbuild/Xamarin.MacDev.Tasks/Tasks/WriteItemsToFile.cs
index e2988f41b671..196a4a292e2b 100644
--- a/msbuild/Xamarin.MacDev.Tasks/Tasks/WriteItemsToFile.cs
+++ b/msbuild/Xamarin.MacDev.Tasks/Tasks/WriteItemsToFile.cs
@@ -54,7 +54,7 @@ public static void Write (Task task, string? file, IEnumerable items,
System.IO.File.Delete (file);
if (!Directory.Exists (Path.GetDirectoryName (file)))
- Directory.CreateDirectory (Path.GetDirectoryName (file));
+ Directory.CreateDirectory (Path.GetDirectoryName (file)!);
document.Save (file);
}
@@ -73,7 +73,7 @@ static IEnumerable CreateMetadataFromItem (ITaskItem item, bool includ
return metadata.Keys
.OfType