[dotnet] Initial support for .NET6 from Windows (#10590)

These changes add support for executing iOS and MacDev tasks remotely (on a Mac) when running a build from Windows, and creates a specific .NET6 pack for Windows that's only included in the MSI.

For now this only enables builds for the iOS Simulator, physical devices are not yet supported.

- Each task decides if it should run locally or remotely depending on the SessionId property, which will only have a value on Windows.
- The XMA Build agent is now part of this repo and will be included in the iOS .NET6 Windows pack.
- On this first version we're including some Windows specific tasks and references into the Xamarin.iOS.Tasks project for simplicity, but those will be moved to the Windows specific project.

------------

* [msbuild] Adds support for executing Xamarin.iOS tasks from Windows

* [msbuild] Adds support for executing Xamarin.MacDev tasks from Windows

* Added XMA Build Agent to Xamarin.MacDev.Tasks.sln

* Fixes some MSBuild versioning problems

* Makes the XMA Build agent load Xamarin.iOS tasks

We need to load a type from the iOS tasks assembly so we can run the tasks requested by MSBuild from Windows. We only need to load Xamarin.iOS.Tasks.dll since MacDev.tasks is already embedded in that one.

There's a little trick on the csproj, we can't directly use the Xamarin.iOS.Tasks project ref assemblies because that includes both Xamarin.iOS.Tasks.dll and Xamarin.MacDev.Tasks.dll, so the MacDev tasks will collide. We use the project ref only for build dependency purposes but we add an assembly reference to Xamarin.iOS.Tasks.dll.

* Added Xamarin.iOS.Tasks.Windows project

* Removed unnecessary references on Xamarin.iOS.Tasks.Windows.csproj

* Adds Messaging assemblies when ILRepacking Xamarin Tasks

The Xamarin Task assemblies now depend on Messaging, so we need the Messaging assemblies to be packed into Xamarin.Mac.Tasks and Xamarin.iOS.Tasks. Also had to remove the direct Messaging dependencies from the build agent since those are already contained in Xamarin.iOS.Tasks

* Adds a reference to Messaging.Core targets to the Agent's project

* [msbuild] Adds Xamarin iOS Windows targets

* [msbuild] Adds missing dependencies to Xamarin.iOS.Tasks

This should fix build errors because of missing dependencies. Had to move System.Net.Mqtt.Server from the Build agent project to the tasks one to avoid conflicts with System.Diagnostics.Tracer.

* [dotnet] Creates iOS Windows pack

Creates a new pack for Windows specific (targets, build agent, etc.) files that shouldn't be installed on the Mac. We have a separate package for this to avoid increasing the core pack size with things that are not needed when using it from macOS.

* Fixes type in dotnet makefile

* [dotnet] Fixes the iOS Windows pack generation

- The windows pack should not include the Sdk and Targets folders
- For now we'll just create an iOS pack
- Fixes the path to the files to include on the Windows Sdk pack

* Added reference to the Windows iOS SDK from the Xamarin.iOS.Common.targets

Added a property to navigate to the Windows iOS SDK folder, based on a naming convention that assumes that both packs will always have the same version

* Added reference to the core iOS SDK from the Windows iOS SDK

Added a property to navigate to the core iOS SDK folder, based on a naming convention that assumes that both packs will always have the same version

* Updated Messaging version

* Override MessagingBuildClientAssemblyFile property and correctly imported props from targets

* [dotnet] Make Windows pack using target files from the output dir

We need to take the target files from the output dir to include targets that are part of nuget packages, otherwise we will only include targets from our source

* [dotnet] Adds the Windows Sdk pack to the workload manifest

* [msbuild] Fixes the Windows Sdk pack name

* [dotnet] Merge Mqtt instead of Mqtt.Server

We only need System.Net.Mqtt to be merged into Xamarin.iOS.Tasks

* Updated Messaging version

* [dotnet] Several fixes for the Windows Sdk

- Adds missing task CollectMonotouchReferences
- Merges more dependencies into Xamarin.iOS.Tasks.dll needed by XMA
- Updates the msbuild/Makefile to include files from both the output dir and the source dir
- Overrides the agents directory to look for them on the Windows pack

* [dotnet] Fixes the XMA Build agent

- The build agent is an app so it cannot target ns2.0
- The MSBuild dependencies should be copied into the agent zip file
- Avoids copying all the Xamarin iOS SDK core targets into the build agent, since those are not needed
- Ensures the broker zip file is copied into the Xamarin.iOS.Windows.Tasks output dir so its included in the Windows pack

* Bumps Xamarin.Messaging to 1.2.102

* Adds net6-win branch to trigger builds

* Adds Messaging.Client missing dependency to Xamarin.Mac.Tasks

* Added Xamarin.Messaging.Apple.Tasks project and VerifyXcodeVersion Task

* Fix unloaded Xamarin.Messaging.Build project

* Added Build contracts project and unified Xamarin.Messaigng.Apple.Tasks in Xamarin.iOS.Tasks.Windows

Also added missing tasks and changes .After.targets

* Updated Xamarin.Messaging version

* Build agent - reference MSBuild assemblies from the framework

Since the assemblies will be included in the build agent we need those to be the ones that come from the framework to be compatible with macOS

* [msbuild] Fixes _UpdateDynamicLibraryId target

The tasks con this target need to be executed remotely (when building from Windows).

* Updates resources

* Bump Xamarin.Messaging

Fixes problems when executing Exec task remotely

* [dotnet] Overrides Publish targets to execute them remotely from Windows

The `_CopyResolvedFilesToPublishPreserveNewest` and `_CopyResolvedFilesToPublishAlways` targets essentially copy files into the app bundle. Since those are part of the .NET SDK we need to override those so we can pass to the Copy task the SessionId parameter and then it will be executed remotely when building from Windows.

This is done in a Windows.After.targets file so it won't affect builds on macOS.

* Added ILMerge to Xamarin.iOS.Tasks.Windows

Also modified ILMerge.targets to not include System assemblies because we don't need them on the Windows package

* Bumps Messaging

This new version of messaging fixes a problem when copying task inputs from Windows to the Mac

* [dotnet] Fixes copying files to the Mac when building from Windows

When building from Windows there are .NET SDK targets that copy dynamic libraries from the SDK to the intermediate output directory or other files to the publish directory, since we can't control those we can't run them remotely so we need to copy those files to the Mac to ensure other targets will find those.

* [dotnet] Fixes how files are copied to the output dir

- Before executing `_CopyResolvedFilesToPublishPreserveNewest` and `_CopyResolvedFilesToPublishAlways` we copy the input files for those targets to the Mac
- Then we override the original targets to execute the same copy task as the original ones but on the Mac, so the output files are placed in the right location for the following targets to pick them up.

* Fixes typo on Xamarin.iOS.Common.After.targets

* Bumps Xamarin.Messaging

* [msbuild] Fixes VerifyXcodeVersion and ResolveUTIs tasks

Both tasks were not being able to connect to the Mac mostly because of ILRepack, there were kind of 2 versions of Xamarin.Messaging, one merged into Xamarin.iOS.Tasks and another one merged into Xamarin.iOS.Windows.Tasks. Because of this the build connection object registered on the task could not be casted to the build connection type.

This essentially moves both tasks into the Xamarin.iOS.Tasks assembly to avoid this issue, and as part of that also includes the Messaging contracts into that same project.

* [msbuild] Fixes warnings when building from Windows

* [dotnet] Adds missing assemblies to merge into Xamarin.iOS.Tasks

Those 2 new assemblies will only be used from Windows and we need their implementation instead of the ref assemblies. In the future we will need to find a way of doing this on the Windows only pack insted of doing it on the core Xamarin.iOS.Tasks assembly.

* [dotnet] Compute PublishTrimmed on a target

We need to do this so the property is evaluated after VS on Windows connects to the Mac, otherwise by default IsMacEnabled is false from Windows.

* Bumps Messaging to 1.2.111

* [dotnet] Execute ILLink remotely when building from Windows

- Overrides the ILLink task and _RunILLink target to add the hability to execute it remotely, adding input and output properties so files are copied to the server and output files are created on Windows.
- This "custom" ILLink task will only be executed from the Windows targets so when building from a Mac it will execute the core SDK task.

* [dotnet] Fixes intput/output files creation for linker tasks

- Custom Linker options file should be created on the Mac so we need to execute WriteLinesToFile remotely
- All the *.items files from the linker are created on the Mac so we need to execute ReadItemsFromFile remotely
- CompileNativeCode: fixes the OutputFile metadata path, otherwise the execution fails; also copies all the files in the declared "IncludeDirectories" to the Mac
- Avoids copying input files from Windows to the Mac when running LinkNativeCode since the real input files already exist on the Mac, and Windows contains only empty files just to make MSBuild inputs/outputs check work. If we copy those empty files to the Mac we brake the build.

* [msbuild] Minor fixes after merging from main

* [dotnet] Adds missing output files to the Xamarin.iOS.Tasks.Windows project

The output of this project was missing Messaging build targets and the build agent zip file that are needed to create the dotnet Windows specific pack

* [dotnet] Fixes dotnet Windows specific pack generation

Ensures the Windows projects are built and the files are copied to the dotnet pack directory before creating the package.

It also adds a variable to enable building this pack.

* [dotnet] Adds iOS Windows specific pack to iOS only MSI

There's only a Windows specific pack for iOS available for now, so we should only add it to the iOS SDK MSI

* [dotnet] Create a separate bundle for the iOS Windows MSI

We need to do this to avoid including the Windows specific pack in the pkg. Also for now we'll only create an MSI for iOS since it's the only supported platform from Windows.

* Fixes spacing issues in Xamarin.iOS.Tasks.csproj

* Bumps Touch.Unit back to 05db76

* Fixes formatting problems

* [msbuild] Replaces error E0176 by E0186

Because there's a warning W0176 that will overlap with the error

* [msbuild] Fixes CompileEntitlements task

There were 2 problems:
1- The if statement on the DefaultEntitlementsPath was wrong, because we should return the base value if there's no SessionId (which means the task is running on a Mac)
2- We should copy to the Mac the default entitlements file if no custom file was specified

* Several fixes to cleanup the code to support iOS from Windows

* Apply suggestions from code review

Co-authored-by: Rolf Bjarne Kvinge <rolf@xamarin.com>

* Formatting fixes in Xamarin.Messaging.Build

* Reverted formatting changes in CompileEntitlements.cs

* More formatting fixes

* Update msbuild/Messaging/Xamarin.Messaging.Build/Handlers/ExecuteTaskMessageHandler.cs

Co-authored-by: Rolf Bjarne Kvinge <rolf@xamarin.com>

* Fixes order of MSBuild errors in the resource file

* Add newly added localizable strings to canary test of translated strings.

* Delete tests that ensure theres code only on the abstract tasks

These were needed to ensure all the code was in the base tasks so we could have tasks implementations on Windows to remote those. Now that code is part of this repo (and that is why these tests are failing now) so we do not need them anymore.

* [dotnet] Don't build the Windows SDK pack if not configured to do so.

Co-authored-by: mag <mauro.agnoletti@gmail.com>
Co-authored-by: Rolf Bjarne Kvinge <rolf@xamarin.com>
This commit is contained in:
Emanuel Fernandez Dell'Oca 2021-02-12 03:43:17 -03:00 коммит произвёл GitHub
Родитель f4ac99efc0
Коммит d337f0deac
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
166 изменённых файлов: 5344 добавлений и 390 удалений

Просмотреть файл

@ -97,6 +97,13 @@ IOS_NUGET_VERSION_PATCH=$(word 3, $(subst ., ,$(IOS_NUGET_VERSION)))
IOS_NUGET_VERSION_NO_METADATA=$(IOS_NUGET_VERSION)-$(NUGET_PRERELEASE_IDENTIFIER)$(IOS_NUGET_COMMIT_DISTANCE)
IOS_NUGET_VERSION_FULL=$(IOS_NUGET_VERSION_NO_METADATA)+$(NUGET_BUILD_METADATA)
IOS_WINDOWS_NUGET=Microsoft.iOS.Windows
IOS_WINDOWS_NUGET_VERSION_MAJOR=$(IOS_NUGET_VERSION_MAJOR)
IOS_WINDOWS_NUGET_VERSION_MINOR=$(IOS_NUGET_VERSION_MINOR)
IOS_WINDOWS_NUGET_VERSION_PATCH=$(IOS_NUGET_VERSION_PATCH)
IOS_WINDOWS_NUGET_VERSION_NO_METADATA=$(IOS_NUGET_VERSION_NO_METADATA)
IOS_WINDOWS_NUGET_VERSION_FULL=$(IOS_NUGET_VERSION_FULL)
TVOS_NUGET=Microsoft.tvOS
TVOS_NUGET_VERSION_MAJOR=$(word 1, $(subst ., ,$(TVOS_NUGET_VERSION)))
TVOS_NUGET_VERSION_MINOR=$(word 2, $(subst ., ,$(TVOS_NUGET_VERSION)))
@ -529,6 +536,8 @@ endif
DOTNET_PLATFORMS+=macOS
DOTNET_MACOS_RUNTIME_IDENTIFIERS=osx-x64
DOTNET_WINDOWS_PLATFORMS = iOS
# Create variables prefixed with the correctly cased platform name from the upper-cased platform name. This simplifies code in a few areas (whenever we foreach over DOTNET_PLATFORMS).
$(foreach platform,$(DOTNET_PLATFORMS),$(eval DOTNET_$(platform)_RUNTIME_IDENTIFIERS:=$(DOTNET_$(shell echo $(platform) | tr a-z A-Z)_RUNTIME_IDENTIFIERS)))

Просмотреть файл

@ -152,7 +152,7 @@ git-clean-all:
@git submodule foreach -q --recursive 'git clean -xffdq && git reset --hard -q'
@for dir in $(DEPENDENCY_DIRECTORIES); do if test -d $(CURDIR)/$$dir; then echo "Cleaning $$dir" && cd $(CURDIR)/$$dir && git clean -xffdq && git reset --hard -q && git submodule foreach -q --recursive 'git clean -xffdq'; else echo "Skipped $$dir (does not exist)"; fi; done
@if [ -n "$(ENABLE_XAMARIN)" ] || [ -n "$(ENABLE_DOTNET)"]; then \
@if [ -n "$(ENABLE_XAMARIN)" ] || [ -n "$(ENABLE_DOTNET)"] || [ -n "$(ENABLE_DOTNET_WINDOWS)"]; then \
CONFIGURE_FLAGS=""; \
if [ -n "$(ENABLE_XAMARIN)" ]; then \
echo "Xamarin-specific build has been re-enabled"; \
@ -162,6 +162,10 @@ git-clean-all:
echo "Dotnet-specific build has been re-enabled"; \
CONFIGURE_FLAGS="$$CONFIGURE_FLAGS --enable-dotnet"; \
fi; \
if [ -n "$(ENABLE_DOTNET_WINDOWS)" ]; then \
echo "Dotnet-specific Windows build has been re-enabled"; \
CONFIGURE_FLAGS="$$CONFIGURE_FLAGS --enable-dotnet-windows"; \
fi; \
./configure "$$CONFIGURE_FLAGS"; \
$(MAKE) reset; \
echo "Done"; \

Просмотреть файл

@ -9,6 +9,7 @@
<add key="Dotnet arcade" value ="https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-eng/nuget/v3/index.json" />
<add key="dotnet6" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet6/nuget/v3/index.json" />
<add key="dotnet5" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet5/nuget/v3/index.json" />
<add key="xamarin-impl" value="https://pkgs.dev.azure.com/azure-public/vside/_packaging/xamarin-impl/nuget/v3/index.json" />
</packageSources>
<disabledPackageSources>
<clear />

15
configure поставляемый
Просмотреть файл

@ -30,8 +30,11 @@ Usage: configure [options]
--enable-packaged-mono
--disable-packaged-mono Enable/disable using the precompiled version of mono. If disabled mono will be compiled from source.
--enable-dotnet Enable building .NET 5 bits.
--disable-dotnet Disable building .NET 5 bits.
--enable-dotnet Enable building .NET 6 bits.
--disable-dotnet Disable building .NET 6 bits.
--enable-dotnet-windows Enable building Windows .NET 6 bits. Building .NET 6 bits must be also enabled (--enable-dotnet).
--disable-dotnet-windows Disable building Windows .NET 6 bits.
--enable-documentation Enable building of API documentation
--disable-documentation Disable building of API documentation.
@ -120,6 +123,14 @@ while test x$1 != x; do
echo "ENABLE_DOTNET=" >> "$CONFIGURED_FILE"
shift
;;
--enable-dotnet-windows)
echo "ENABLE_DOTNET_WINDOWS=1" >> "$CONFIGURED_FILE"
shift
;;
--disable-dotnet-windows)
echo "ENABLE_DOTNET_WINDOWS=" >> "$CONFIGURED_FILE"
shift
;;
--enable-install-source)
echo "ENABLE_INSTALL_SOURCE=1" >> "$CONFIGURED_FILE"
shift

Просмотреть файл

@ -110,6 +110,8 @@ TEMPLATED_FILES = \
$(foreach platform,$(DOTNET_PLATFORMS),Microsoft.$(platform).Sdk/targets/Microsoft.$(platform).Sdk.Versions.props) \
$(foreach platform,$(DOTNET_PLATFORMS),Microsoft.$(platform).Sdk/targets/Microsoft.$(platform).Sdk.SupportedTargetPlatforms.props) \
nupkgs/$(IOS_WINDOWS_NUGET).%.nupkg: CURRENT_VERSION_NO_METADATA=$(IOS_WINDOWS_NUGET_VERSION_NO_METADATA)
nupkgs/$(IOS_WINDOWS_NUGET).%.nupkg: CURRENT_VERSION_FULL=$(IOS_WINDOWS_NUGET_VERSION_FULL)
define NupkgDefinition
nupkgs/$($(1)_NUGET).%.nupkg: CURRENT_VERSION_NO_METADATA=$($(1)_NUGET_VERSION_NO_METADATA)
@ -131,8 +133,22 @@ nupkgs/$(1).$(2)+$(NUGET_BUILD_METADATA).nupkg: $(TEMPLATED_FILES) $(3) package/
$$(Q_NUGET_ADD) nuget add "$$@" -source $(DOTNET_FEED_DIR) -NonInteractive $(NUGET_VERBOSITY)
endef
define CreateWindowsNuGetTemplate
nupkgs/$(1).$(2)+$(NUGET_BUILD_METADATA).nupkg: $(3) package/$(1)/package.csproj $(wildcard package/*.csproj) $(wildcard $(DOTNET_DESTDIR)/$(1)/* $(DOTNET_DESTDIR)/$(1)/*/* $(DOTNET_DESTDIR)/$(1)/*/*/* $(DOTNET_DESTDIR)/$(1)/*/*/*/*) global.json
@# Delete any versions of the nuget we're building
$$(Q) rm -f nupkgs/$(1).*.nupkg
$$(Q_PACK) $(DOTNET6) pack package/$(1)/package.csproj --output "$$(dir $$@)" $(DOTNET_PACK_VERBOSITY)
@# Nuget pack doesn't add the metadata to the filename, but we want that, so rename nuget to contain the full name
$$(Q) mv "nupkgs/$(1).$(2).nupkg" "$$@"
@# Clean the local feed
$$(Q_NUGET_DEL) if test -d $(DOTNET_FEED_DIR)/$(shell echo $(1) | tr A-Z a-z)/$(2); then nuget delete $(1) $(2) -source $(abspath $(DOTNET_FEED_DIR)) -NonInteractive $(NUGET_VERBOSITY); fi
@# Add the nupkg to our local feed
$$(Q_NUGET_ADD) nuget add "$$@" -source $(DOTNET_FEED_DIR) -NonInteractive $(NUGET_VERBOSITY)
endef
# Create the NuGet packaging targets. It's amazing what make allows you to do...
$(foreach platform,$(DOTNET_PLATFORMS),$(eval $(call CreateNuGetTemplate,Microsoft.$(platform).Sdk,$($(platform)_NUGET_VERSION_NO_METADATA),$($(platform)_NUGET_TARGETS))))
$(eval $(call CreateWindowsNuGetTemplate,Microsoft.iOS.Windows.Sdk,$(IOS_WINDOWS_NUGET_VERSION_NO_METADATA),$(IOS_WINDOWS_NUGET_TARGETS)))
$(foreach platform,$(DOTNET_PLATFORMS),$(eval $(call CreateNuGetTemplate,Microsoft.$(platform).Ref,$($(platform)_NUGET_VERSION_NO_METADATA))))
$(foreach platform,$(DOTNET_PLATFORMS),$(foreach rid,$(DOTNET_$(platform)_RUNTIME_IDENTIFIERS),$(eval $(call CreateNuGetTemplate,Microsoft.$(platform).Runtime.$(rid),$($(platform)_NUGET_VERSION_NO_METADATA)))))
@ -140,6 +156,13 @@ $(foreach platform,$(DOTNET_PLATFORMS),$(foreach rid,$(DOTNET_$(platform)_RUNTIM
$(DOTNET_NUPKG_DIR)/%.nupkg: nupkgs/%.nupkg | $(DOTNET_NUPKG_DIR)
$(Q) $(CP) $< $@
SDK_PACK_IOS_WINDOWS = $(DOTNET_NUPKG_DIR)/$(IOS_WINDOWS_NUGET).Sdk.$(IOS_WINDOWS_NUGET_VERSION_FULL).nupkg
ifdef ENABLE_DOTNET_WINDOWS
SDK_PACKS += $(SDK_PACK_IOS_WINDOWS)
endif
pack-ios-windows: $(SDK_PACK_IOS_WINDOWS)
define PacksDefinitions
RUNTIME_PACKS_$(1) = $$(foreach rid,$$(DOTNET_$(1)_RUNTIME_IDENTIFIERS),$(DOTNET_NUPKG_DIR)/$($(1)_NUGET).Runtime.$$(rid).$($(1)_NUGET_VERSION_FULL).nupkg)
RUNTIME_PACKS += $$(RUNTIME_PACKS_$(1))
@ -236,16 +259,35 @@ PACKAGE_TARGETS += $(DOTNET_PKG_DIR)/Microsoft.$1.Bundle.$2.zip
endef
$(foreach platform,$(DOTNET_PLATFORMS),$(eval $(call CreatePackage,$(platform),$($(platform)_NUGET_VERSION_NO_METADATA),$(shell echo $(platform) | tr A-Z a-z),$(shell echo $(platform) | tr a-z A-Z))))
define CreateWindowsBundle
$(TMP_PKG_DIR)/Microsoft.$1.Windows.Bundle.$2.zip: $($(1)_NUGET_TARGETS) $($(1)_WINDOWS_NUGET_TARGETS) $(WORKLOAD_TARGETS) Makefile $(REF_PACK_$(4)) $(SDK_PACK_$(4)) $(SDK_PACK_$(4)_WINDOWS) | $(TMP_PKG_DIR)
$$(Q) rm -rf $$@ $$@.tmpdir $$@.tmp
$$(Q) mkdir -p $$@.tmpdir/dotnet/sdk-manifests/$(DOTNET6_VERSION_BAND)/
$$(Q) mkdir -p $$@.tmpdir/dotnet/packs/Microsoft.$1.Sdk
$$(Q) mkdir -p $$@.tmpdir/dotnet/packs/Microsoft.$1.Windows.Sdk
$$(Q) mkdir -p $$@.tmpdir/dotnet/packs/Microsoft.$1.Ref
$$(Q) $(CP) -r Microsoft.NET.Workload.$1 $$@.tmpdir/dotnet/sdk-manifests/$(DOTNET6_VERSION_BAND)/
$$(Q) $(CP) -r $(DOTNET_DESTDIR)/Microsoft.$1.Sdk $$@.tmpdir/dotnet/packs/Microsoft.$1.Sdk/$2
$$(Q) $(CP) -r $(DOTNET_DESTDIR)/Microsoft.$1.Windows.Sdk $$@.tmpdir/dotnet/packs/Microsoft.$1.Windows.Sdk/$2
$$(Q) $(CP) -r $(DOTNET_DESTDIR)/Microsoft.$1.Ref $$@.tmpdir/dotnet/packs/Microsoft.$1.Ref/$2
$$(Q_GEN) cd $$@.tmpdir && zip -9rq $$(abspath $$@.tmp) .
$$(Q) mv $$@.tmp $$@
$$(Q) echo Created $$@
PACKAGE_TARGETS += $(DOTNET_PKG_DIR)/Microsoft.$1.Windows.Bundle.$2.zip
endef
$(foreach platform,$(DOTNET_WINDOWS_PLATFORMS),$(eval $(call CreateWindowsBundle,$(platform),$($(platform)_NUGET_VERSION_NO_METADATA),$(shell echo $(platform) | tr A-Z a-z),$(shell echo $(platform) | tr a-z A-Z))))
define CreateMsi
$(TMP_PKG_DIR)/Microsoft.NET.Workload.$1.$2.wsx: ./generate-wix.csharp Makefile $(TMP_PKG_DIR)/Microsoft.$1.Bundle.$2.zip
$$(Q_GEN) ./generate-wix.csharp "$1" "$$@" "$(TMP_PKG_DIR)/Microsoft.$1.Bundle.$2.zip.tmpdir/dotnet" "$2"
$(TMP_PKG_DIR)/Microsoft.NET.Workload.$1.$2.wsx: ./generate-wix.csharp Makefile $(TMP_PKG_DIR)/Microsoft.$1.Windows.Bundle.$2.zip
$$(Q_GEN) ./generate-wix.csharp "$1" "$$@" "$(TMP_PKG_DIR)/Microsoft.$1.Windows.Bundle.$2.zip.tmpdir/dotnet" "$2"
$(TMP_PKG_DIR)/Microsoft.NET.Workload.$1.$2.msi: $(TMP_PKG_DIR)/Microsoft.NET.Workload.$1.$2.wsx .stamp-check-wixl
$$(Q_GEN) wixl -o "$$@" "$$<" -a x64
MSI_TARGETS += $(DOTNET_PKG_DIR)/Microsoft.NET.Workload.$1.$2.msi
endef
$(foreach platform,$(DOTNET_PLATFORMS),$(eval $(call CreateMsi,$(platform),$($(platform)_NUGET_VERSION_NO_METADATA))))
$(foreach platform,$(DOTNET_WINDOWS_PLATFORMS),$(eval $(call CreateMsi,$(platform),$($(platform)_NUGET_VERSION_NO_METADATA))))
.stamp-check-wixl:
$(Q) if ! type wixl; then \

Просмотреть файл

@ -0,0 +1,9 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<_PlatformName>iOS</_PlatformName>
<IsWindowsPack>true</IsWindowsPack>
</PropertyGroup>
<Import Project="../microsoft.sdk.csproj" />
</Project>

Просмотреть файл

@ -1,6 +1,7 @@
<Project>
<PropertyGroup>
<PackageId>Microsoft.$(_PlatformName).Sdk</PackageId>
<PackageId Condition="'$(IsWindowsPack)' == 'true'">Microsoft.$(_PlatformName).Windows.Sdk</PackageId>
<Description>Managed Tools and Bindings for the $(_PlatformName) SDK</Description>
</PropertyGroup>
<Import Project="common.csproj" />

Просмотреть файл

@ -149,6 +149,7 @@
<!-- Inject our custom logic into *DependsOn variables -->
<PropertyGroup>
<BuildDependsOn>
_ComputePublishTrimmed;
BuildOnlySettings;
_CollectBundleResources;
_PackLibraryResources;
@ -194,6 +195,14 @@
<_AdditionalTaskAssemblyDirectory>$(_XamarinSdkRootDirectory)tools/dotnet-linker/</_AdditionalTaskAssemblyDirectory>
<_AdditionalTaskAssembly>$(_AdditionalTaskAssemblyDirectory)dotnet-linker.dll</_AdditionalTaskAssembly>
</PropertyGroup>
<!-- PublishTrimmed must be calculated as part of a target because IsMacEnabled on Windows will be set after connecting to the Mac -->
<Target Name="_ComputePublishTrimmed">
<PropertyGroup>
<PublishTrimmed Condition="'$(PublishTrimmed)' == '' And ($(_ProjectType.EndsWith('ExecutableProject')) Or $(_ProjectType.EndsWith('AppExtensionProject'))) And '$(IsMacEnabled)' == 'true'">true</PublishTrimmed>
</PropertyGroup>
</Target>
<Target Name="_ComputeLinkerArguments" DependsOnTargets="_ComputeLinkMode;_ComputeFrameworkVariables;_ComputeFrameworkAssemblies;ComputeResolvedFilesToPublishList;_ParseBundlerArguments;_ComputeVariables;">
<!-- Validate the linker mode -->
<Error Text="Invalid link mode: '$(_LinkMode)'. Valid link modes are: 'None', 'SdkOnly' and 'Full'" Condition="'$(_LinkMode)' != 'None' And '$(_LinkMode)' != 'SdkOnly' And '$(_LinkMode)' != 'Full'" />
@ -201,12 +210,15 @@
<PropertyGroup>
<!-- Pass the custom options to our custom steps -->
<_CustomLinkerOptionsFile>$([System.IO.Path]::GetFullPath('$(IntermediateOutputPath)custom-linker-options.txt'))</_CustomLinkerOptionsFile>
<_CustomLinkerOptionsFile Condition="'$(BuildSessionId)' != ''">$(IntermediateOutputPath)custom-linker-options.txt</_CustomLinkerOptionsFile>
<!-- The directory where the linker puts *.items files that will be loaded in the _LoadLinkerOutput target -->
<_LinkerItemsDirectory>$([System.IO.Path]::GetFullPath('$(IntermediateOutputPath)linker-items'))</_LinkerItemsDirectory>
<_LinkerItemsDirectory Condition="'$(BuildSessionId)' != ''">$(IntermediateOutputPath)linker-items</_LinkerItemsDirectory>
<!-- A temporary output directory for our linker steps -->
<_LinkerCacheDirectory>$([System.IO.Path]::GetFullPath('$(IntermediateOutputPath)linker-cache'))</_LinkerCacheDirectory>
<_LinkerCacheDirectory Condition="'$(BuildSessionId)' != ''">$(IntermediateOutputPath)linker-cache</_LinkerCacheDirectory>
<_CustomLinkerOptions>
AssemblyName=$(AssemblyName).dll
@ -300,44 +312,44 @@
</ItemGroup>
<!-- Create the file with our custom linker options -->
<WriteLinesToFile File="$(_CustomLinkerOptionsFile)" Lines="$(_CustomLinkerOptions)" Overwrite="true" />
<WriteLinesToFile SessionId="$(BuildSessionId)" File="$(_CustomLinkerOptionsFile)" Lines="$(_CustomLinkerOptions)" Overwrite="true" />
</Target>
<Target Name="_LoadLinkerOutput">
<!-- Load _MainFile -->
<ReadItemsFromFile File="$(_LinkerItemsDirectory)/_MainFile.items" Condition="Exists('$(_LinkerItemsDirectory)/_MainFile.items')">
<ReadItemsFromFile SessionId="$(BuildSessionId)" File="$(_LinkerItemsDirectory)/_MainFile.items" Condition="Exists('$(_LinkerItemsDirectory)/_MainFile.items')">
<Output TaskParameter="Items" ItemName="_MainFile" />
</ReadItemsFromFile>
<!-- Load _MainLinkWith -->
<ReadItemsFromFile File="$(_LinkerItemsDirectory)/_MainLinkWith.items" Condition="Exists('$(_LinkerItemsDirectory)/_MainLinkWith.items')">
<ReadItemsFromFile SessionId="$(BuildSessionId)" File="$(_LinkerItemsDirectory)/_MainLinkWith.items" Condition="Exists('$(_LinkerItemsDirectory)/_MainLinkWith.items')">
<Output TaskParameter="Items" ItemName="_MainLinkWith" />
</ReadItemsFromFile>
<!-- Load _LinkerFrameworks -->
<ReadItemsFromFile File="$(_LinkerItemsDirectory)/_LinkerFrameworks.items" Condition="Exists('$(_LinkerItemsDirectory)/_LinkerFrameworks.items')">
<ReadItemsFromFile SessionId="$(BuildSessionId)" File="$(_LinkerItemsDirectory)/_LinkerFrameworks.items" Condition="Exists('$(_LinkerItemsDirectory)/_LinkerFrameworks.items')">
<Output TaskParameter="Items" ItemName="_LinkerFrameworks" />
</ReadItemsFromFile>
<!-- Load _BindingLibraryLinkWith -->
<ReadItemsFromFile File="$(_LinkerItemsDirectory)/_BindingLibraryLinkWith.items" Condition="Exists('$(_LinkerItemsDirectory)/_BindingLibraryLinkWith.items')">
<ReadItemsFromFile SessionId="$(BuildSessionId)" File="$(_LinkerItemsDirectory)/_BindingLibraryLinkWith.items" Condition="Exists('$(_LinkerItemsDirectory)/_BindingLibraryLinkWith.items')">
<Output TaskParameter="Items" ItemName="_BindingLibraryLinkWith" />
</ReadItemsFromFile>
<!-- Load _BindingLibraryLinkerFlags -->
<ReadItemsFromFile File="$(_LinkerItemsDirectory)/_BindingLibraryLinkerFlags.items" Condition="Exists('$(_LinkerItemsDirectory)/_BindingLibraryLinkerFlags.items')">
<ReadItemsFromFile SessionId="$(BuildSessionId)" File="$(_LinkerItemsDirectory)/_BindingLibraryLinkerFlags.items" Condition="Exists('$(_LinkerItemsDirectory)/_BindingLibraryLinkerFlags.items')">
<Output TaskParameter="Items" ItemName="_BindingLibraryLinkerFlags" />
</ReadItemsFromFile>
<!-- Load _BindingLibraryFrameworks -->
<ReadItemsFromFile File="$(_LinkerItemsDirectory)/_BindingLibraryFrameworks.items" Condition="Exists('$(_LinkerItemsDirectory)/_BindingLibraryFrameworks.items')">
<ReadItemsFromFile SessionId="$(BuildSessionId)" File="$(_LinkerItemsDirectory)/_BindingLibraryFrameworks.items" Condition="Exists('$(_LinkerItemsDirectory)/_BindingLibraryFrameworks.items')">
<Output TaskParameter="Items" ItemName="_BindingLibraryFrameworks" />
</ReadItemsFromFile>
<!-- Load _RegistrarFile -->
<ReadItemsFromFile File="$(_LinkerItemsDirectory)/_RegistrarFile.items" Condition="Exists('$(_LinkerItemsDirectory)/_RegistrarFile.items')">
<ReadItemsFromFile SessionId="$(BuildSessionId)" File="$(_LinkerItemsDirectory)/_RegistrarFile.items" Condition="Exists('$(_LinkerItemsDirectory)/_RegistrarFile.items')">
<Output TaskParameter="Items" ItemName="_RegistrarFile" />
</ReadItemsFromFile>
<!-- Load _ReferencesFile -->
<ReadItemsFromFile File="$(_LinkerItemsDirectory)/_ReferencesFile.items" Condition="Exists('$(_LinkerItemsDirectory)/_ReferencesFile.items')">
<ReadItemsFromFile SessionId="$(BuildSessionId)" File="$(_LinkerItemsDirectory)/_ReferencesFile.items" Condition="Exists('$(_LinkerItemsDirectory)/_ReferencesFile.items')">
<Output TaskParameter="Items" ItemName="_ReferencesFile" />
</ReadItemsFromFile>
<!-- Load _ReferencesLinkerFlags -->
<ReadItemsFromFile File="$(_LinkerItemsDirectory)/_ReferencesLinkerFlags.items" Condition="Exists('$(_LinkerItemsDirectory)/_ReferencesLinkerFlags.items')">
<ReadItemsFromFile SessionId="$(BuildSessionId)" File="$(_LinkerItemsDirectory)/_ReferencesLinkerFlags.items" Condition="Exists('$(_LinkerItemsDirectory)/_ReferencesLinkerFlags.items')">
<Output TaskParameter="Items" ItemName="_ReferencesLinkerFlags" />
</ReadItemsFromFile>
<!-- Load _AssembliesToAOT -->
@ -521,6 +533,12 @@
</CompileNativeCode>
</Target>
<PropertyGroup>
<_UpdateDynamicLibraryIdDependsOn>
_ComputeVariables;
_ParseBundlerArguments;
</_UpdateDynamicLibraryIdDependsOn>
</PropertyGroup>
<!-- The .dylibs shipped with mono comes with the original identity:
@ -533,7 +551,7 @@
-->
<Target
Name="_UpdateDynamicLibraryId"
DependsOnTargets="_ComputeVariables;_ParseBundlerArguments"
DependsOnTargets="$(_UpdateDynamicLibraryIdDependsOn)"
Inputs="@(_MonoLibraryFix)"
Outputs="@(_MonoLibraryFix.TargetPath)"
Condition=" '$(_PlatformName)' != 'macOS'">
@ -546,11 +564,13 @@
<!-- install_name_tool modifies the file in-place, so copy it first to a temporary directory before we fix it -->
<Copy
Condition="'$(IsMacEnabled)' == 'true'"
SessionId="$(BuildSessionId)"
SourceFiles="%(_MonoLibraryFix.FullPath)"
DestinationFolder="$(_IntermediateNativeLibraryDir)"
/>
<Exec
Condition="'$(IsMacEnabled)' == 'true'"
SessionId="$(BuildSessionId)"
Command="xcrun install_name_tool -id $(_ExecutablePathPrefix)%(_MonoLibraryFix.Filename)%(_MonoLibraryFix.Extension) %(_MonoLibraryFix.TargetPath)"
EnvironmentVariables="DEVELOPER_DIR=$(_SdkDevPath)"
/>
@ -745,8 +765,5 @@
<Import Project="$(_TargetsDirectory)Xamarin.Mac.AppExtension.$(_ProjectLanguage).targets" Condition="'$(_ProjectType)' == 'macOSAppExtensionProject' " />
<Import Project="$(_TargetsDirectory)Xamarin.Mac.ObjCBinding.$(_ProjectLanguage).targets" Condition="'$(_ProjectType)' == 'macOSBindingProject' " />
<PropertyGroup>
<!-- PublishTrimmed depends on IsMacEnabled, which is defined in the Xamarin.iOS/Xamarin.Mac targets files we import just above here -->
<PublishTrimmed Condition="'$(PublishTrimmed)' == '' And ($(_ProjectType.EndsWith('ExecutableProject')) Or $(_ProjectType.EndsWith('AppExtensionProject'))) And '$(IsMacEnabled)' == 'true'">true</PublishTrimmed>
</PropertyGroup>
</Project>

Просмотреть файл

@ -0,0 +1,5 @@
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<MessagingVersion>1.2.111</MessagingVersion>
</PropertyGroup>
</Project>

Просмотреть файл

@ -2,6 +2,7 @@
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>
<MergeSystemAssemblies Condition="'$(MergeSystemAssemblies)' == ''">true</MergeSystemAssemblies>
</PropertyGroup>
<ItemGroup>
@ -29,17 +30,30 @@
<MergedAssemblies Include="@(ReferencePath)" Condition="'%(FileName)' == 'Xamarin.MacDev.Tasks'" />
<MergedAssemblies Include="@(ReferencePath)" Condition="'%(FileName)' == '$(AssemblyName).Core'" /> <!-- Use AssemblyName so that the exact same logic works for both Xamarin.iOS.Tasks.dll and Xamarin.Mac.Tasks.dll -->
<MergedAssemblies Include="@(ReferencePath)" Condition="'%(FileName)' == 'Xamarin.MacDev'" />
<MergedAssemblies Include="@(ReferencePath)" Condition="'%(FileName)' == 'DotNetZip'" />
<MergedAssemblies Include="@(ReferencePath)" Condition="'%(FileName)' == 'ILLink.Tasks'" />
<MergedAssemblies Include="@(ReferencePath)" Condition="'%(FileName)' == 'Newtonsoft.Json'" />
<MergedAssemblies Include="@(ReferencePath)" Condition="'%(FileName)' == 'Renci.SshNet'" />
<MergedAssemblies Include="@(ReferencePath)" Condition="'%(FileName)' == 'SshNet.Security.Cryptography'" />
<MergedAssemblies Include="@(ReferencePath)" Condition="'%(FileName)' == 'System.ComponentModel.Annotations'" />
<MergedAssemblies Include="@(ReferencePath)" Condition="'%(FileName)' == 'System.ComponentModel.Composition'" />
<MergedAssemblies Include="@(ReferencePath)" Condition="'%(FileName)' == 'System.Diagnostics.Tracer'" />
<MergedAssemblies Include="@(ReferencePath)" Condition="'%(FileName)' == 'System.Net.Mqtt'" />
<MergedAssemblies Include="@(ReferencePath)" Condition="'%(FileName)' == 'System.Reactive'" />
<MergedAssemblies Include="@(ReferencePath)" Condition="'%(FileName)' == 'System.Security.Cryptography.ProtectedData'" />
<MergedAssemblies Include="@(ReferencePath)" Condition="'%(FileName)' == 'System.Text.Encoding.CodePages'" />
<MergedAssemblies Include="$(OutputPath)/Microsoft.Bcl.AsyncInterfaces.dll" />
<MergedAssemblies Include="$(OutputPath)/System.Buffers.dll" />
<MergedAssemblies Include="$(OutputPath)/System.Memory.dll" />
<MergedAssemblies Include="$(OutputPath)/System.Numerics.Vectors.dll" />
<MergedAssemblies Include="$(OutputPath)/System.Runtime.CompilerServices.Unsafe.dll" />
<MergedAssemblies Include="$(OutputPath)/System.Text.Json.dll" />
<MergedAssemblies Include="$(OutputPath)/System.Threading.Tasks.Extensions.dll" />
<MergedAssemblies Include="$(OutputPath)/System.Text.Encodings.Web.dll" />
<MergedAssemblies Include="$(OutputPath)/Microsoft.Bcl.AsyncInterfaces.dll" Condition="'$(MergeSystemAssemblies)' == 'true'" />
<MergedAssemblies Include="$(OutputPath)/System.Buffers.dll" Condition="'$(MergeSystemAssemblies)' == 'true'" />
<MergedAssemblies Include="$(OutputPath)/System.Memory.dll" Condition="'$(MergeSystemAssemblies)' == 'true'" />
<MergedAssemblies Include="$(OutputPath)/System.Numerics.Vectors.dll" Condition="'$(MergeSystemAssemblies)' == 'true'" />
<MergedAssemblies Include="$(OutputPath)/System.Runtime.CompilerServices.Unsafe.dll" Condition="'$(MergeSystemAssemblies)' == 'true'" />
<MergedAssemblies Include="$(OutputPath)/System.Text.Json.dll" Condition="'$(MergeSystemAssemblies)' == 'true'" />
<MergedAssemblies Include="$(OutputPath)/System.Threading.Tasks.Extensions.dll" Condition="'$(MergeSystemAssemblies)' == 'true'" />
<MergedAssemblies Include="$(OutputPath)/System.Text.Encodings.Web.dll" Condition="'$(MergeSystemAssemblies)' == 'true'" />
<MergedAssemblies Include="@(ReferencePath)" Condition="'%(Extension)' == '.dll' And $([MSBuild]::ValueOrDefault('%(FileName)', '').StartsWith('Mono.Cecil', StringComparison.OrdinalIgnoreCase))" />
<MergedAssemblies Include="@(ReferencePath)" Condition="'%(Extension)' == '.dll' And $([MSBuild]::ValueOrDefault('%(FileName)', '').StartsWith('Xamarin.Messaging', StringComparison.OrdinalIgnoreCase))" />
</ItemGroup>
<ItemGroup Condition="$(TargetFramework.StartsWith ('net4'))">
<MergedAssemblies Include="@(ReferenceCopyLocalPaths)" Condition="'%(Extension)' == '.dll'

Просмотреть файл

@ -35,12 +35,19 @@ IOS_TARGETS = \
$(wildcard Xamarin.Shared/Xamarin.*.props) \
$(wildcard Xamarin.Shared/Xamarin.*.targets) \
IOS_WINDOWS_TARGETS = \
$(wildcard Xamarin.iOS.Tasks.Windows/Xamarin.*.props) \
$(wildcard Xamarin.iOS.Tasks.Windows/Xamarin.*.targets) \
$(wildcard Xamarin.iOS.Tasks.Windows/bin/$(CONFIG)/$(TARGETFRAMEWORK)/Xamarin.*.props) \
$(wildcard Xamarin.iOS.Tasks.Windows/bin/$(CONFIG)/$(TARGETFRAMEWORK)/Xamarin.*.targets) \
IOS_BINDING_TARGETS = $(wildcard Xamarin.ObjcBinding.Tasks/*.targets)
LOCALIZATION_LANGUAGES=cs de es fr it ja ko pl pt-BR ru tr zh-Hans zh-Hant
TRANSLATED_ASSEMBLIES = $(foreach locale,$(LOCALIZATION_LANGUAGES),$(locale)/Xamarin.Localization.MSBuild)
LOCALIZATION_ASSEMBLIES = Xamarin.Localization.MSBuild
IOS_TASK_ASSEMBLIES = Xamarin.iOS.Tasks $(LOCALIZATION_ASSEMBLIES)
IOS_WINDOWS_TASK_ASSEMBLIES = Xamarin.iOS.Tasks.Windows
IOS_DIRECTORIES = \
$(IOS_DESTDIR)$(MONOTOUCH_PREFIX)/lib/mono/Xamarin.iOS \
@ -75,7 +82,7 @@ ifdef INCLUDE_IOS
MSBUILD_PRODUCTS += all-ios
MSBUILD_DIRECTORIES += $(IOS_DIRECTORIES)
MSBUILD_SYMLINKS += symlinks-ios
MSBUILD_TASK_ASSEMBLIES += $(IOS_TASK_ASSEMBLIES)
MSBUILD_TASK_ASSEMBLIES += $(IOS_TASK_ASSEMBLIES) $(IOS_WINDOWS_TASK_ASSEMBLIES)
endif
##
@ -385,6 +392,7 @@ endif
DOTNET_DIRECTORIES += \
$(DOTNET_DESTDIR)/$(IOS_NUGET).Sdk/tools/msbuild/iOS \
$(DOTNET_DESTDIR)/$(IOS_WINDOWS_NUGET).Sdk/tools/msbuild/iOS \
$(DOTNET_DESTDIR)/$(TVOS_NUGET).Sdk/tools/msbuild/iOS \
$(DOTNET_DESTDIR)/$(TVOS_NUGET).Sdk/tools/msbuild/tvOS \
$(DOTNET_DESTDIR)/$(WATCHOS_NUGET).Sdk/tools/msbuild/iOS \
@ -413,7 +421,20 @@ MSBUILD_DIRECTORIES += $(DOTNET_DIRECTORIES)
ifdef ENABLE_DOTNET
MSBUILD_PRODUCTS += $(DOTNET_TARGETS)
ifdef ENABLE_DOTNET_WINDOWS
DOTNET_IOS_WINDOWS_OUTPUT_FILES = $(foreach dll,$(IOS_WINDOWS_TASK_ASSEMBLIES),$(dll).dll $(dll).pdb) Broker.zip Build.zip
DOTNET_IOS_WINDOWS_FILES = $(IOS_WINDOWS_TARGETS) $(foreach file,$(DOTNET_IOS_WINDOWS_OUTPUT_FILES),Xamarin.iOS.Tasks.Windows/bin/$(CONFIG)/$(TARGETFRAMEWORK)/$(file))
# Ensures Xamarin.iOS.Tasks.Windows is built and copies the output files to the Sdk Windows pack
.dotnet-windows: .build-stamp
$(CP) $(DOTNET_IOS_WINDOWS_FILES) $(DOTNET_DESTDIR)/$(IOS_WINDOWS_NUGET).Sdk/tools/msbuild/iOS/
all-local:: .dotnet-windows
dotnet:: .dotnet-windows
endif
endif
##
## Common targets ##
##
@ -459,7 +480,7 @@ clean-local::
git clean -xfdq
cd $(XAMARIN_MACDEV_PATH) && git clean -xfdq
dotnet: $(DOTNET_TARGETS)
dotnet:: $(DOTNET_TARGETS)
# make will automatically consider files created in chained implicit rules as temporary files, and delete them afterwards
# marking those files as .SECONDARY will prevent that deletion.

Просмотреть файл

@ -0,0 +1,25 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6" />
</startup>
<system.diagnostics>
<trace autoflush="true">
<listeners>
<add name="console" type="System.Diagnostics.ConsoleTraceListener" />
</listeners>
</trace>
</system.diagnostics>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-8.0.0.0" newVersion="8.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Net.Mqtt" publicKeyToken="ac60ebe5a5220e27" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-0.2.274.0" newVersion="0.2.274.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration>

Просмотреть файл

@ -0,0 +1,83 @@
using System;
using System.IO;
using System.Threading.Tasks;
using Xamarin.Messaging.Build.Contracts;
using Xamarin.Messaging.Client;
namespace Xamarin.Messaging.Build {
public class BuildAgent : Agent {
public BuildAgent (ITopicGenerator topicGenerator, string version = null, string versionInfo = null) : base (topicGenerator)
{
Version = string.IsNullOrEmpty (version) ? GetVersion () : version;
VersionInfo = string.IsNullOrEmpty (versionInfo) ? GetInformationalVersion () : versionInfo;
}
public override string Name => BuildAgentInfo.Instance.Name;
public override string Version { get; }
public override string VersionInfo { get; }
protected override Task InitializeAsync ()
{
SetLicenceEnvironmentVariables ();
return Task.FromResult (true);
}
protected override async Task RegisterCustomHandlersAsync (MessageHandlerManager manager)
{
await TryRegisterHandlerAsync (new ExecuteTaskMessageHandler ())
.ConfigureAwait (continueOnCapturedContext: false);
await TryRegisterHandlerAsync (new CompareFilesMessageHandler ())
.ConfigureAwait (continueOnCapturedContext: false);
await TryRegisterHandlerAsync (new CopyItemMessageHandler ())
.ConfigureAwait (continueOnCapturedContext: false);
await TryRegisterHandlerAsync (new GetItemMessageHandler ())
.ConfigureAwait (continueOnCapturedContext: false);
await TryRegisterHandlerAsync (new VerifyXcodeVersionMessageHandler ())
.ConfigureAwait (continueOnCapturedContext: false);
await TryRegisterHandlerAsync (new GetUniversalTargetIdentifierMessageHandler ())
.ConfigureAwait (continueOnCapturedContext: false);
}
protected override async Task SendCustomLogFileMessagesAsync ()
{
var stderrLogFile = string.Format ("{0}.stderr.log", TracingConfiguration.GetLogFileNameWithoutExtension ());
await Client.SendAsync (new LogFileMessage {
LogFile = stderrLogFile
}).ConfigureAwait (continueOnCapturedContext: false);
}
void SetLicenceEnvironmentVariables ()
{
Environment.SetEnvironmentVariable ("VSIDE", "true");
var assemblyLocation = this.GetType ().Assembly.Location;
var path = Path.GetDirectoryName (assemblyLocation);
AddValueToEnvVariable ("MONO_GAC_PREFIX", path);
AddValueToEnvVariable ("PATH", path);
AddValueToEnvVariable ("PKG_CONFIG_PATH", path);
}
void AddValueToEnvVariable (string envVarName, string value)
{
var envValue = Environment.GetEnvironmentVariable (envVarName);
if (string.IsNullOrEmpty (envValue)) {
envValue = string.Empty;
}
if (!envValue.Contains (value)) {
Environment.SetEnvironmentVariable (envVarName, (!string.IsNullOrEmpty (envValue) ? envValue + ":" : string.Empty) + value);
}
}
string GetVersion () => ThisAssembly.Git.BaseVersion.Major + "." + ThisAssembly.Git.BaseVersion.Minor + "." + ThisAssembly.Git.BaseVersion.Patch + "." + ThisAssembly.Git.Commits;
string GetInformationalVersion () => GetVersion () + "-" + ThisAssembly.Git.Branch + "+" + ThisAssembly.Git.Commit;
}
}

Просмотреть файл

@ -0,0 +1,101 @@
using System;
using System.Collections.Generic;
using Microsoft.Build.Framework;
using Xamarin.Messaging.Build.Contracts;
namespace Xamarin.Messaging.Build {
internal class BuildEngine : IBuildEngine, IBuildEngine2, IBuildEngine3, IBuildEngine4 {
List<LogEntry> logEntries = new List<LogEntry> ();
public List<LogEntry> LogEntries => logEntries;
public int ColumnNumberOfTaskNode => 0;
public bool ContinueOnError => throw new NotImplementedException ();
public int LineNumberOfTaskNode => 0;
public string ProjectFileOfTaskNode => string.Empty;
public bool IsRunningMultipleNodes => throw new NotImplementedException ();
public bool BuildProjectFile (string projectFileName, string [] targetNames, System.Collections.IDictionary globalProperties, System.Collections.IDictionary targetOutputs)
{
throw new NotImplementedException ();
}
public void LogCustomEvent (CustomBuildEventArgs e)
{
}
public void LogErrorEvent (BuildErrorEventArgs e)
{
logEntries.Add (
new LogEntry {
MessageType = LogEntryType.Error,
Message = e.Message,
Code = e.Code
});
}
public void LogMessageEvent (BuildMessageEventArgs e)
{
logEntries.Add (
new LogEntry {
MessageType = LogEntryType.Message,
Message = e.Message,
Importance = e.Importance
});
}
public void LogWarningEvent (BuildWarningEventArgs e)
{
logEntries.Add (
new LogEntry {
MessageType = LogEntryType.Warning,
Message = e.Message,
Code = e.Code
});
}
public bool BuildProjectFile (string projectFileName, string [] targetNames, System.Collections.IDictionary globalProperties, System.Collections.IDictionary targetOutputs, string toolsVersion)
{
throw new NotImplementedException ();
}
public bool BuildProjectFilesInParallel (string [] projectFileNames, string [] targetNames, System.Collections.IDictionary [] globalProperties, System.Collections.IDictionary [] targetOutputsPerProject, string [] toolsVersion, bool useResultsCache, bool unloadProjectsOnCompletion)
{
throw new NotImplementedException ();
}
public BuildEngineResult BuildProjectFilesInParallel (string [] projectFileNames, string [] targetNames, System.Collections.IDictionary [] globalProperties, System.Collections.Generic.IList<string> [] removeGlobalProperties, string [] toolsVersion, bool returnTargetOutputs)
{
throw new NotImplementedException ();
}
public void Reacquire ()
{
throw new NotImplementedException ();
}
public void Yield ()
{
throw new NotImplementedException ();
}
public object GetRegisteredTaskObject (object key, RegisteredTaskObjectLifetime lifetime)
{
throw new NotImplementedException ();
}
public void RegisterTaskObject (object key, object obj, RegisteredTaskObjectLifetime lifetime, bool allowEarlyCollection)
{
throw new NotImplementedException ();
}
public object UnregisterTaskObject (object key, RegisteredTaskObjectLifetime lifetime)
{
throw new NotImplementedException ();
}
}
}

Просмотреть файл

@ -0,0 +1,39 @@
using System.Collections.Generic;
using System.IO;
using System.Security.Cryptography;
using System.Threading.Tasks;
using Xamarin.Messaging.Build.Contracts;
using Xamarin.Messaging.Client;
namespace Xamarin.Messaging.Build {
public class CompareFilesMessageHandler : RequestHandler<CompareItemsMessage, CompareItemsResult> {
protected override async Task<CompareItemsResult> ExecuteAsync (CompareItemsMessage message)
{
return await Task.Run (() => {
var buildPath = Path.Combine (MessagingContext.GetBuildPath (), message.AppName, message.SessionId);
var files = new List<string> ();
using (var hashAlgorithm = Hash.GetAlgorithm ()) {
foreach (var file in message.Items) {
var targetPath = Path.Combine (buildPath, PlatformPath.GetPathForCurrentPlatform (file.ItemSpec));
if (!File.Exists (targetPath)) {
files.Add (file.ItemSpec);
} else {
using (var stream = File.OpenRead (targetPath)) {
var localHash = hashAlgorithm.ComputeHashAsString (stream);
if (file.Hash != localHash) {
files.Add (file.ItemSpec);
}
}
}
}
}
return new CompareItemsResult { MissingFiles = files };
}).ConfigureAwait (continueOnCapturedContext: false);
}
}
}

Просмотреть файл

@ -0,0 +1,31 @@
using System.Diagnostics;
using System.IO;
using System.Threading.Tasks;
using Xamarin.Messaging.Build.Contracts;
using Xamarin.Messaging.Client;
namespace Xamarin.Messaging.Build {
public class CopyItemMessageHandler : RequestHandler<CopyItemMessage> {
static readonly ITracer tracer = Tracer.Get<CopyItemMessageHandler> ();
protected override async Task ExecuteAsync (CopyItemMessage message)
{
await Task.Run (async () => {
var targetPath = Path.GetFullPath (Path.Combine (
MessagingContext.GetBuildPath (),
message.AppName,
message.SessionId,
PlatformPath.GetPathForCurrentPlatform (message.ItemSpec)));
if (File.Exists (targetPath))
File.Delete (targetPath);
else if (!Directory.Exists (Path.GetDirectoryName (targetPath)))
Directory.CreateDirectory (Path.GetDirectoryName (targetPath));
using (var file = File.Create (targetPath))
using (var stream = new MemoryStream (message.Content))
await stream.CopyToAsync (file).ConfigureAwait (continueOnCapturedContext: false);
});
}
}
}

Просмотреть файл

@ -0,0 +1,48 @@
using System.Diagnostics;
using System.IO;
using System.Threading.Tasks;
using Xamarin.Messaging.Build.Contracts;
using Xamarin.Messaging.Build.Serialization;
using Xamarin.Messaging.Client;
namespace Xamarin.Messaging.Build {
public class ExecuteTaskMessageHandler : RequestHandler<ExecuteTaskMessage, ExecuteTaskResult> {
static readonly ITracer tracer = Tracer.Get<ExecuteTaskMessageHandler> ();
static readonly object lockObject = new object ();
ITaskRunner runner;
public ExecuteTaskMessageHandler ()
{
var runner = new TaskRunner (new TaskSerializer ());
runner.LoadXamarinTasks ();
this.runner = runner;
}
public ExecuteTaskMessageHandler (ITaskRunner runner) => this.runner = runner;
protected override async Task<ExecuteTaskResult> ExecuteAsync (ExecuteTaskMessage message)
{
return await Task.Run (() => {
// We need to lock in order to change the current directory
lock (lockObject) {
var currentDirectory = Directory.GetCurrentDirectory ();
try {
var buildDirectory = Path.Combine (MessagingContext.GetBuildPath (), message.AppName, message.SessionId);
Directory.CreateDirectory (buildDirectory);
Directory.SetCurrentDirectory (buildDirectory);
return runner.Execute (message.TaskName, message.Inputs);
} finally {
Directory.SetCurrentDirectory (currentDirectory);
}
}
}).ConfigureAwait (continueOnCapturedContext: false);
}
}
}

Просмотреть файл

@ -0,0 +1,36 @@
using System.Diagnostics;
using System.IO;
using System.Threading.Tasks;
using Xamarin.Messaging.Build.Contracts;
using Xamarin.Messaging.Client;
namespace Xamarin.Messaging.Build {
public class GetItemMessageHandler : RequestHandler<GetItemMessage, GetItemResult> {
static readonly ITracer tracer = Tracer.Get<CopyItemMessageHandler> ();
protected override async Task<GetItemResult> ExecuteAsync (GetItemMessage message)
{
return await Task.Run<GetItemResult> (() => {
var targetPath = Path.GetFullPath (Path.Combine (
MessagingContext.GetBuildPath (),
message.AppName,
message.SessionId,
PlatformPath.GetPathForCurrentPlatform (message.ItemSpec)));
var result = new GetItemResult ();
if (File.Exists (targetPath)) {
result.FileExists = true;
// Avoiding sending the payload if the file is too large based on the defined limit by the the client
if (new System.IO.FileInfo (targetPath).Length > message.LimitLength)
result.FileLengthExceedsLimit = true;
else
result.Content = File.ReadAllBytes (targetPath);
}
return result;
}).ConfigureAwait (continueOnCapturedContext: false);
}
}
}

Просмотреть файл

@ -0,0 +1,62 @@
using System.Diagnostics;
using System.IO;
using System.Text;
using System.Text.RegularExpressions;
using System.Threading.Tasks;
using Xamarin.Messaging.Build.Contracts;
using Xamarin.Messaging.Client;
//TODO: Move the logic to MacDev so it can be shared and reused by the IDB Message Handler as well
namespace Xamarin.Messaging.Build {
public class GetUniversalTargetIdentifierMessageHandler : RequestHandler<GetUniversalTypeIdentifierMessage, GetUniversalTypeIdentifierResult> {
protected override async Task<GetUniversalTypeIdentifierResult> ExecuteAsync (GetUniversalTypeIdentifierMessage message)
{
return await Task.Run (() => {
var response = new GetUniversalTypeIdentifierResult ();
var tempFilePath = Path.Combine (Path.GetTempPath (), message.FileName);
File.WriteAllBytes (tempFilePath, message.Payload);
response.UniversalTypeIdentifier = GetUniversalTypeIdentifier (tempFilePath);
return response;
}).ConfigureAwait (continueOnCapturedContext: false);
}
string GetUniversalTypeIdentifier (string filePath)
{
var expression = new Regex ("kMDItemContentType = \"(?<UTI>[^,]+)\"");
var stdout = new StringBuilder ();
if (File.Exists (filePath)) {
var startInfo = new ProcessStartInfo ();
startInfo.WindowStyle = ProcessWindowStyle.Hidden;
startInfo.FileName = "/usr/bin/mdls";
startInfo.Arguments = string.Format ("\"{0}\" -name kMDItemContentType", filePath);
startInfo.RedirectStandardOutput = true;
startInfo.UseShellExecute = false;
var proc = new Process ();
proc.StartInfo = startInfo;
proc.OutputDataReceived += (sender, e) => {
stdout.AppendLine (e.Data);
};
proc.Start ();
proc.BeginOutputReadLine ();
proc.WaitForExit ();
}
var match = expression.Match (stdout.ToString ());
if (match.Success) {
if (match.Groups.Count > 1)
return match.Groups [1].Value;
}
return string.Empty;
}
}
}

Просмотреть файл

@ -0,0 +1,39 @@
using System;
using Xamarin.Messaging.Client;
using System.Threading.Tasks;
using Xamarin.MacDev;
using Xamarin.Messaging.Build.Contracts;
namespace Xamarin.Messaging.Build {
public class VerifyXcodeVersionMessageHandler : RequestHandler<VerifyXcodeVersionMessage, VerifyXcodeVersionResult> {
protected override Task<VerifyXcodeVersionResult> ExecuteAsync (VerifyXcodeVersionMessage message)
{
var result = new VerifyXcodeVersionResult ();
try {
var xcodeVersion = AppleSdkSettings.XcodeVersion;
var recommendedXcodeVersion = GetRecommendedXcodeVersion ();
result.IsCompatibleVersion = xcodeVersion >= recommendedXcodeVersion;
result.XcodeVersion = xcodeVersion.ToString ();
result.RecommendedXcodeVersion = recommendedXcodeVersion.ToString ();
} catch {
result.IsCompatibleVersion = false;
}
return Task.FromResult (result);
}
Version GetRecommendedXcodeVersion ()
{
var monoTouchSdk = GetMonoTouchSdk ();
return monoTouchSdk == null ? new Version (0, 0) : monoTouchSdk?.RecommendedXcodeVersion;
}
MonoTouchSdk GetMonoTouchSdk ()
{
return Sdks.XamIOS;
}
}
}

Просмотреть файл

@ -0,0 +1,7 @@
using Xamarin.Messaging.Build.Contracts;
namespace Xamarin.Messaging.Build {
public interface ITaskRunner {
ExecuteTaskResult Execute (string taskName, string inputs);
}
}

Просмотреть файл

@ -0,0 +1,16 @@
using System.Threading.Tasks;
using Xamarin.Messaging.Client;
namespace Xamarin.Messaging.Build {
class Program {
static async Task Main (string [] args)
{
var topicGenerator = new TopicGenerator ();
var arguments = new AgentArgumentsParser ().ParseArguments (args);
var agent = new BuildAgent (topicGenerator, arguments.Version, arguments.VersionInfo);
var runner = new AgentConsoleRunner<BuildAgent> (agent, arguments);
await runner.RunAsync ().ConfigureAwait (continueOnCapturedContext: false);
}
}
}

Просмотреть файл

@ -0,0 +1,3 @@
using System.Runtime.CompilerServices;
[assembly: InternalsVisibleTo ("Xamarin.Messaging.UnitTests")]

Просмотреть файл

@ -0,0 +1,72 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.42000
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace Xamarin.Messaging.Build.Properties {
using System;
/// <summary>
/// A strongly-typed resource class, for looking up localized strings, etc.
/// </summary>
// This class was auto-generated by the StronglyTypedResourceBuilder
// class via a tool like ResGen or Visual Studio.
// To add or remove a member, edit your .ResX file then rerun ResGen
// with the /str option, or rebuild your VS project.
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
internal class Resources {
private static global::System.Resources.ResourceManager resourceMan;
private static global::System.Globalization.CultureInfo resourceCulture;
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
internal Resources() {
}
/// <summary>
/// Returns the cached ResourceManager instance used by this class.
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Resources.ResourceManager ResourceManager {
get {
if (object.ReferenceEquals(resourceMan, null)) {
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Xamarin.Messaging.Build.Properties.Resources", typeof(Resources).Assembly);
resourceMan = temp;
}
return resourceMan;
}
}
/// <summary>
/// Overrides the current thread's CurrentUICulture property for all
/// resource lookups using this strongly typed resource class.
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Globalization.CultureInfo Culture {
get {
return resourceCulture;
}
set {
resourceCulture = value;
}
}
/// <summary>
/// Looks up a localized string similar to Task not found for &apos;{0}&apos;.
/// </summary>
internal static string TaskRunner_Execute_Error {
get {
return ResourceManager.GetString("TaskRunner_Execute_Error", resourceCulture);
}
}
}
}

Просмотреть файл

@ -0,0 +1,123 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<data name="TaskRunner_Execute_Error" xml:space="preserve">
<value>Task not found for '{0}'</value>
</data>
</root>

Просмотреть файл

@ -0,0 +1,51 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using Microsoft.Build.Utilities;
using Xamarin.Messaging.Build.Contracts;
using Xamarin.Messaging.Build.Properties;
using Xamarin.Messaging.Build.Serialization;
namespace Xamarin.Messaging.Build {
internal class TaskRunner : ITaskRunner {
ITaskSerializer serializer;
List<Type> tasks = new List<Type> ();
internal TaskRunner (ITaskSerializer serializer)
{
this.serializer = serializer;
// TODO: Needed by the ILLinkTask, we need to add support for doing this from Windows
Environment.SetEnvironmentVariable ("DOTNET_HOST_PATH", "/usr/local/share/dotnet/dotnet");
}
internal IEnumerable<Type> Tasks => tasks.AsReadOnly ();
internal void LoadTasks (Assembly assembly) => tasks.AddRange (assembly.GetTypes ());
internal void LoadXamarinTasks () => LoadTasks (typeof (iOS.Tasks.CompileAppManifest).Assembly);
public ExecuteTaskResult Execute (string taskName, string inputs)
{
var taskType = tasks.FirstOrDefault (x => string.Equals (x.FullName, taskName, StringComparison.OrdinalIgnoreCase));
if (taskType == null) {
throw new ArgumentException (string.Format (Resources.TaskRunner_Execute_Error, taskName), nameof (taskName));
}
var task = serializer.Deserialize (inputs, taskType) as Task;
var buildEngine = new BuildEngine ();
task.BuildEngine = buildEngine;
var result = new ExecuteTaskResult ();
result.Result = task.Execute ();
result.Output = serializer.SerializeOutputs (task);
result.LogEntries = buildEngine.LogEntries;
return result;
}
}
}

Просмотреть файл

@ -0,0 +1,64 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net472</TargetFramework>
<OutputType>Exe</OutputType>
<AssemblyName>Build</AssemblyName>
</PropertyGroup>
<PropertyGroup Label="Messaging">
<AgentId>Build</AgentId>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="System.IO.Abstractions" Version="6.0.27" />
<PackageReference Include="Mono.Cecil" Version="0.11.1" />
<PackageReference Include="GitInfo" Version="2.1.2" />
<!-- We only include build assets to get targets related to agent generation, the assemblies come from Xamarin.iOS.Tasks -->
<PackageReference Include="Xamarin.Messaging.Core" Version="$(MessagingVersion)" IncludeAssets="build" />
</ItemGroup>
<ItemGroup>
<Reference Include="Microsoft.Build">
<HintPath>$(MSBuildBinPath)/Microsoft.Build.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Build.Framework">
<HintPath>$(MSBuildBinPath)/Microsoft.Build.Framework.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Build.Tasks.Core">
<HintPath>$(MSBuildBinPath)/Microsoft.Build.Tasks.Core.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Build.Utilities.Core">
<HintPath>$(MSBuildBinPath)/Microsoft.Build.Utilities.Core.dll</HintPath>
</Reference>
</ItemGroup>
<ItemGroup>
<Compile Update="Properties\Resources.Designer.cs">
<AutoGen>True</AutoGen>
<DesignTime>True</DesignTime>
<DependentUpon>Resources.resx</DependentUpon>
</Compile>
</ItemGroup>
<ItemGroup>
<EmbeddedResource Update="Properties\Resources.resx">
<Generator>ResXFileCodeGenerator</Generator>
<SubType>Designer</SubType>
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
</EmbeddedResource>
</ItemGroup>
<ItemGroup>
<!-- The iOS.Tasks assembly was ILRepacked to include MacDev.Tasks, if we use the references from the project we'get both and the types will collide -->
<!-- We still need the project reference to mantain the build order dependency, but we add a reference to the assembly explicitly -->
<ProjectReference Include="..\..\Xamarin.iOS.Tasks\Xamarin.iOS.Tasks.csproj">
<ReferenceOutputAssembly>False</ReferenceOutputAssembly>
<Private>False</Private>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<Reference Include="Xamarin.iOS.Tasks">
<HintPath>..\..\Xamarin.iOS.Tasks\bin\$(Configuration)\netstandard2.0\Xamarin.iOS.Tasks.dll</HintPath>
</Reference>
</ItemGroup>
</Project>

Просмотреть файл

@ -0,0 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<!-- We can't sign this assembly until all dependencies are signed too -->
<SignAssembly>false</SignAssembly>
</PropertyGroup>
</Project>

Просмотреть файл

@ -0,0 +1 @@
E5DA2AA8-608B-4612-B213-8D42DDDD3633B8885AB3-477A-4A94-9291-F8C1F41E05EB

Просмотреть файл

@ -952,13 +952,73 @@ namespace Xamarin.Localization.MSBuild {
return ResourceManager.GetString("E0175", resourceCulture);
}
}
public static string W0176 {
get {
return ResourceManager.GetString("W0176", resourceCulture);
}
}
public static string E0177 {
get {
return ResourceManager.GetString("E0177", resourceCulture);
}
}
public static string E0178 {
get {
return ResourceManager.GetString("E0178", resourceCulture);
}
}
public static string E0179 {
get {
return ResourceManager.GetString("E0179", resourceCulture);
}
}
public static string E0180 {
get {
return ResourceManager.GetString("E0180", resourceCulture);
}
}
public static string E0181 {
get {
return ResourceManager.GetString("E0181", resourceCulture);
}
}
public static string E0182 {
get {
return ResourceManager.GetString("E0182", resourceCulture);
}
}
public static string E0183 {
get {
return ResourceManager.GetString("E0183", resourceCulture);
}
}
public static string E0184 {
get {
return ResourceManager.GetString("E0184", resourceCulture);
}
}
public static string E0185 {
get {
return ResourceManager.GetString("E0185", resourceCulture);
}
}
public static string E0186 {
get {
return ResourceManager.GetString("E0186", resourceCulture);
}
}
public static string E7001 {
get {
return ResourceManager.GetString("E7001", resourceCulture);

Просмотреть файл

@ -839,6 +839,47 @@
</value>
</data>
<data name="E0177" xml:space="preserve">
<value>Can't get an ISshCommands instance. Please check that a valid connection to the Mac is established.</value>
</data>
<data name="E0178" xml:space="preserve">
<value>An error occurred while trying to copy Archive '{0}' to '{1}'. Details: {2}</value>
</data>
<data name="E0179" xml:space="preserve">
<value>There is no available connection to the Mac. Task '{0}' will not be executed</value>
</data>
<data name="E0180" xml:space="preserve">
<value>Could not deserialize DataSet {0}</value>
</data>
<data name="E0181" xml:space="preserve">
<value>The file {0} does not have ImageAsset as build action.</value>
</data>
<data name="E0182" xml:space="preserve">
<value>Could not resolve UTI for {0} in catalog {1}</value>
</data>
<data name="E0183" xml:space="preserve">
<value>An error occurred while trying to verify the compatibility between Xcode and Xamarin.iOS</value>
</data>
<data name="E0184" xml:space="preserve">
<value>The project was built with a version of Xcode ({0}) that is not compatible which may result in unexpected warnings or errors. Please install Xcode '{1}' or visit the documentation to learn more.</value>
</data>
<data name="E0185" xml:space="preserve">
<value>An error occurred while trying to verify the compatibility between Xcode and Xamarin.iOS. Details: {0}
</value>
</data>
<data name="E0186" xml:space="preserve">
<value>The provided Archive Path is not from a valid archive file (.xcarchive). Archive Path: '{0}'</value>
</data>
<data name="E7001" xml:space="preserve">
<value>Could not resolve host IPs for WiFi debugger settings.
</value>

Просмотреть файл

@ -677,6 +677,58 @@
</target>
<note />
</trans-unit>
<trans-unit id="E0177">
<source>Can't get an ISshCommands instance. Please check that a valid connection to the Mac is established.</source>
<target state="new">Can't get an ISshCommands instance. Please check that a valid connection to the Mac is established.</target>
<note />
</trans-unit>
<trans-unit id="E0178">
<source>An error occurred while trying to copy Archive '{0}' to '{1}'. Details: {2}</source>
<target state="new">An error occurred while trying to copy Archive '{0}' to '{1}'. Details: {2}</target>
<note />
</trans-unit>
<trans-unit id="E0179">
<source>There is no available connection to the Mac. Task '{0}' will not be executed</source>
<target state="new">There is no available connection to the Mac. Task '{0}' will not be executed</target>
<note />
</trans-unit>
<trans-unit id="E0180">
<source>Could not deserialize DataSet {0}</source>
<target state="new">Could not deserialize DataSet {0}</target>
<note />
</trans-unit>
<trans-unit id="E0181">
<source>The file {0} does not have ImageAsset as build action.</source>
<target state="new">The file {0} does not have ImageAsset as build action.</target>
<note />
</trans-unit>
<trans-unit id="E0182">
<source>Could not resolve UTI for {0} in catalog {1}</source>
<target state="new">Could not resolve UTI for {0} in catalog {1}</target>
<note />
</trans-unit>
<trans-unit id="E0183">
<source>An error occurred while trying to verify the compatibility between Xcode and Xamarin.iOS</source>
<target state="new">An error occurred while trying to verify the compatibility between Xcode and Xamarin.iOS</target>
<note />
</trans-unit>
<trans-unit id="E0184">
<source>The project was built with a version of Xcode ({0}) that is not compatible which may result in unexpected warnings or errors. Please install Xcode '{1}' or visit the documentation to learn more.</source>
<target state="new">The project was built with a version of Xcode ({0}) that is not compatible which may result in unexpected warnings or errors. Please install Xcode '{1}' or visit the documentation to learn more.</target>
<note />
</trans-unit>
<trans-unit id="E0185">
<source>An error occurred while trying to verify the compatibility between Xcode and Xamarin.iOS. Details: {0}
</source>
<target state="new">An error occurred while trying to verify the compatibility between Xcode and Xamarin.iOS. Details: {0}
</target>
<note />
</trans-unit>
<trans-unit id="E0186">
<source>The provided Archive Path is not from a valid archive file (.xcarchive). Archive Path: '{0}'</source>
<target state="new">The provided Archive Path is not from a valid archive file (.xcarchive). Archive Path: '{0}'</target>
<note />
</trans-unit>
<trans-unit id="E7001">
<source>Could not resolve host IPs for WiFi debugger settings.
</source>

Просмотреть файл

@ -677,6 +677,58 @@
</target>
<note />
</trans-unit>
<trans-unit id="E0177">
<source>Can't get an ISshCommands instance. Please check that a valid connection to the Mac is established.</source>
<target state="new">Can't get an ISshCommands instance. Please check that a valid connection to the Mac is established.</target>
<note />
</trans-unit>
<trans-unit id="E0178">
<source>An error occurred while trying to copy Archive '{0}' to '{1}'. Details: {2}</source>
<target state="new">An error occurred while trying to copy Archive '{0}' to '{1}'. Details: {2}</target>
<note />
</trans-unit>
<trans-unit id="E0179">
<source>There is no available connection to the Mac. Task '{0}' will not be executed</source>
<target state="new">There is no available connection to the Mac. Task '{0}' will not be executed</target>
<note />
</trans-unit>
<trans-unit id="E0180">
<source>Could not deserialize DataSet {0}</source>
<target state="new">Could not deserialize DataSet {0}</target>
<note />
</trans-unit>
<trans-unit id="E0181">
<source>The file {0} does not have ImageAsset as build action.</source>
<target state="new">The file {0} does not have ImageAsset as build action.</target>
<note />
</trans-unit>
<trans-unit id="E0182">
<source>Could not resolve UTI for {0} in catalog {1}</source>
<target state="new">Could not resolve UTI for {0} in catalog {1}</target>
<note />
</trans-unit>
<trans-unit id="E0183">
<source>An error occurred while trying to verify the compatibility between Xcode and Xamarin.iOS</source>
<target state="new">An error occurred while trying to verify the compatibility between Xcode and Xamarin.iOS</target>
<note />
</trans-unit>
<trans-unit id="E0184">
<source>The project was built with a version of Xcode ({0}) that is not compatible which may result in unexpected warnings or errors. Please install Xcode '{1}' or visit the documentation to learn more.</source>
<target state="new">The project was built with a version of Xcode ({0}) that is not compatible which may result in unexpected warnings or errors. Please install Xcode '{1}' or visit the documentation to learn more.</target>
<note />
</trans-unit>
<trans-unit id="E0185">
<source>An error occurred while trying to verify the compatibility between Xcode and Xamarin.iOS. Details: {0}
</source>
<target state="new">An error occurred while trying to verify the compatibility between Xcode and Xamarin.iOS. Details: {0}
</target>
<note />
</trans-unit>
<trans-unit id="E0186">
<source>The provided Archive Path is not from a valid archive file (.xcarchive). Archive Path: '{0}'</source>
<target state="new">The provided Archive Path is not from a valid archive file (.xcarchive). Archive Path: '{0}'</target>
<note />
</trans-unit>
<trans-unit id="E7001">
<source>Could not resolve host IPs for WiFi debugger settings.
</source>

Просмотреть файл

@ -677,6 +677,58 @@
</target>
<note />
</trans-unit>
<trans-unit id="E0177">
<source>Can't get an ISshCommands instance. Please check that a valid connection to the Mac is established.</source>
<target state="new">Can't get an ISshCommands instance. Please check that a valid connection to the Mac is established.</target>
<note />
</trans-unit>
<trans-unit id="E0178">
<source>An error occurred while trying to copy Archive '{0}' to '{1}'. Details: {2}</source>
<target state="new">An error occurred while trying to copy Archive '{0}' to '{1}'. Details: {2}</target>
<note />
</trans-unit>
<trans-unit id="E0179">
<source>There is no available connection to the Mac. Task '{0}' will not be executed</source>
<target state="new">There is no available connection to the Mac. Task '{0}' will not be executed</target>
<note />
</trans-unit>
<trans-unit id="E0180">
<source>Could not deserialize DataSet {0}</source>
<target state="new">Could not deserialize DataSet {0}</target>
<note />
</trans-unit>
<trans-unit id="E0181">
<source>The file {0} does not have ImageAsset as build action.</source>
<target state="new">The file {0} does not have ImageAsset as build action.</target>
<note />
</trans-unit>
<trans-unit id="E0182">
<source>Could not resolve UTI for {0} in catalog {1}</source>
<target state="new">Could not resolve UTI for {0} in catalog {1}</target>
<note />
</trans-unit>
<trans-unit id="E0183">
<source>An error occurred while trying to verify the compatibility between Xcode and Xamarin.iOS</source>
<target state="new">An error occurred while trying to verify the compatibility between Xcode and Xamarin.iOS</target>
<note />
</trans-unit>
<trans-unit id="E0184">
<source>The project was built with a version of Xcode ({0}) that is not compatible which may result in unexpected warnings or errors. Please install Xcode '{1}' or visit the documentation to learn more.</source>
<target state="new">The project was built with a version of Xcode ({0}) that is not compatible which may result in unexpected warnings or errors. Please install Xcode '{1}' or visit the documentation to learn more.</target>
<note />
</trans-unit>
<trans-unit id="E0185">
<source>An error occurred while trying to verify the compatibility between Xcode and Xamarin.iOS. Details: {0}
</source>
<target state="new">An error occurred while trying to verify the compatibility between Xcode and Xamarin.iOS. Details: {0}
</target>
<note />
</trans-unit>
<trans-unit id="E0186">
<source>The provided Archive Path is not from a valid archive file (.xcarchive). Archive Path: '{0}'</source>
<target state="new">The provided Archive Path is not from a valid archive file (.xcarchive). Archive Path: '{0}'</target>
<note />
</trans-unit>
<trans-unit id="E7001">
<source>Could not resolve host IPs for WiFi debugger settings.
</source>

Просмотреть файл

@ -677,6 +677,58 @@
</target>
<note />
</trans-unit>
<trans-unit id="E0177">
<source>Can't get an ISshCommands instance. Please check that a valid connection to the Mac is established.</source>
<target state="new">Can't get an ISshCommands instance. Please check that a valid connection to the Mac is established.</target>
<note />
</trans-unit>
<trans-unit id="E0178">
<source>An error occurred while trying to copy Archive '{0}' to '{1}'. Details: {2}</source>
<target state="new">An error occurred while trying to copy Archive '{0}' to '{1}'. Details: {2}</target>
<note />
</trans-unit>
<trans-unit id="E0179">
<source>There is no available connection to the Mac. Task '{0}' will not be executed</source>
<target state="new">There is no available connection to the Mac. Task '{0}' will not be executed</target>
<note />
</trans-unit>
<trans-unit id="E0180">
<source>Could not deserialize DataSet {0}</source>
<target state="new">Could not deserialize DataSet {0}</target>
<note />
</trans-unit>
<trans-unit id="E0181">
<source>The file {0} does not have ImageAsset as build action.</source>
<target state="new">The file {0} does not have ImageAsset as build action.</target>
<note />
</trans-unit>
<trans-unit id="E0182">
<source>Could not resolve UTI for {0} in catalog {1}</source>
<target state="new">Could not resolve UTI for {0} in catalog {1}</target>
<note />
</trans-unit>
<trans-unit id="E0183">
<source>An error occurred while trying to verify the compatibility between Xcode and Xamarin.iOS</source>
<target state="new">An error occurred while trying to verify the compatibility between Xcode and Xamarin.iOS</target>
<note />
</trans-unit>
<trans-unit id="E0184">
<source>The project was built with a version of Xcode ({0}) that is not compatible which may result in unexpected warnings or errors. Please install Xcode '{1}' or visit the documentation to learn more.</source>
<target state="new">The project was built with a version of Xcode ({0}) that is not compatible which may result in unexpected warnings or errors. Please install Xcode '{1}' or visit the documentation to learn more.</target>
<note />
</trans-unit>
<trans-unit id="E0185">
<source>An error occurred while trying to verify the compatibility between Xcode and Xamarin.iOS. Details: {0}
</source>
<target state="new">An error occurred while trying to verify the compatibility between Xcode and Xamarin.iOS. Details: {0}
</target>
<note />
</trans-unit>
<trans-unit id="E0186">
<source>The provided Archive Path is not from a valid archive file (.xcarchive). Archive Path: '{0}'</source>
<target state="new">The provided Archive Path is not from a valid archive file (.xcarchive). Archive Path: '{0}'</target>
<note />
</trans-unit>
<trans-unit id="E7001">
<source>Could not resolve host IPs for WiFi debugger settings.
</source>

Просмотреть файл

@ -677,6 +677,58 @@
</target>
<note />
</trans-unit>
<trans-unit id="E0177">
<source>Can't get an ISshCommands instance. Please check that a valid connection to the Mac is established.</source>
<target state="new">Can't get an ISshCommands instance. Please check that a valid connection to the Mac is established.</target>
<note />
</trans-unit>
<trans-unit id="E0178">
<source>An error occurred while trying to copy Archive '{0}' to '{1}'. Details: {2}</source>
<target state="new">An error occurred while trying to copy Archive '{0}' to '{1}'. Details: {2}</target>
<note />
</trans-unit>
<trans-unit id="E0179">
<source>There is no available connection to the Mac. Task '{0}' will not be executed</source>
<target state="new">There is no available connection to the Mac. Task '{0}' will not be executed</target>
<note />
</trans-unit>
<trans-unit id="E0180">
<source>Could not deserialize DataSet {0}</source>
<target state="new">Could not deserialize DataSet {0}</target>
<note />
</trans-unit>
<trans-unit id="E0181">
<source>The file {0} does not have ImageAsset as build action.</source>
<target state="new">The file {0} does not have ImageAsset as build action.</target>
<note />
</trans-unit>
<trans-unit id="E0182">
<source>Could not resolve UTI for {0} in catalog {1}</source>
<target state="new">Could not resolve UTI for {0} in catalog {1}</target>
<note />
</trans-unit>
<trans-unit id="E0183">
<source>An error occurred while trying to verify the compatibility between Xcode and Xamarin.iOS</source>
<target state="new">An error occurred while trying to verify the compatibility between Xcode and Xamarin.iOS</target>
<note />
</trans-unit>
<trans-unit id="E0184">
<source>The project was built with a version of Xcode ({0}) that is not compatible which may result in unexpected warnings or errors. Please install Xcode '{1}' or visit the documentation to learn more.</source>
<target state="new">The project was built with a version of Xcode ({0}) that is not compatible which may result in unexpected warnings or errors. Please install Xcode '{1}' or visit the documentation to learn more.</target>
<note />
</trans-unit>
<trans-unit id="E0185">
<source>An error occurred while trying to verify the compatibility between Xcode and Xamarin.iOS. Details: {0}
</source>
<target state="new">An error occurred while trying to verify the compatibility between Xcode and Xamarin.iOS. Details: {0}
</target>
<note />
</trans-unit>
<trans-unit id="E0186">
<source>The provided Archive Path is not from a valid archive file (.xcarchive). Archive Path: '{0}'</source>
<target state="new">The provided Archive Path is not from a valid archive file (.xcarchive). Archive Path: '{0}'</target>
<note />
</trans-unit>
<trans-unit id="E7001">
<source>Could not resolve host IPs for WiFi debugger settings.
</source>

Просмотреть файл

@ -677,6 +677,58 @@
</target>
<note />
</trans-unit>
<trans-unit id="E0177">
<source>Can't get an ISshCommands instance. Please check that a valid connection to the Mac is established.</source>
<target state="new">Can't get an ISshCommands instance. Please check that a valid connection to the Mac is established.</target>
<note />
</trans-unit>
<trans-unit id="E0178">
<source>An error occurred while trying to copy Archive '{0}' to '{1}'. Details: {2}</source>
<target state="new">An error occurred while trying to copy Archive '{0}' to '{1}'. Details: {2}</target>
<note />
</trans-unit>
<trans-unit id="E0179">
<source>There is no available connection to the Mac. Task '{0}' will not be executed</source>
<target state="new">There is no available connection to the Mac. Task '{0}' will not be executed</target>
<note />
</trans-unit>
<trans-unit id="E0180">
<source>Could not deserialize DataSet {0}</source>
<target state="new">Could not deserialize DataSet {0}</target>
<note />
</trans-unit>
<trans-unit id="E0181">
<source>The file {0} does not have ImageAsset as build action.</source>
<target state="new">The file {0} does not have ImageAsset as build action.</target>
<note />
</trans-unit>
<trans-unit id="E0182">
<source>Could not resolve UTI for {0} in catalog {1}</source>
<target state="new">Could not resolve UTI for {0} in catalog {1}</target>
<note />
</trans-unit>
<trans-unit id="E0183">
<source>An error occurred while trying to verify the compatibility between Xcode and Xamarin.iOS</source>
<target state="new">An error occurred while trying to verify the compatibility between Xcode and Xamarin.iOS</target>
<note />
</trans-unit>
<trans-unit id="E0184">
<source>The project was built with a version of Xcode ({0}) that is not compatible which may result in unexpected warnings or errors. Please install Xcode '{1}' or visit the documentation to learn more.</source>
<target state="new">The project was built with a version of Xcode ({0}) that is not compatible which may result in unexpected warnings or errors. Please install Xcode '{1}' or visit the documentation to learn more.</target>
<note />
</trans-unit>
<trans-unit id="E0185">
<source>An error occurred while trying to verify the compatibility between Xcode and Xamarin.iOS. Details: {0}
</source>
<target state="new">An error occurred while trying to verify the compatibility between Xcode and Xamarin.iOS. Details: {0}
</target>
<note />
</trans-unit>
<trans-unit id="E0186">
<source>The provided Archive Path is not from a valid archive file (.xcarchive). Archive Path: '{0}'</source>
<target state="new">The provided Archive Path is not from a valid archive file (.xcarchive). Archive Path: '{0}'</target>
<note />
</trans-unit>
<trans-unit id="E7001">
<source>Could not resolve host IPs for WiFi debugger settings.
</source>

Просмотреть файл

@ -677,6 +677,58 @@
</target>
<note />
</trans-unit>
<trans-unit id="E0177">
<source>Can't get an ISshCommands instance. Please check that a valid connection to the Mac is established.</source>
<target state="new">Can't get an ISshCommands instance. Please check that a valid connection to the Mac is established.</target>
<note />
</trans-unit>
<trans-unit id="E0178">
<source>An error occurred while trying to copy Archive '{0}' to '{1}'. Details: {2}</source>
<target state="new">An error occurred while trying to copy Archive '{0}' to '{1}'. Details: {2}</target>
<note />
</trans-unit>
<trans-unit id="E0179">
<source>There is no available connection to the Mac. Task '{0}' will not be executed</source>
<target state="new">There is no available connection to the Mac. Task '{0}' will not be executed</target>
<note />
</trans-unit>
<trans-unit id="E0180">
<source>Could not deserialize DataSet {0}</source>
<target state="new">Could not deserialize DataSet {0}</target>
<note />
</trans-unit>
<trans-unit id="E0181">
<source>The file {0} does not have ImageAsset as build action.</source>
<target state="new">The file {0} does not have ImageAsset as build action.</target>
<note />
</trans-unit>
<trans-unit id="E0182">
<source>Could not resolve UTI for {0} in catalog {1}</source>
<target state="new">Could not resolve UTI for {0} in catalog {1}</target>
<note />
</trans-unit>
<trans-unit id="E0183">
<source>An error occurred while trying to verify the compatibility between Xcode and Xamarin.iOS</source>
<target state="new">An error occurred while trying to verify the compatibility between Xcode and Xamarin.iOS</target>
<note />
</trans-unit>
<trans-unit id="E0184">
<source>The project was built with a version of Xcode ({0}) that is not compatible which may result in unexpected warnings or errors. Please install Xcode '{1}' or visit the documentation to learn more.</source>
<target state="new">The project was built with a version of Xcode ({0}) that is not compatible which may result in unexpected warnings or errors. Please install Xcode '{1}' or visit the documentation to learn more.</target>
<note />
</trans-unit>
<trans-unit id="E0185">
<source>An error occurred while trying to verify the compatibility between Xcode and Xamarin.iOS. Details: {0}
</source>
<target state="new">An error occurred while trying to verify the compatibility between Xcode and Xamarin.iOS. Details: {0}
</target>
<note />
</trans-unit>
<trans-unit id="E0186">
<source>The provided Archive Path is not from a valid archive file (.xcarchive). Archive Path: '{0}'</source>
<target state="new">The provided Archive Path is not from a valid archive file (.xcarchive). Archive Path: '{0}'</target>
<note />
</trans-unit>
<trans-unit id="E7001">
<source>Could not resolve host IPs for WiFi debugger settings.
</source>

Просмотреть файл

@ -677,6 +677,58 @@
</target>
<note />
</trans-unit>
<trans-unit id="E0177">
<source>Can't get an ISshCommands instance. Please check that a valid connection to the Mac is established.</source>
<target state="new">Can't get an ISshCommands instance. Please check that a valid connection to the Mac is established.</target>
<note />
</trans-unit>
<trans-unit id="E0178">
<source>An error occurred while trying to copy Archive '{0}' to '{1}'. Details: {2}</source>
<target state="new">An error occurred while trying to copy Archive '{0}' to '{1}'. Details: {2}</target>
<note />
</trans-unit>
<trans-unit id="E0179">
<source>There is no available connection to the Mac. Task '{0}' will not be executed</source>
<target state="new">There is no available connection to the Mac. Task '{0}' will not be executed</target>
<note />
</trans-unit>
<trans-unit id="E0180">
<source>Could not deserialize DataSet {0}</source>
<target state="new">Could not deserialize DataSet {0}</target>
<note />
</trans-unit>
<trans-unit id="E0181">
<source>The file {0} does not have ImageAsset as build action.</source>
<target state="new">The file {0} does not have ImageAsset as build action.</target>
<note />
</trans-unit>
<trans-unit id="E0182">
<source>Could not resolve UTI for {0} in catalog {1}</source>
<target state="new">Could not resolve UTI for {0} in catalog {1}</target>
<note />
</trans-unit>
<trans-unit id="E0183">
<source>An error occurred while trying to verify the compatibility between Xcode and Xamarin.iOS</source>
<target state="new">An error occurred while trying to verify the compatibility between Xcode and Xamarin.iOS</target>
<note />
</trans-unit>
<trans-unit id="E0184">
<source>The project was built with a version of Xcode ({0}) that is not compatible which may result in unexpected warnings or errors. Please install Xcode '{1}' or visit the documentation to learn more.</source>
<target state="new">The project was built with a version of Xcode ({0}) that is not compatible which may result in unexpected warnings or errors. Please install Xcode '{1}' or visit the documentation to learn more.</target>
<note />
</trans-unit>
<trans-unit id="E0185">
<source>An error occurred while trying to verify the compatibility between Xcode and Xamarin.iOS. Details: {0}
</source>
<target state="new">An error occurred while trying to verify the compatibility between Xcode and Xamarin.iOS. Details: {0}
</target>
<note />
</trans-unit>
<trans-unit id="E0186">
<source>The provided Archive Path is not from a valid archive file (.xcarchive). Archive Path: '{0}'</source>
<target state="new">The provided Archive Path is not from a valid archive file (.xcarchive). Archive Path: '{0}'</target>
<note />
</trans-unit>
<trans-unit id="E7001">
<source>Could not resolve host IPs for WiFi debugger settings.
</source>

Просмотреть файл

@ -677,6 +677,58 @@
</target>
<note />
</trans-unit>
<trans-unit id="E0177">
<source>Can't get an ISshCommands instance. Please check that a valid connection to the Mac is established.</source>
<target state="new">Can't get an ISshCommands instance. Please check that a valid connection to the Mac is established.</target>
<note />
</trans-unit>
<trans-unit id="E0178">
<source>An error occurred while trying to copy Archive '{0}' to '{1}'. Details: {2}</source>
<target state="new">An error occurred while trying to copy Archive '{0}' to '{1}'. Details: {2}</target>
<note />
</trans-unit>
<trans-unit id="E0179">
<source>There is no available connection to the Mac. Task '{0}' will not be executed</source>
<target state="new">There is no available connection to the Mac. Task '{0}' will not be executed</target>
<note />
</trans-unit>
<trans-unit id="E0180">
<source>Could not deserialize DataSet {0}</source>
<target state="new">Could not deserialize DataSet {0}</target>
<note />
</trans-unit>
<trans-unit id="E0181">
<source>The file {0} does not have ImageAsset as build action.</source>
<target state="new">The file {0} does not have ImageAsset as build action.</target>
<note />
</trans-unit>
<trans-unit id="E0182">
<source>Could not resolve UTI for {0} in catalog {1}</source>
<target state="new">Could not resolve UTI for {0} in catalog {1}</target>
<note />
</trans-unit>
<trans-unit id="E0183">
<source>An error occurred while trying to verify the compatibility between Xcode and Xamarin.iOS</source>
<target state="new">An error occurred while trying to verify the compatibility between Xcode and Xamarin.iOS</target>
<note />
</trans-unit>
<trans-unit id="E0184">
<source>The project was built with a version of Xcode ({0}) that is not compatible which may result in unexpected warnings or errors. Please install Xcode '{1}' or visit the documentation to learn more.</source>
<target state="new">The project was built with a version of Xcode ({0}) that is not compatible which may result in unexpected warnings or errors. Please install Xcode '{1}' or visit the documentation to learn more.</target>
<note />
</trans-unit>
<trans-unit id="E0185">
<source>An error occurred while trying to verify the compatibility between Xcode and Xamarin.iOS. Details: {0}
</source>
<target state="new">An error occurred while trying to verify the compatibility between Xcode and Xamarin.iOS. Details: {0}
</target>
<note />
</trans-unit>
<trans-unit id="E0186">
<source>The provided Archive Path is not from a valid archive file (.xcarchive). Archive Path: '{0}'</source>
<target state="new">The provided Archive Path is not from a valid archive file (.xcarchive). Archive Path: '{0}'</target>
<note />
</trans-unit>
<trans-unit id="E7001">
<source>Could not resolve host IPs for WiFi debugger settings.
</source>

Просмотреть файл

@ -677,6 +677,58 @@
</target>
<note />
</trans-unit>
<trans-unit id="E0177">
<source>Can't get an ISshCommands instance. Please check that a valid connection to the Mac is established.</source>
<target state="new">Can't get an ISshCommands instance. Please check that a valid connection to the Mac is established.</target>
<note />
</trans-unit>
<trans-unit id="E0178">
<source>An error occurred while trying to copy Archive '{0}' to '{1}'. Details: {2}</source>
<target state="new">An error occurred while trying to copy Archive '{0}' to '{1}'. Details: {2}</target>
<note />
</trans-unit>
<trans-unit id="E0179">
<source>There is no available connection to the Mac. Task '{0}' will not be executed</source>
<target state="new">There is no available connection to the Mac. Task '{0}' will not be executed</target>
<note />
</trans-unit>
<trans-unit id="E0180">
<source>Could not deserialize DataSet {0}</source>
<target state="new">Could not deserialize DataSet {0}</target>
<note />
</trans-unit>
<trans-unit id="E0181">
<source>The file {0} does not have ImageAsset as build action.</source>
<target state="new">The file {0} does not have ImageAsset as build action.</target>
<note />
</trans-unit>
<trans-unit id="E0182">
<source>Could not resolve UTI for {0} in catalog {1}</source>
<target state="new">Could not resolve UTI for {0} in catalog {1}</target>
<note />
</trans-unit>
<trans-unit id="E0183">
<source>An error occurred while trying to verify the compatibility between Xcode and Xamarin.iOS</source>
<target state="new">An error occurred while trying to verify the compatibility between Xcode and Xamarin.iOS</target>
<note />
</trans-unit>
<trans-unit id="E0184">
<source>The project was built with a version of Xcode ({0}) that is not compatible which may result in unexpected warnings or errors. Please install Xcode '{1}' or visit the documentation to learn more.</source>
<target state="new">The project was built with a version of Xcode ({0}) that is not compatible which may result in unexpected warnings or errors. Please install Xcode '{1}' or visit the documentation to learn more.</target>
<note />
</trans-unit>
<trans-unit id="E0185">
<source>An error occurred while trying to verify the compatibility between Xcode and Xamarin.iOS. Details: {0}
</source>
<target state="new">An error occurred while trying to verify the compatibility between Xcode and Xamarin.iOS. Details: {0}
</target>
<note />
</trans-unit>
<trans-unit id="E0186">
<source>The provided Archive Path is not from a valid archive file (.xcarchive). Archive Path: '{0}'</source>
<target state="new">The provided Archive Path is not from a valid archive file (.xcarchive). Archive Path: '{0}'</target>
<note />
</trans-unit>
<trans-unit id="E7001">
<source>Could not resolve host IPs for WiFi debugger settings.
</source>

Просмотреть файл

@ -677,6 +677,58 @@
</target>
<note />
</trans-unit>
<trans-unit id="E0177">
<source>Can't get an ISshCommands instance. Please check that a valid connection to the Mac is established.</source>
<target state="new">Can't get an ISshCommands instance. Please check that a valid connection to the Mac is established.</target>
<note />
</trans-unit>
<trans-unit id="E0178">
<source>An error occurred while trying to copy Archive '{0}' to '{1}'. Details: {2}</source>
<target state="new">An error occurred while trying to copy Archive '{0}' to '{1}'. Details: {2}</target>
<note />
</trans-unit>
<trans-unit id="E0179">
<source>There is no available connection to the Mac. Task '{0}' will not be executed</source>
<target state="new">There is no available connection to the Mac. Task '{0}' will not be executed</target>
<note />
</trans-unit>
<trans-unit id="E0180">
<source>Could not deserialize DataSet {0}</source>
<target state="new">Could not deserialize DataSet {0}</target>
<note />
</trans-unit>
<trans-unit id="E0181">
<source>The file {0} does not have ImageAsset as build action.</source>
<target state="new">The file {0} does not have ImageAsset as build action.</target>
<note />
</trans-unit>
<trans-unit id="E0182">
<source>Could not resolve UTI for {0} in catalog {1}</source>
<target state="new">Could not resolve UTI for {0} in catalog {1}</target>
<note />
</trans-unit>
<trans-unit id="E0183">
<source>An error occurred while trying to verify the compatibility between Xcode and Xamarin.iOS</source>
<target state="new">An error occurred while trying to verify the compatibility between Xcode and Xamarin.iOS</target>
<note />
</trans-unit>
<trans-unit id="E0184">
<source>The project was built with a version of Xcode ({0}) that is not compatible which may result in unexpected warnings or errors. Please install Xcode '{1}' or visit the documentation to learn more.</source>
<target state="new">The project was built with a version of Xcode ({0}) that is not compatible which may result in unexpected warnings or errors. Please install Xcode '{1}' or visit the documentation to learn more.</target>
<note />
</trans-unit>
<trans-unit id="E0185">
<source>An error occurred while trying to verify the compatibility between Xcode and Xamarin.iOS. Details: {0}
</source>
<target state="new">An error occurred while trying to verify the compatibility between Xcode and Xamarin.iOS. Details: {0}
</target>
<note />
</trans-unit>
<trans-unit id="E0186">
<source>The provided Archive Path is not from a valid archive file (.xcarchive). Archive Path: '{0}'</source>
<target state="new">The provided Archive Path is not from a valid archive file (.xcarchive). Archive Path: '{0}'</target>
<note />
</trans-unit>
<trans-unit id="E7001">
<source>Could not resolve host IPs for WiFi debugger settings.
</source>

Просмотреть файл

@ -677,6 +677,58 @@
</target>
<note />
</trans-unit>
<trans-unit id="E0177">
<source>Can't get an ISshCommands instance. Please check that a valid connection to the Mac is established.</source>
<target state="new">Can't get an ISshCommands instance. Please check that a valid connection to the Mac is established.</target>
<note />
</trans-unit>
<trans-unit id="E0178">
<source>An error occurred while trying to copy Archive '{0}' to '{1}'. Details: {2}</source>
<target state="new">An error occurred while trying to copy Archive '{0}' to '{1}'. Details: {2}</target>
<note />
</trans-unit>
<trans-unit id="E0179">
<source>There is no available connection to the Mac. Task '{0}' will not be executed</source>
<target state="new">There is no available connection to the Mac. Task '{0}' will not be executed</target>
<note />
</trans-unit>
<trans-unit id="E0180">
<source>Could not deserialize DataSet {0}</source>
<target state="new">Could not deserialize DataSet {0}</target>
<note />
</trans-unit>
<trans-unit id="E0181">
<source>The file {0} does not have ImageAsset as build action.</source>
<target state="new">The file {0} does not have ImageAsset as build action.</target>
<note />
</trans-unit>
<trans-unit id="E0182">
<source>Could not resolve UTI for {0} in catalog {1}</source>
<target state="new">Could not resolve UTI for {0} in catalog {1}</target>
<note />
</trans-unit>
<trans-unit id="E0183">
<source>An error occurred while trying to verify the compatibility between Xcode and Xamarin.iOS</source>
<target state="new">An error occurred while trying to verify the compatibility between Xcode and Xamarin.iOS</target>
<note />
</trans-unit>
<trans-unit id="E0184">
<source>The project was built with a version of Xcode ({0}) that is not compatible which may result in unexpected warnings or errors. Please install Xcode '{1}' or visit the documentation to learn more.</source>
<target state="new">The project was built with a version of Xcode ({0}) that is not compatible which may result in unexpected warnings or errors. Please install Xcode '{1}' or visit the documentation to learn more.</target>
<note />
</trans-unit>
<trans-unit id="E0185">
<source>An error occurred while trying to verify the compatibility between Xcode and Xamarin.iOS. Details: {0}
</source>
<target state="new">An error occurred while trying to verify the compatibility between Xcode and Xamarin.iOS. Details: {0}
</target>
<note />
</trans-unit>
<trans-unit id="E0186">
<source>The provided Archive Path is not from a valid archive file (.xcarchive). Archive Path: '{0}'</source>
<target state="new">The provided Archive Path is not from a valid archive file (.xcarchive). Archive Path: '{0}'</target>
<note />
</trans-unit>
<trans-unit id="E7001">
<source>Could not resolve host IPs for WiFi debugger settings.
</source>

Просмотреть файл

@ -677,6 +677,58 @@
</target>
<note />
</trans-unit>
<trans-unit id="E0177">
<source>Can't get an ISshCommands instance. Please check that a valid connection to the Mac is established.</source>
<target state="new">Can't get an ISshCommands instance. Please check that a valid connection to the Mac is established.</target>
<note />
</trans-unit>
<trans-unit id="E0178">
<source>An error occurred while trying to copy Archive '{0}' to '{1}'. Details: {2}</source>
<target state="new">An error occurred while trying to copy Archive '{0}' to '{1}'. Details: {2}</target>
<note />
</trans-unit>
<trans-unit id="E0179">
<source>There is no available connection to the Mac. Task '{0}' will not be executed</source>
<target state="new">There is no available connection to the Mac. Task '{0}' will not be executed</target>
<note />
</trans-unit>
<trans-unit id="E0180">
<source>Could not deserialize DataSet {0}</source>
<target state="new">Could not deserialize DataSet {0}</target>
<note />
</trans-unit>
<trans-unit id="E0181">
<source>The file {0} does not have ImageAsset as build action.</source>
<target state="new">The file {0} does not have ImageAsset as build action.</target>
<note />
</trans-unit>
<trans-unit id="E0182">
<source>Could not resolve UTI for {0} in catalog {1}</source>
<target state="new">Could not resolve UTI for {0} in catalog {1}</target>
<note />
</trans-unit>
<trans-unit id="E0183">
<source>An error occurred while trying to verify the compatibility between Xcode and Xamarin.iOS</source>
<target state="new">An error occurred while trying to verify the compatibility between Xcode and Xamarin.iOS</target>
<note />
</trans-unit>
<trans-unit id="E0184">
<source>The project was built with a version of Xcode ({0}) that is not compatible which may result in unexpected warnings or errors. Please install Xcode '{1}' or visit the documentation to learn more.</source>
<target state="new">The project was built with a version of Xcode ({0}) that is not compatible which may result in unexpected warnings or errors. Please install Xcode '{1}' or visit the documentation to learn more.</target>
<note />
</trans-unit>
<trans-unit id="E0185">
<source>An error occurred while trying to verify the compatibility between Xcode and Xamarin.iOS. Details: {0}
</source>
<target state="new">An error occurred while trying to verify the compatibility between Xcode and Xamarin.iOS. Details: {0}
</target>
<note />
</trans-unit>
<trans-unit id="E0186">
<source>The provided Archive Path is not from a valid archive file (.xcarchive). Archive Path: '{0}'</source>
<target state="new">The provided Archive Path is not from a valid archive file (.xcarchive). Archive Path: '{0}'</target>
<note />
</trans-unit>
<trans-unit id="E7001">
<source>Could not resolve host IPs for WiFi debugger settings.
</source>

Просмотреть файл

@ -7,9 +7,9 @@
<ItemGroup>
<!-- Compile against Microsoft.Build* NuGet refs, but do not copy to OutputDir. -->
<PackageReference Include="Microsoft.Build" Version="15.9.20" IncludeAssets="compile" />
<PackageReference Include="Microsoft.Build.Framework" Version="15.9.20" IncludeAssets="compile" />
<PackageReference Include="Microsoft.Build.Tasks.Core" Version="15.9.20" IncludeAssets="compile" />
<PackageReference Include="Microsoft.Build.Utilities.Core" Version="15.9.20" IncludeAssets="compile" />
<PackageReference Include="Microsoft.Build.Framework" Version="16.8.0" IncludeAssets="compile" />
<PackageReference Include="Microsoft.Build.Tasks.Core" Version="16.8.0" IncludeAssets="compile" />
<PackageReference Include="Microsoft.Build.Utilities.Core" Version="16.8.0" IncludeAssets="compile" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\external\Xamarin.MacDev\Xamarin.MacDev\Xamarin.MacDev.csproj" />

Просмотреть файл

@ -4,6 +4,9 @@
<TargetFrameworks>netstandard2.0</TargetFrameworks>
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Xamarin.Messaging.Build.Client" Version="$(MessagingVersion)" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\external\Xamarin.MacDev\Xamarin.MacDev\Xamarin.MacDev.csproj" />
<ProjectReference Include="..\Xamarin.MacDev.Tasks.Core\Xamarin.MacDev.Tasks.Core.csproj" />

Просмотреть файл

@ -0,0 +1,7 @@
namespace Microsoft.Build.Tasks
{
public abstract class WriteLinesToFileBase : WriteLinesToFile
{
public string SessionId { get; set; }
}
}

Просмотреть файл

@ -101,7 +101,7 @@ namespace Xamarin.MacDev.Tasks
}
}
protected string DefaultEntitlementsPath {
protected virtual string DefaultEntitlementsPath {
get {
return Path.Combine (Sdks.GetAppleSdk (TargetFrameworkMoniker).GetSdkPath (SdkVersion, false), "Entitlements.plist");
}

Просмотреть файл

@ -7,6 +7,8 @@ using Microsoft.Build.Utilities;
namespace Xamarin.MacDev.Tasks {
public abstract class CreateEmbeddedResourcesTaskBase : Task
{
public string SessionId { get; set; }
[Required]
public ITaskItem[] BundleResources { get; set; }

Просмотреть файл

@ -10,9 +10,9 @@
<PackageReference Include="System.Text.Json" Version="4.7.0" />
<!-- Compile against Microsoft.Build* NuGet refs, but do not copy to OutputDir. -->
<PackageReference Include="Microsoft.Build" Version="15.9.20" IncludeAssets="compile" />
<PackageReference Include="Microsoft.Build.Framework" Version="15.9.20" IncludeAssets="compile" />
<PackageReference Include="Microsoft.Build.Tasks.Core" Version="15.9.20" IncludeAssets="compile" />
<PackageReference Include="Microsoft.Build.Utilities.Core" Version="15.9.20" IncludeAssets="compile" />
<PackageReference Include="Microsoft.Build.Framework" Version="16.8.0" IncludeAssets="compile" />
<PackageReference Include="Microsoft.Build.Tasks.Core" Version="16.8.0" IncludeAssets="compile" />
<PackageReference Include="Microsoft.Build.Utilities.Core" Version="16.8.0" IncludeAssets="compile" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\external\Xamarin.MacDev\Xamarin.MacDev\Xamarin.MacDev.csproj" />

Просмотреть файл

@ -25,6 +25,12 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Xamarin.MacDev.Tests", "..\
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
@ -113,6 +119,22 @@ Global
{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
@ -149,5 +171,6 @@ Global
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

Просмотреть файл

@ -0,0 +1,15 @@
using System.Threading.Tasks;
using Xamarin.Messaging.Ssh;
namespace Xamarin.Messaging.Build.Client {
public static class IBuildClientExtensions {
public static async Task DeleteAppDirectoryAsync (this IBuildClient buildClient)
{
if (buildClient is BuildClient client) {
await client
.RunSshAsync (ssh => ssh.DeleteDirectoryAsync (buildClient.AppName))
.ConfigureAwait (continueOnCapturedContext: false);
}
}
}
}

Просмотреть файл

@ -0,0 +1,12 @@
namespace Microsoft.Build.Framework {
public static class ITaskItemExtensions {
const string FrameworkFileMetadataKey = "FrameworkFile";
public static bool IsFrameworkItem (this ITaskItem item)
{
return (bool.TryParse (item.GetMetadata (FrameworkFileMetadataKey), out var isFrameworkFile) && isFrameworkFile) ||
item.GetMetadata ("ResolvedFrom") == "{TargetFrameworkDirectory}" ||
item.GetMetadata ("ResolvedFrom") == "ImplicitlyExpandDesignTimeFacades";
}
}
}

Просмотреть файл

@ -1,8 +1,19 @@
using Xamarin.MacDev.Tasks;
using Xamarin.Messaging.Build.Client;
namespace Microsoft.Build.Tasks
{
public class Copy : CopyBase
{
public override bool Execute ()
{
if (string.IsNullOrEmpty (SessionId))
return base.Execute ();
var taskRunner = new TaskRunner (SessionId, BuildEngine4);
taskRunner.FixReferencedItems (SourceFiles);
return taskRunner.RunAsync (this).Result;
}
}
}

Просмотреть файл

@ -1,8 +1,31 @@
using Xamarin.MacDev.Tasks;
using Xamarin.Messaging.Build.Client;
namespace Microsoft.Build.Tasks
{
public class Delete : DeleteBase
{
public override bool Execute ()
{
var result = base.Execute ();
if (string.IsNullOrEmpty (SessionId)) {
return result;
}
var client = BuildConnection
.GetAsync (SessionId, BuildEngine4)
.Result
.Client;
if (!client.IsConnected) {
return result;
}
foreach (var file in Files) {
client.DeleteFileAsync (file.ItemSpec).Wait ();
}
return result;
}
}
}

Просмотреть файл

@ -1,8 +1,61 @@
using Xamarin.MacDev.Tasks;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.Build.Framework;
using Xamarin.Messaging.Build.Client;
using System.Security;
using System.Reactive.Linq;
namespace Microsoft.Build.Tasks
{
public class Exec : ExecBase
public class Exec : ExecBase, ITaskCallback
{
public string ServerPassword { get; set; }
public override bool Execute ()
{
if (string.IsNullOrEmpty (SessionId))
return base.Execute ();
if (string.IsNullOrEmpty (ServerPassword))
return new TaskRunner (SessionId, BuildEngine4).RunAsync (this).Result;
return RunSudoCommandAsync ().Result;
}
public bool ShouldCopyToBuildServer (ITaskItem item) => false;
public bool ShouldCreateOutputFile (ITaskItem item) => false;
public IEnumerable<ITaskItem> GetAdditionalItemsToBeCopied () => Enumerable.Empty<ITaskItem> ();
async Task<bool> RunSudoCommandAsync ()
{
try {
var client = BuildConnection
.GetAsync (SessionId, BuildEngine4)
.Result
.Client;
var sshCommands = client
.MessagingService
.Ssh
.Commands;
var commandOutput = await sshCommands
.RunSudoCommandAsync (Command, ServerPassword.ToSecureString ())
.ConfigureAwait (continueOnCapturedContext: false);
await commandOutput.Do (output => {
if (ConsoleToMSBuild && !string.IsNullOrEmpty (output))
Log.LogMessage (output);
});
return true;
} catch (Exception ex) {
Log.LogErrorFromException (ex, showStackTrace: true, showDetail: true, file: null);
return false;
}
}
}
}

Просмотреть файл

@ -1,8 +1,26 @@
using Xamarin.MacDev.Tasks;
using System.Collections.Generic;
using System.Linq;
using Microsoft.Build.Framework;
using Xamarin.Messaging.Build.Client;
namespace Microsoft.Build.Tasks
{
public class MakeDir : MakeDirBase
public class MakeDir : MakeDirBase, ITaskCallback
{
public override bool Execute ()
{
var result = base.Execute ();
if (!string.IsNullOrEmpty (SessionId))
result = new TaskRunner (SessionId, BuildEngine4).RunAsync (this).Result;
return result;
}
public bool ShouldCopyToBuildServer (ITaskItem item) => true;
public bool ShouldCreateOutputFile (ITaskItem item) => false;
public IEnumerable<ITaskItem> GetAdditionalItemsToBeCopied () => Enumerable.Empty<ITaskItem> ();
}
}

Просмотреть файл

@ -1,8 +1,24 @@
using Xamarin.MacDev.Tasks;
using System.Collections.Generic;
using System.Linq;
using Microsoft.Build.Framework;
using Xamarin.Messaging.Build.Client;
namespace Microsoft.Build.Tasks
{
public class Move : MoveTaskBase
public class Move : MoveTaskBase, ITaskCallback
{
public override bool Execute ()
{
if (!string.IsNullOrEmpty (SessionId))
return new TaskRunner (SessionId, BuildEngine4).RunAsync (this).Result;
return base.Execute ();
}
public bool ShouldCopyToBuildServer (ITaskItem item) => false;
public bool ShouldCreateOutputFile (ITaskItem item) => true;
public IEnumerable<ITaskItem> GetAdditionalItemsToBeCopied () => Enumerable.Empty<ITaskItem> ();
}
}

Просмотреть файл

@ -1,8 +1,38 @@
using Xamarin.MacDev.Tasks;
using Xamarin.Messaging.Build.Client;
namespace Microsoft.Build.Tasks
{
public class RemoveDir : RemoveDirBase
{
public bool RemoveAppDir { get; set; }
public override bool Execute ()
{
var result = base.Execute ();
if (string.IsNullOrEmpty (SessionId)) {
return result;
}
var client = BuildConnection
.GetAsync (SessionId, BuildEngine4)
.Result
.Client;
if (!client.IsConnected) {
return result;
}
foreach (var directory in Directories) {
client.DeleteDirectoryAsync (directory.ItemSpec).Wait ();
}
if (RemoveAppDir) {
client.DeleteAppDirectoryAsync ().Wait ();
}
return result;
}
}
}

Просмотреть файл

@ -1,8 +1,29 @@
using Xamarin.MacDev.Tasks;
using System.Collections.Generic;
using System.Linq;
using Microsoft.Build.Framework;
using Xamarin.MacDev.Tasks;
using Xamarin.Messaging.Build.Client;
namespace Microsoft.Build.Tasks
{
public class Touch : TouchBase
public class Touch : TouchBase, ITaskCallback
{
public override bool Execute ()
{
bool result;
if (!string.IsNullOrEmpty (SessionId))
result = new TaskRunner (SessionId, BuildEngine4).RunAsync (this).Result;
else
result = base.Execute ();
return result;
}
public IEnumerable<ITaskItem> GetAdditionalItemsToBeCopied () => Enumerable.Empty<ITaskItem> ();
public bool ShouldCopyToBuildServer (ITaskItem item) => false;
public bool ShouldCreateOutputFile (ITaskItem item) => true;
}
}

Просмотреть файл

@ -0,0 +1,15 @@
using Xamarin.Messaging.Build.Client;
namespace Microsoft.Build.Tasks
{
public class WriteLinesToFile : WriteLinesToFileBase
{
public override bool Execute ()
{
if (!string.IsNullOrEmpty (SessionId))
return new TaskRunner (SessionId, BuildEngine4).RunAsync (this).Result;
return base.Execute ();
}
}
}

Просмотреть файл

@ -1,5 +1,23 @@
namespace Xamarin.MacDev.Tasks {
public class AOTCompile : AOTCompileTaskBase {
using Microsoft.Build.Framework;
using Xamarin.Messaging.Build.Client;
namespace Xamarin.MacDev.Tasks
{
public class AOTCompile : AOTCompileTaskBase, ICancelableTask
{
public override bool Execute ()
{
if (!string.IsNullOrEmpty (SessionId))
return new TaskRunner (SessionId, BuildEngine4).RunAsync (this).Result;
return base.Execute ();
}
public void Cancel ()
{
if (!string.IsNullOrEmpty (SessionId))
BuildConnection.CancelAsync (SessionId, BuildEngine4).Wait ();
}
}
}

Просмотреть файл

@ -1,6 +1,32 @@
namespace Xamarin.MacDev.Tasks
using System.Collections.Generic;
using System.Linq;
using Microsoft.Build.Framework;
using Xamarin.Messaging.Build.Client;
namespace Xamarin.MacDev.Tasks
{
public class ArTool : ArToolTaskBase
public class ArTool : ArToolTaskBase, ITaskCallback
{
public override bool Execute ()
{
if (!string.IsNullOrEmpty (SessionId))
return new TaskRunner (SessionId, BuildEngine4).RunAsync (this).Result;
return base.Execute ();
}
public bool ShouldCopyToBuildServer (ITaskItem item) => false;
public bool ShouldCreateOutputFile (ITaskItem item) => true;
public IEnumerable<ITaskItem> GetAdditionalItemsToBeCopied () => Enumerable.Empty<ITaskItem> ();
public override void Cancel ()
{
if (!string.IsNullOrEmpty (SessionId))
BuildConnection.CancelAsync (SessionId, BuildEngine4).Wait ();
base.Cancel ();
}
}
}

Просмотреть файл

@ -1,6 +1,30 @@
namespace Xamarin.MacDev.Tasks
using System.Collections.Generic;
using System.Linq;
using Microsoft.Build.Framework;
using Xamarin.Messaging.Build.Client;
namespace Xamarin.MacDev.Tasks
{
public class Codesign : CodesignTaskBase
public class Codesign : CodesignTaskBase, ITaskCallback, ICancelableTask
{
public override bool Execute ()
{
if (!string.IsNullOrEmpty (SessionId))
return new TaskRunner (SessionId, BuildEngine4).RunAsync (this).Result;
return base.Execute ();
}
public IEnumerable<ITaskItem> GetAdditionalItemsToBeCopied () => Enumerable.Empty<ITaskItem> ();
public bool ShouldCopyToBuildServer (ITaskItem item) => false;
public bool ShouldCreateOutputFile (ITaskItem item) => true;
public void Cancel ()
{
if (!string.IsNullOrEmpty (SessionId))
BuildConnection.CancelAsync (SessionId, BuildEngine4).Wait ();
}
}
}

Просмотреть файл

@ -1,6 +1,32 @@
using System;
using Microsoft.Build.Framework;
using Xamarin.Messaging.Build.Client;
namespace Xamarin.MacDev.Tasks
{
public class CollectBundleResources : CollectBundleResourcesTaskBase
public class CollectBundleResources : CollectBundleResourcesTaskBase, ICancelableTask
{
public override bool Execute ()
{
try {
if (!string.IsNullOrEmpty (SessionId)) {
// Copy the bundle files to the build server
new TaskRunner (SessionId, BuildEngine4).CopyInputsAsync (this).Wait ();
}
// But execute locally
return base.Execute ();
} catch (Exception ex) {
Log.LogErrorFromException (ex);
return false;
}
}
public void Cancel ()
{
if (!string.IsNullOrEmpty (SessionId))
BuildConnection.CancelAsync (SessionId, BuildEngine4).Wait ();
}
}
}

Просмотреть файл

@ -1,7 +1,31 @@
using System.Collections.Generic;
using System.Linq;
using Microsoft.Build.Framework;
using Xamarin.Messaging.Build.Client;
namespace Xamarin.MacDev.Tasks
{
public class CollectFrameworks : CollectFrameworksBase
public class CollectFrameworks : CollectFrameworksBase, ITaskCallback, ICancelableTask
{
public override bool Execute ()
{
if (!string.IsNullOrEmpty (SessionId))
return new TaskRunner (SessionId, BuildEngine4).RunAsync (this).Result;
return base.Execute ();
}
public IEnumerable<ITaskItem> GetAdditionalItemsToBeCopied () => Enumerable.Empty<ITaskItem> ();
public bool ShouldCopyToBuildServer (ITaskItem item) => false;
public bool ShouldCreateOutputFile (ITaskItem item) => false;
public void Cancel ()
{
if (!string.IsNullOrEmpty (SessionId))
BuildConnection.CancelAsync (SessionId, BuildEngine4).Wait ();
}
}
}

Просмотреть файл

@ -1,5 +1,49 @@
namespace Xamarin.MacDev.Tasks {
public class CompileNativeCode : CompileNativeCodeTaskBase {
using System.Collections.Generic;
using System.IO;
using Microsoft.Build.Framework;
using Microsoft.Build.Utilities;
using Xamarin.Messaging.Build.Client;
namespace Xamarin.MacDev.Tasks
{
public class CompileNativeCode : CompileNativeCodeTaskBase, ICancelableTask, ITaskCallback
{
public override bool Execute ()
{
if (string.IsNullOrEmpty (SessionId))
return base.Execute ();
foreach (var info in CompileInfo)
{
var outputFile = info.GetMetadata ("OutputFile");
if (!string.IsNullOrEmpty (outputFile))
info.SetMetadata ("OutputFile", outputFile.Replace ("\\", "/"));
}
return new TaskRunner (SessionId, BuildEngine4).RunAsync (this).Result;
}
public bool ShouldCopyToBuildServer (ITaskItem item) => false;
public bool ShouldCreateOutputFile (ITaskItem item) => true;
public IEnumerable<ITaskItem> GetAdditionalItemsToBeCopied ()
{
foreach (var dir in IncludeDirectories)
{
foreach (var file in Directory.EnumerateFiles(dir.ItemSpec, "*.*", SearchOption.AllDirectories))
{
yield return new TaskItem(file);
}
}
}
public void Cancel ()
{
if (!string.IsNullOrEmpty (SessionId))
BuildConnection.CancelAsync (SessionId, BuildEngine4).Wait ();
}
}
}

Просмотреть файл

@ -1,6 +1,58 @@
namespace Xamarin.MacDev.Tasks
using System.Collections.Generic;
using System.Linq;
using Microsoft.Build.Framework;
using Xamarin.Messaging.Build.Client;
namespace Xamarin.MacDev.Tasks
{
public class ComputeBundleResourceOutputPaths : ComputeBundleResourceOutputPathsTaskBase
public class ComputeBundleResourceOutputPaths : ComputeBundleResourceOutputPathsTaskBase, ITaskCallback, ICancelableTask
{
public override bool Execute ()
{
if (string.IsNullOrEmpty (SessionId))
return base.Execute ();
var result = new TaskRunner (SessionId, BuildEngine4).RunAsync (this).Result;
RemoveDuplicates ();
return result;
}
public IEnumerable<ITaskItem> GetAdditionalItemsToBeCopied () => Enumerable.Empty<ITaskItem> ();
public bool ShouldCopyToBuildServer (ITaskItem item) => false;
public bool ShouldCreateOutputFile (ITaskItem item) => false;
public void Cancel ()
{
if (!string.IsNullOrEmpty (SessionId))
BuildConnection.CancelAsync (SessionId, BuildEngine4).Wait ();
}
void RemoveDuplicates ()
{
// Remove duplicated files
var filteredOutput = new List<ITaskItem> ();
foreach (var item in BundleResourcesWithOutputPaths) {
var itemIsFromProjectReference = IsFromProjectReference (item);
var duplicate = filteredOutput.FirstOrDefault (i => i.GetMetadata ("OutputPath") == item.GetMetadata ("OutputPath"));
if (duplicate != null) {
if (!IsFromProjectReference (duplicate) && itemIsFromProjectReference) {
filteredOutput.Remove (duplicate);
}
}
if (itemIsFromProjectReference || duplicate == null)
filteredOutput.Add (item);
}
BundleResourcesWithOutputPaths = filteredOutput.ToArray ();
}
bool IsFromProjectReference (ITaskItem item) => !string.IsNullOrEmpty (item.GetMetadata ("MSBuildSourceProjectFile"));
}
}

Просмотреть файл

@ -1,6 +1,22 @@
namespace Xamarin.MacDev.Tasks
using Microsoft.Build.Framework;
using Xamarin.Messaging.Build.Client;
namespace Xamarin.MacDev.Tasks
{
public class CoreMLCompiler : CoreMLCompilerTaskBase
public class CoreMLCompiler : CoreMLCompilerTaskBase, ICancelableTask
{
public override bool Execute ()
{
if (!string.IsNullOrEmpty (SessionId))
return new TaskRunner (SessionId, BuildEngine4).RunAsync (this).Result;
return base.Execute ();
}
public void Cancel ()
{
if (!string.IsNullOrEmpty (SessionId))
BuildConnection.CancelAsync (SessionId, BuildEngine4).Wait ();
}
}
}

Просмотреть файл

@ -1,6 +1,22 @@
namespace Xamarin.MacDev.Tasks
using Microsoft.Build.Framework;
using Xamarin.Messaging.Build.Client;
namespace Xamarin.MacDev.Tasks
{
public class CreateAssetPackManifest : CreateAssetPackManifestTaskBase
public class CreateAssetPackManifest : CreateAssetPackManifestTaskBase, ICancelableTask
{
public override bool Execute ()
{
if (!string.IsNullOrEmpty (SessionId))
return new TaskRunner (SessionId, BuildEngine4).RunAsync (this).Result;
return base.Execute ();
}
public void Cancel ()
{
if (!string.IsNullOrEmpty (SessionId))
BuildConnection.CancelAsync (SessionId, BuildEngine4).Wait ();
}
}
}

Просмотреть файл

@ -1,6 +1,22 @@
namespace Xamarin.MacDev.Tasks
using Microsoft.Build.Framework;
using Xamarin.Messaging.Build.Client;
namespace Xamarin.MacDev.Tasks
{
public class CreatePkgInfo : CreatePkgInfoTaskBase
public class CreatePkgInfo : CreatePkgInfoTaskBase, ICancelableTask
{
public override bool Execute ()
{
if (!string.IsNullOrEmpty (SessionId))
return new TaskRunner (SessionId, BuildEngine4).RunAsync (this).Result;
return base.Execute ();
}
public void Cancel ()
{
if (!string.IsNullOrEmpty (SessionId))
BuildConnection.CancelAsync (SessionId, BuildEngine4).Wait ();
}
}
}

Просмотреть файл

@ -1,6 +1,32 @@
namespace Xamarin.MacDev.Tasks
using System.Collections.Generic;
using System.Linq;
using Microsoft.Build.Framework;
using Xamarin.Messaging.Build.Client;
namespace Xamarin.MacDev.Tasks
{
public class DSymUtil : DSymUtilTaskBase
public class DSymUtil : DSymUtilTaskBase, ITaskCallback
{
public override bool Execute ()
{
if (!string.IsNullOrEmpty (SessionId))
return new TaskRunner (SessionId, BuildEngine4).RunAsync (this).Result;
return base.Execute ();
}
public override void Cancel ()
{
base.Cancel ();
if (!string.IsNullOrEmpty (SessionId))
BuildConnection.CancelAsync (SessionId, BuildEngine4).Wait ();
}
public bool ShouldCopyToBuildServer (ITaskItem item) => false;
public bool ShouldCreateOutputFile (ITaskItem item) => item == Executable;
public IEnumerable<ITaskItem> GetAdditionalItemsToBeCopied () => Enumerable.Empty<ITaskItem> ();
}
}

Просмотреть файл

@ -1,6 +1,43 @@
namespace Xamarin.MacDev.Tasks
using System.Collections.Generic;
using System.IO;
using System.Linq;
using Microsoft.Build.Framework;
using Xamarin.Messaging.Build.Client;
namespace Xamarin.MacDev.Tasks
{
public class Ditto : DittoTaskBase
public class Ditto : DittoTaskBase, ITaskCallback
{
public override bool Execute ()
{
if (!string.IsNullOrEmpty (SessionId)) {
var taskRunner = new TaskRunner (SessionId, BuildEngine4);
taskRunner.FixReferencedItems (new ITaskItem [] { Source });
return taskRunner.RunAsync (this).Result;
}
return base.Execute ();
}
public override void Cancel ()
{
base.Cancel ();
if (!string.IsNullOrEmpty (SessionId))
BuildConnection.CancelAsync (SessionId, BuildEngine4).Wait ();
}
public IEnumerable<ITaskItem> GetAdditionalItemsToBeCopied () => Enumerable.Empty<ITaskItem> ();
public bool ShouldCopyToBuildServer (ITaskItem item) => true;
public bool ShouldCreateOutputFile (ITaskItem item)
{
var fileExtension = Path.GetExtension (item.ItemSpec);
return fileExtension != ".app" && fileExtension != ".appex";
}
}
}

Просмотреть файл

@ -1,5 +1,16 @@
namespace Xamarin.MacDev.Tasks {
public class GetMinimumOSVersion : GetMinimumOSVersionTaskBase {
using Xamarin.Messaging.Build.Client;
namespace Xamarin.MacDev.Tasks
{
public class GetMinimumOSVersion : GetMinimumOSVersionTaskBase
{
public override bool Execute ()
{
if (!string.IsNullOrEmpty (SessionId))
return new TaskRunner (SessionId, BuildEngine4).RunAsync (this).Result;
return base.Execute ();
}
}
}

Просмотреть файл

@ -1,6 +1,22 @@
namespace Xamarin.MacDev.Tasks
using Microsoft.Build.Framework;
using Xamarin.Messaging.Build.Client;
namespace Xamarin.MacDev.Tasks
{
public class GetNativeExecutableName : GetNativeExecutableNameTaskBase
public class GetNativeExecutableName : GetNativeExecutableNameTaskBase, ICancelableTask
{
public override bool Execute ()
{
if (!string.IsNullOrEmpty (SessionId))
return new TaskRunner (SessionId, BuildEngine4).RunAsync (this).Result;
return base.Execute ();
}
public void Cancel ()
{
if (!string.IsNullOrEmpty (SessionId))
BuildConnection.CancelAsync (SessionId, BuildEngine4).Wait ();
}
}
}

Просмотреть файл

@ -1,5 +1,25 @@
namespace Xamarin.MacDev.Tasks {
public class LinkNativeCode : LinkNativeCodeTaskBase {
using System.Collections.Generic;
using System.Linq;
using Microsoft.Build.Framework;
using Xamarin.Messaging.Build.Client;
namespace Xamarin.MacDev.Tasks
{
public class LinkNativeCode : LinkNativeCodeTaskBase, ITaskCallback
{
public override bool Execute ()
{
if (!string.IsNullOrEmpty (SessionId))
return new TaskRunner (SessionId, BuildEngine4).RunAsync (this).Result;
return base.Execute ();
}
public bool ShouldCopyToBuildServer (ITaskItem item) => false;
public bool ShouldCreateOutputFile (ITaskItem item) => false;
public IEnumerable<ITaskItem> GetAdditionalItemsToBeCopied () => Enumerable.Empty<ITaskItem> ();
}
}

Просмотреть файл

@ -1,6 +1,60 @@
using System;
using System.Collections.Generic;
using System.Linq;
using Microsoft.Build.Framework;
using Xamarin.Messaging.Build.Client;
namespace Xamarin.MacDev.Tasks
{
public class PackLibraryResources : PackLibraryResourcesTaskBase
public class PackLibraryResources : PackLibraryResourcesTaskBase, ITaskCallback, ICancelableTask
{
public override bool Execute ()
{
if (string.IsNullOrEmpty (SessionId))
return base.Execute ();
// Fix LogicalName path for the Mac
if (BundleResourcesWithLogicalNames != null) {
foreach (var resource in BundleResourcesWithLogicalNames) {
var logicalName = resource.GetMetadata ("LogicalName");
if (!string.IsNullOrEmpty (logicalName)) {
resource.SetMetadata ("LogicalName", logicalName.Replace ("\\", "/"));
}
}
}
var runner = new TaskRunner (SessionId, BuildEngine4);
try {
var result = runner.RunAsync (this).Result;
if (result && EmbeddedResources != null) {
// We must get the "real" file that will be embedded in the
// compiled assembly in Windows
foreach (var embeddedResource in EmbeddedResources.Where (x => runner.ShouldCopyItemAsync (task: this, item: x).Result)) {
runner.GetFileAsync (embeddedResource.ItemSpec).Wait ();
}
}
return result;
} catch (Exception ex) {
Log.LogErrorFromException (ex);
return false;
}
}
public void Cancel ()
{
if (!string.IsNullOrEmpty (SessionId))
BuildConnection.CancelAsync (SessionId, BuildEngine4).Wait ();
}
public bool ShouldCopyToBuildServer (ITaskItem item) => false;
public bool ShouldCreateOutputFile (ITaskItem item) => false;
public IEnumerable<ITaskItem> GetAdditionalItemsToBeCopied () => Enumerable.Empty<ITaskItem> ();
}
}

Просмотреть файл

@ -1,5 +1,23 @@
namespace Xamarin.MacDev.Tasks {
public class PrepareResourceRules : PrepareResourceRulesTaskBase {
using Microsoft.Build.Framework;
using Xamarin.Messaging.Build.Client;
namespace Xamarin.MacDev.Tasks
{
public class PrepareResourceRules : PrepareResourceRulesTaskBase, ICancelableTask
{
public override bool Execute ()
{
if (!string.IsNullOrEmpty (SessionId))
return new TaskRunner (SessionId, BuildEngine4).RunAsync (this).Result;
return base.Execute ();
}
public void Cancel ()
{
if (!string.IsNullOrEmpty (SessionId))
BuildConnection.CancelAsync (SessionId, BuildEngine4).Wait ();
}
}
}

Просмотреть файл

@ -1,6 +1,24 @@
namespace Xamarin.MacDev.Tasks
using System.Collections.Generic;
using System.Linq;
using Microsoft.Build.Framework;
using Xamarin.Messaging.Build.Client;
namespace Xamarin.MacDev.Tasks
{
public class ReadItemsFromFile : ReadItemsFromFileBase
public class ReadItemsFromFile : ReadItemsFromFileBase, ITaskCallback
{
public override bool Execute ()
{
if (!string.IsNullOrEmpty (SessionId))
return new TaskRunner (SessionId, BuildEngine4).RunAsync (this).Result;
return base.Execute ();
}
public bool ShouldCopyToBuildServer (ITaskItem item) => false;
public bool ShouldCreateOutputFile (ITaskItem item) => false;
public IEnumerable<ITaskItem> GetAdditionalItemsToBeCopied () => Enumerable.Empty<ITaskItem> ();
}
}

Просмотреть файл

@ -1,6 +1,35 @@
namespace Xamarin.MacDev.Tasks
using System.Collections.Generic;
using System.Linq;
using Microsoft.Build.Framework;
using Xamarin.Messaging.Build.Client;
namespace Xamarin.MacDev.Tasks
{
public class SmartCopy : SmartCopyTaskBase
public class SmartCopy : SmartCopyTaskBase, ITaskCallback, ICancelableTask
{
public override bool Execute ()
{
if (!string.IsNullOrEmpty (SessionId)) {
var taskRunner = new TaskRunner (SessionId, BuildEngine4);
taskRunner.FixReferencedItems (SourceFiles);
return taskRunner.RunAsync (this).Result;
}
return base.Execute ();
}
public void Cancel ()
{
if (!string.IsNullOrEmpty (SessionId))
BuildConnection.CancelAsync (SessionId, BuildEngine4).Wait ();
}
public bool ShouldCopyToBuildServer (ITaskItem item) => false;
public bool ShouldCreateOutputFile (ITaskItem item) => true;
public IEnumerable<ITaskItem> GetAdditionalItemsToBeCopied () => Enumerable.Empty<ITaskItem> ();
}
}

Просмотреть файл

@ -1,6 +1,24 @@
namespace Xamarin.MacDev.Tasks
using Microsoft.Build.Framework;
using Xamarin.Messaging.Build.Client;
namespace Xamarin.MacDev.Tasks
{
public class SpotlightIndexer : SpotlightIndexerTaskBase
{
public override bool Execute ()
{
if (!string.IsNullOrEmpty (SessionId))
return new TaskRunner (SessionId, BuildEngine4).RunAsync (this).Result;
return base.Execute ();
}
public override void Cancel ()
{
if (!string.IsNullOrEmpty (SessionId))
BuildConnection.CancelAsync (SessionId, BuildEngine4).Wait ();
base.Execute ();
}
}
}

Просмотреть файл

@ -1,6 +1,24 @@
namespace Xamarin.MacDev.Tasks
using Microsoft.Build.Framework;
using Xamarin.Messaging.Build.Client;
namespace Xamarin.MacDev.Tasks
{
public class SymbolStrip : SymbolStripTaskBase
{
public override bool Execute ()
{
if (!string.IsNullOrEmpty (SessionId))
return new TaskRunner (SessionId, BuildEngine4).RunAsync (this).Result;
return base.Execute ();
}
public override void Cancel ()
{
if (!string.IsNullOrEmpty (SessionId))
BuildConnection.CancelAsync (SessionId, BuildEngine4).Wait ();
base.Execute ();
}
}
}

Просмотреть файл

@ -2,13 +2,60 @@ using System.Linq;
using System.Collections.Generic;
using Mono.Cecil;
using Xamarin.Messaging.Build.Client;
using Microsoft.Build.Framework;
#nullable enable
namespace Xamarin.MacDev.Tasks
{
public class UnpackLibraryResources : UnpackLibraryResourcesTaskBase
public class UnpackLibraryResources : UnpackLibraryResourcesTaskBase, ITaskCallback, ICancelableTask
{
public override bool Execute ()
{
bool result;
if (!string.IsNullOrEmpty (SessionId)) {
result = new TaskRunner (SessionId, BuildEngine4).RunAsync (this).Result;
if (result && BundleResourcesWithLogicalNames != null) {
// Fix LogicalName path for Windows
foreach (var resource in BundleResourcesWithLogicalNames) {
var logicalName = resource.GetMetadata ("LogicalName");
if (!string.IsNullOrEmpty (logicalName)) {
resource.SetMetadata ("LogicalName", logicalName.Replace ("/", "\\"));
}
}
}
} else {
result = base.Execute ();
}
return result;
}
public void Cancel ()
{
if (!string.IsNullOrEmpty (SessionId))
BuildConnection.CancelAsync (SessionId, BuildEngine4).Wait ();
}
public bool ShouldCopyToBuildServer (ITaskItem item)
{
if (item.IsFrameworkItem ())
return false;
if (NoOverwrite != null && NoOverwrite.Contains (item))
return false;
return true;
}
public bool ShouldCreateOutputFile (ITaskItem item) => UnpackedResources?.Contains (item) == true;
public IEnumerable<ITaskItem> GetAdditionalItemsToBeCopied () => Enumerable.Empty<ITaskItem> ();
protected override IEnumerable<ManifestResource> GetAssemblyManifestResources (string fileName)
{
AssemblyDefinition? assembly = null;

Просмотреть файл

@ -1,6 +1,32 @@
namespace Xamarin.MacDev.Tasks
using System.Collections.Generic;
using System.Linq;
using Microsoft.Build.Framework;
using Xamarin.Messaging.Build.Client;
namespace Xamarin.MacDev.Tasks
{
public class Zip : ZipTaskBase
public class Zip : ZipTaskBase, ITaskCallback
{
public override bool Execute ()
{
if (!string.IsNullOrEmpty (SessionId))
return new TaskRunner (SessionId, BuildEngine4).RunAsync (this).Result;
return base.Execute ();
}
public override void Cancel ()
{
if (!string.IsNullOrEmpty (SessionId))
BuildConnection.CancelAsync (SessionId, BuildEngine4).Wait ();
base.Cancel ();
}
public bool ShouldCopyToBuildServer (ITaskItem item) => false;
public bool ShouldCreateOutputFile (ITaskItem item) => true;
public IEnumerable<ITaskItem> GetAdditionalItemsToBeCopied () => Enumerable.Empty<ITaskItem> ();
}
}

Просмотреть файл

@ -9,12 +9,16 @@
<PackageReference Include="Mono.Cecil" Version="0.11.1" />
<!-- Compile against Microsoft.Build* NuGet refs, but do not copy to OutputDir. -->
<PackageReference Include="Microsoft.Build" Version="15.9.20" IncludeAssets="compile" />
<PackageReference Include="Microsoft.Build.Framework" Version="15.9.20" IncludeAssets="compile" />
<PackageReference Include="Microsoft.Build.Tasks.Core" Version="15.9.20" IncludeAssets="compile" />
<PackageReference Include="Microsoft.Build.Utilities.Core" Version="15.9.20" IncludeAssets="compile" />
<PackageReference Include="Microsoft.Build.Framework" Version="16.8.0" IncludeAssets="compile" />
<PackageReference Include="Microsoft.Build.Tasks.Core" Version="16.8.0" IncludeAssets="compile" />
<PackageReference Include="Microsoft.Build.Utilities.Core" Version="16.8.0" IncludeAssets="compile" />
<PackageReference Include="Xamarin.Messaging.Build.Client" Version="$(MessagingVersion)" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\external\Xamarin.MacDev\Xamarin.MacDev\Xamarin.MacDev.csproj" />
<ProjectReference Include="..\Xamarin.MacDev.Tasks.Core\Xamarin.MacDev.Tasks.Core.csproj" />
</ItemGroup>
<ItemGroup>
<Folder Include="Extensions\" />
</ItemGroup>
</Project>

Просмотреть файл

@ -108,7 +108,11 @@ Copyright (C) 2020 Microsoft. All rights reserved.
</Target>
<Target Name="_CreateEmbeddedResources" DependsOnTargets="_CollectBundleResources">
<CreateEmbeddedResources BundleResources="@(_BundleResourceWithLogicalName)" Prefix="$(_EmbeddedResourcePrefix)">
<CreateEmbeddedResources
SessionId="$(BuildSessionId)"
BundleResources="@(_BundleResourceWithLogicalName)"
Prefix="$(_EmbeddedResourcePrefix)">
<Output ItemName="EmbeddedResource" TaskParameter="EmbeddedResources" />
</CreateEmbeddedResources>
</Target>

Просмотреть файл

@ -31,6 +31,7 @@ Copyright (C) 2018 Microsoft. All rights reserved.
<UsingTask TaskName="Microsoft.Build.Tasks.Move" AssemblyFile="$(_TaskAssemblyName)" />
<UsingTask TaskName="Microsoft.Build.Tasks.RemoveDir" AssemblyFile="$(_TaskAssemblyName)" />
<UsingTask TaskName="Microsoft.Build.Tasks.Touch" AssemblyFile="$(_TaskAssemblyName)" />
<UsingTask TaskName="Microsoft.Build.Tasks.WriteLinesToFile" AssemblyFile="$(_TaskAssemblyName)" />
<!-- Xamarin.iOS-specific tasks. Some of these are duplicated with the Xamarin.Mac ones below, and should eventually be re-namespaced to be in Xamarin.MacDev -->
<UsingTask Condition="'$(_PlatformName)' != 'macOS'" TaskName="Xamarin.iOS.Tasks.ACTool" AssemblyFile="$(_TaskAssemblyName)" />
@ -68,9 +69,11 @@ Copyright (C) 2018 Microsoft. All rights reserved.
<UsingTask Condition="'$(_PlatformName)' != 'macOS'" TaskName="Xamarin.iOS.Tasks.ParseDeviceSpecificBuildInformation" AssemblyFile="$(_TaskAssemblyName)" />
<UsingTask Condition="'$(_PlatformName)' != 'macOS'" TaskName="Xamarin.iOS.Tasks.PrepareNativeReferences" AssemblyFile="$(_TaskAssemblyName)" />
<UsingTask Condition="'$(_PlatformName)' != 'macOS'" TaskName="Xamarin.iOS.Tasks.ResolveNativeWatchApp" AssemblyFile="$(_TaskAssemblyName)" />
<UsingTask Condition="'$(_PlatformName)' != 'macOS'" TaskName="Xamarin.iOS.Tasks.ResolveUniversalTypeIdentifiers" AssemblyFile="Xamarin.iOS.Tasks.dll" />
<UsingTask Condition="'$(_PlatformName)' != 'macOS'" TaskName="Xamarin.iOS.Tasks.ScnTool" AssemblyFile="$(_TaskAssemblyName)" />
<UsingTask Condition="'$(_PlatformName)' != 'macOS'" TaskName="Xamarin.iOS.Tasks.TextureAtlas" AssemblyFile="$(_TaskAssemblyName)" />
<UsingTask Condition="'$(_PlatformName)' != 'macOS'" TaskName="Xamarin.iOS.Tasks.ValidateAppBundleTask" AssemblyFile="$(_TaskAssemblyName)" />
<UsingTask Condition="'$(_PlatformName)' != 'macOS'" TaskName="Xamarin.iOS.Tasks.VerifyXcodeVersion" AssemblyFile="$(_TaskAssemblyName)" />
<UsingTask Condition="'$(_PlatformName)' != 'macOS'" TaskName="Xamarin.iOS.Tasks.WriteAssetPackManifest" AssemblyFile="$(_TaskAssemblyName)" />
<!-- Xamarin.Mac-specific tasks. Some of these are duplicated with the Xamarin.iOS ones above, and should eventually be re-namespaced to be in Xamarin.MacDev -->

Просмотреть файл

@ -0,0 +1,50 @@
using System.Collections.Generic;
using System.IO;
using Microsoft.Build.Framework;
using Microsoft.Build.Utilities;
namespace ILLink.Tasks {
public class ILLinkBase : ILLink
{
public string SessionId { get; set; }
public ITaskItem [] DebugSymbols { get; set; }
[Required]
public string LinkerItemsDirectory { get; set; }
[Output]
public ITaskItem [] LinkerOutputItems { get; set; }
[Output]
public ITaskItem [] LinkedItems { get; set; }
public override bool Execute ()
{
var result = base.Execute ();
var linkerItems = new List<ITaskItem> ();
var linkedItems = new List<ITaskItem> ();
if (result)
{
// Adds all the files in the linker-items dir
foreach (var item in Directory.EnumerateFiles (LinkerItemsDirectory))
{
linkerItems.Add (new TaskItem (item));
}
// Adds all the files in the linked output dir
foreach (var item in Directory.EnumerateFiles (OutputDirectory.ItemSpec))
{
linkedItems.Add (new TaskItem (item));
}
}
LinkerOutputItems = linkerItems.ToArray ();
LinkedItems = linkedItems.ToArray();
return result;
}
}
}

Просмотреть файл

@ -17,8 +17,15 @@ Copyright (C) 2013-2016 Xamarin. All rights reserved.
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildThisFileDirectory)Xamarin.iOS.Common.props" />
<PropertyGroup>
<!-- Naming convention that relies on the fact that there will be a Microsoft.Windows.iOS.Sdk pack with the same version that the core SDK, on Windows installations only -->
<WindowsiOSSdkDirectory>$(MSBuildThisFileDirectory.Replace('Microsoft.iOS.Sdk', 'Microsoft.iOS.Windows.Sdk'))</WindowsiOSSdkDirectory>
</PropertyGroup>
<Import Project="$(MSBuildThisFileDirectory)$(MSBuildThisFileName).Before.targets"
Condition="Exists('$(MSBuildThisFileDirectory)$(MSBuildThisFileName).Before.targets')"/>
<Import Project="$(WindowsiOSSdkDirectory)$(MSBuildThisFileName).Before.targets"
Condition="Exists('$(WindowsiOSSdkDirectory)$(MSBuildThisFileName).Before.targets')"/>
<!-- *** Code Analysis Setup *** -->
<!-- Library projects aren't supported, if we enable Xamarin.Analysis on them, we'll need to revisit the rules and deactivate some (e.g XIA0002). -->
@ -1260,5 +1267,7 @@ Copyright (C) 2013-2016 Xamarin. All rights reserved.
<Import Project="$(MSBuildThisFileDirectory)$(MSBuildThisFileName).After.targets"
Condition="Exists('$(MSBuildThisFileDirectory)$(MSBuildThisFileName).After.targets')"/>
<Import Project="$(WindowsiOSSdkDirectory)$(MSBuildThisFileName).After.targets"
Condition="Exists('$(WindowsiOSSdkDirectory)$(MSBuildThisFileName).After.targets')"/>
</Project>

Просмотреть файл

@ -7,14 +7,21 @@
<ItemGroup>
<!-- Compile against Microsoft.Build* NuGet refs, but do not copy to OutputDir. -->
<PackageReference Include="Microsoft.Build" Version="15.9.20" IncludeAssets="compile" />
<PackageReference Include="Microsoft.Build.Framework" Version="15.9.20" IncludeAssets="compile" />
<PackageReference Include="Microsoft.Build.Tasks.Core" Version="15.9.20" IncludeAssets="compile" />
<PackageReference Include="Microsoft.Build.Utilities.Core" Version="15.9.20" IncludeAssets="compile" />
<PackageReference Include="Microsoft.Build.Framework" Version="16.8.0" IncludeAssets="compile" />
<PackageReference Include="Microsoft.Build.Tasks.Core" Version="16.8.0" IncludeAssets="compile" />
<PackageReference Include="Microsoft.Build.Utilities.Core" Version="16.8.0" IncludeAssets="compile" />
<PackageReference Include="Microsoft.NET.ILLink.Tasks" Version="6.0.0-alpha.1.21072.1" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\external\Xamarin.MacDev\Xamarin.MacDev\Xamarin.MacDev.csproj" />
<ProjectReference Include="..\Xamarin.MacDev.Tasks.Core\Xamarin.MacDev.Tasks.Core.csproj" />
</ItemGroup>
<ItemGroup>
<Reference Include="ILLink.Tasks">
<!-- We need the net472 impl, otherwise the Build agent needs to be a net5.0 app -->
<HintPath>$(PkgMicrosoft_NET_ILLink_Tasks)\tools\net472\ILLink.Tasks.dll</HintPath>
</Reference>
</ItemGroup>
<ItemGroup>
<None Include="NoCode.cs">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>

68
msbuild/Xamarin.iOS.Tasks.Windows/Properties/Resources.Designer.cs сгенерированный Normal file
Просмотреть файл

@ -0,0 +1,68 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.42000
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace Xamarin.iOS.Tasks.Windows.Properties {
using System;
using System.Reflection;
[System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
[System.Diagnostics.DebuggerNonUserCodeAttribute()]
[System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
internal class Resources {
private static System.Resources.ResourceManager resourceMan;
private static System.Globalization.CultureInfo resourceCulture;
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
internal Resources() {
}
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)]
internal static System.Resources.ResourceManager ResourceManager {
get {
if (object.Equals(null, resourceMan)) {
System.Resources.ResourceManager temp = new System.Resources.ResourceManager("Xamarin.iOS.Tasks.Windows.Properties.Resources", typeof(Resources).Assembly);
resourceMan = temp;
}
return resourceMan;
}
}
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)]
internal static System.Globalization.CultureInfo Culture {
get {
return resourceCulture;
}
set {
resourceCulture = value;
}
}
internal static string LocalUnzip_Error {
get {
return ResourceManager.GetString("LocalUnzip_Error", resourceCulture);
}
}
internal static string LocalUnzip_Unzipped {
get {
return ResourceManager.GetString("LocalUnzip_Unzipped", resourceCulture);
}
}
internal static string LocalUnzip_Unzipping {
get {
return ResourceManager.GetString("LocalUnzip_Unzipping", resourceCulture);
}
}
}
}

Просмотреть файл

@ -0,0 +1,24 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<data name="LocalUnzip_Error" xml:space="preserve">
<value>There was an error unzipping the file {0}: {1}</value>
</data>
<data name="LocalUnzip_Unzipped" xml:space="preserve">
<value>Successfully unzipped the file {0}</value>
</data>
<data name="LocalUnzip_Unzipping" xml:space="preserve">
<value>Unzipping {0}...</value>
</data>
</root>

Просмотреть файл

@ -0,0 +1,31 @@
using Microsoft.Build.Framework;
using Microsoft.Build.Utilities;
using System;
using System.IO;
namespace Xamarin.iOS.Tasks.Windows {
public class CreateArchiveDirectory : Task {
[Required]
public string ArchiveBasePath { get; set; }
[Output]
public string ArchiveRootDir { get; set; }
public override bool Execute ()
{
var expandedBasePath = Environment.ExpandEnvironmentVariables (ArchiveBasePath);
ArchiveRootDir = Path.Combine (expandedBasePath, DateTime.Now.ToString ("yyyy-MM-dd"));
try {
Directory.CreateDirectory (ArchiveRootDir);
} catch (Exception ex) {
Log.LogErrorFromException (ex);
return false;
}
return true;
}
}
}

Просмотреть файл

@ -0,0 +1,48 @@
using Ionic.Zip;
using Microsoft.Build.Framework;
using Microsoft.Build.Utilities;
using System;
using System.IO;
using Xamarin.iOS.Tasks.Windows.Properties;
namespace Xamarin.iOS.Tasks.Windows.Tasks {
public class LocalUnzip : Task {
[Required]
public string ZipFilePath { get; set; }
[Required]
public string ExtractionPath { get; set; }
public override bool Execute ()
{
LogTaskProperty ("ZipFilePath", ZipFilePath);
LogTaskProperty ("ExtractionPath", ExtractionPath);
try {
Log.LogMessage (Resources.LocalUnzip_Unzipping, ZipFilePath);
// Extra check to ensure the unzip won't fail if a file exists with the same path
if (File.Exists (ExtractionPath))
File.Delete (ExtractionPath);
using (var zipFile = ZipFile.Read (ZipFilePath))
zipFile.ExtractAll (ExtractionPath, ExtractExistingFileAction.OverwriteSilently);
// Fixes last write time of all files in the Zip, because the files keep the last write time from the Mac.
foreach (var filePath in Directory.EnumerateFiles (ExtractionPath, "*.*", SearchOption.AllDirectories))
new FileInfo (filePath).LastWriteTime = DateTime.Now;
Log.LogMessage (Resources.LocalUnzip_Unzipped, ZipFilePath);
} catch (Exception ex) {
Log.LogError (Resources.LocalUnzip_Error, ZipFilePath, ex.Message);
}
return !Log.HasLoggedErrors;
}
//TODO: Ideally we should get this from the LoggingExtensions in Xamarin.MacDev.Tasks. We would need the reference for that
void LogTaskProperty (string propertyName, string value)
{
Log.LogMessage (MessageImportance.Normal, " {0}: {1}", propertyName, value ?? "<null>");
}
}
}

Просмотреть файл

@ -0,0 +1,37 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildThisFileDirectory)Xamarin.Messaging.Build.targets" Condition="Exists('$(MSBuildThisFileDirectory)Xamarin.Messaging.Build.targets') And '$(MessagingBuildTargetsImported)' != 'true'" />
<PropertyGroup>
<RebuildDependsOn>
EvaluateRemoteBuild;
$(RebuildDependsOn);
</RebuildDependsOn>
<CleanDependsOn>
EvaluateRemoteBuild;
$(CleanDependsOn);
</CleanDependsOn>
<BuildDependsOn>
EvaluateRemoteBuild;
$(BuildDependsOn);
</BuildDependsOn>
</PropertyGroup>
<Target Name="EvaluateRemoteBuild">
<PropertyGroup>
<IsRemoteBuild>True</IsRemoteBuild>
<IsRemoteBuild Condition="'$(IsHotRestartBuild)' == 'True'">False</IsRemoteBuild>
</PropertyGroup>
</Target>
<!-- AfterConnect belongs to Xamarin.Messaging.Build.targets -->
<Target Name="AfterConnect" Condition="'$(IsRemoteBuild)' == 'true'" DependsOnTargets="_VerifyXcodeVersion" />
<Target Name="_VerifyXcodeVersion" Condition="'$(IsRemoteBuild)' == 'true'">
<VerifyXcodeVersion SessionId="$(BuildSessionId)" />
</Target>
<PropertyGroup>
<MessagingAppleTargetsImported>True</MessagingAppleTargetsImported>
</PropertyGroup>
</Project>

Просмотреть файл

@ -0,0 +1,29 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
***********************************************************************************************
Xamarin.iOS.Common.After.props
WARNING: DO NOT MODIFY this file unless you are knowledgeable about MSBuild and have
created a backup copy. Incorrect changes to this file will make it
impossible to load or build your projects from the command-line or the IDE.
Copyright (C) 2010-2011 Novell. All rights reserved.
Copyright (C) 2011-2013 Xamarin. All rights reserved.
***********************************************************************************************
-->
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<CopyDSYM Condition="'$(CopyDSYM)' == ''">true</CopyDSYM>
<CopyAppBundle Condition="'$(CopyAppBundle)' == ''">false</CopyAppBundle>
<ArchiveBasePath Condition="'$(ArchiveBasePath)' == ''">%LocalAppData%\Xamarin\iOS\Archives</ArchiveBasePath>
</PropertyGroup>
<ItemGroup>
<AvailableItemName Include="AtlasTexture" />
<AvailableItemName Include="ImageAsset" />
<AvailableItemName Include="SceneKitAsset" />
<AvailableItemName Include="Collada" />
<AvailableItemName Include="Metal" />
<AvailableItemName Include="ITunesArtwork" />
<AvailableItemName Include="LinkDescription" />
</ItemGroup>
</Project>

Просмотреть файл

@ -0,0 +1,406 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
***********************************************************************************************
Xamarin.iOS.Common.After.targets
WARNING: DO NOT MODIFY this file unless you are knowledgeable about MSBuild and have
created a backup copy. Incorrect changes to this file will make it
impossible to load or build your projects from the command-line or the IDE.
Copyright (C) 2010-2011 Novell. All rights reserved.
Copyright (C) 2011-2013 Xamarin. All rights reserved.
***********************************************************************************************
-->
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<UsingTask TaskName="Xamarin.MacDev.Tasks.WriteItemsToFile" AssemblyFile="$(CoreiOSSdkDirectory)Xamarin.iOS.Tasks.dll" />
<UsingTask TaskName="Xamarin.MacDev.Tasks.Zip" AssemblyFile="$(CoreiOSSdkDirectory)Xamarin.iOS.Tasks.dll" />
<UsingTask TaskName="Xamarin.iOS.Tasks.CopyArchiveFiles" AssemblyFile="$(CoreiOSSdkDirectory)Xamarin.iOS.Tasks.dll" />
<UsingTask TaskName="Xamarin.iOS.Tasks.ILLink" AssemblyFile="$(CoreiOSSdkDirectory)Xamarin.iOS.Tasks.dll" />
<UsingTask TaskName="Xamarin.iOS.Tasks.Windows.CreateArchiveDirectory" AssemblyFile="Xamarin.iOS.Tasks.Windows.dll" />
<UsingTask TaskName="Xamarin.iOS.Tasks.Windows.ResolveUniversalTypeIdentifiers" AssemblyFile="Xamarin.iOS.Tasks.Windows.dll" />
<UsingTask TaskName="Xamarin.iOS.Tasks.Windows.LocalUnzip" AssemblyFile="Xamarin.iOS.Tasks.Windows.dll" />
<Import Project="$(MSBuildThisFileDirectory)Xamarin.Messaging.Build.targets" Condition="Exists('$(MSBuildThisFileDirectory)Xamarin.Messaging.Build.targets') And '$(MessagingBuildTargetsImported)' != 'true'" />
<Import Project="$(MSBuildThisFileDirectory)Xamarin.iOS.Windows.After.targets" Condition="Exists('$(MSBuildThisFileDirectory)Xamarin.iOS.Windows.After.targets')" />
<Target Name="EnsureMacConnection"
DependsOnTargets="_SayHello"
BeforeTargets="_CleanDebugSymbols;_CleanAppBundle;_DetectAppManifest;_DetectSdkLocations;_GenerateAppBundleName;_GenerateAppExBundleName" />
<PropertyGroup>
<CreateAppBundleDependsOn>
GetBundleResourceWithLogicalNameItems;
$(CreateAppBundleDependsOn)
</CreateAppBundleDependsOn>
</PropertyGroup>
<Target Name="GetBundleResourceWithLogicalNameItems" Returns="@(_BundleResourceWithLogicalName)" DependsOnTargets="_GenerateBundleName">
<ItemGroup>
<!-- We need this metadata to fix the source in VS -->
<_BundleResourceWithLogicalName>
<BuildSessionId>$(BuildSessionId)</BuildSessionId>
<BuildServerPath>..\..\$(BuildAppName)\$(BuildSessionId)\%(Identity)</BuildServerPath>
<BuildServerPath Condition="'$(IsWatchApp)' == 'true' Or '$(IsAppExtension)' == 'true'">..\..\$(_AppBundleName)\$(BuildSessionId)\%(Identity)</BuildServerPath>
</_BundleResourceWithLogicalName>
</ItemGroup>
<CollectMonotouchReferences References="@(_MSBuildProjectReferenceExistent)">
<Output TaskParameter="MonoTouchReferences" ItemName="MonoTouchReferences" />
</CollectMonotouchReferences>
<!-- This will collect the bundle resource items in the referenced projects -->
<MSBuild Projects="@(MonoTouchReferences)" Targets="GetBundleResourceWithLogicalNameItems" BuildInParallel="$(BuildInParallel)" RebaseOutputs="true" Properties="%(MonoTouchReferences.SetConfiguration); %(MonoTouchReferences.SetPlatform)" Condition="'@(MonoTouchReferences)' != '' and '%(MonoTouchReferences.Private)' != 'false' and '$(UseCommonOutputDirectory)' != 'true'" ContinueOnError="$(ContinueOnError)">
<Output TaskParameter="TargetOutputs" ItemName="_BundleResourceWithLogicalName" />
</MSBuild>
</Target>
<PropertyGroup>
<BuildDependsOn>
$(BuildDependsOn);
CopyAppBundleFromMac;
CopyDSYMFromMac
</BuildDependsOn>
<CreateIpaDependsOn>
$(CreateIpaDependsOn);
CopyIpaFromMac
</CreateIpaDependsOn>
<_BeforeCreateIpaForDistributionDependsOn>
_SayHello;
CopyArchiveToMac;
$(_BeforeCreateIpaForDistributionDependsOn);
</_BeforeCreateIpaForDistributionDependsOn>
<ArchiveDependsOn>
$(ArchiveDependsOn);
CopyArchiveFromMac
</ArchiveDependsOn>
</PropertyGroup>
<Target Name="CopyAppBundleFromMac" Condition="'$(OutputType)' == 'Exe' And '$(IsMacEnabled)' == 'true' And '$(CopyAppBundle)' == 'true'">
<!-- Creates AppBundle dir on the output path -->
<MakeDir Condition="'$(MtouchTargetsEnabled)' And '$(IsMacEnabled)' == 'true'" SessionId="$(BuildSessionId)" Directories="$(DeviceSpecificOutputPath)AppBundle" />
<!--Zip AppBundle-->
<Zip SessionId="$(BuildSessionId)" Condition="'$(MtouchTargetsEnabled)' And '$(IsMacEnabled)' == 'true'" ToolExe="$(ZipExe)" ToolPath="$(ZipPath)" Recursive="true" Sources="$(DeviceSpecificOutputPath)$(_AppBundleName)$(AppBundleExtension)" OutputFile="$(DeviceSpecificOutputPath)AppBundle\$(_AppBundleName).zip" WorkingDirectory="$(DeviceSpecificOutputPath)AppBundle" />
<!--Copy Zip from Mac-->
<Message Text="$(DeviceSpecificOutputPath)AppBundle\$(_AppBundleName).zip" />
<CopyFileFromBuildServer Condition="'$(MtouchTargetsEnabled)' And '$(IsMacEnabled)' == 'true'" SessionId="$(BuildSessionId)" File="$(DeviceSpecificOutputPath)AppBundle\$(_AppBundleName).zip" />
<!--Unzip App Bundle on Windows-->
<LocalUnzip Condition="Exists('$(DeviceSpecificOutputPath)AppBundle\$(_AppBundleName).zip')" ZipFilePath="$(DeviceSpecificOutputPath)AppBundle\$(_AppBundleName).zip" ExtractionPath="$(DeviceSpecificOutputPath)AppBundle\$(_AppBundleName)$(AppBundleExtension)" />
<!-- Delete Zip file -->
<Delete Condition="'$(MtouchTargetsEnabled)' And '$(IsMacEnabled)' == 'true' And Exists('$(DeviceSpecificOutputPath)AppBundle\$(_AppBundleName).zip')" SessionId="$(BuildSessionId)" Files="$(DeviceSpecificOutputPath)AppBundle\$(_AppBundleName).zip" />
</Target>
<Target Name="CopyIpaFromMac" Condition="'$(OutputType)' == 'Exe' And '$(ComputedPlatform)' == 'iPhone' And '$(BuildIpa)' == 'true'">
<CopyFileFromBuildServer Condition="'$(IsAppDistribution)' == 'True'" SessionId="$(BuildSessionId)" File="$(IpaPackagePath)" TargetFile="$(DistributionPath)" />
<CopyFileFromBuildServer Condition="'$(IsAppDistribution)' != 'True'" SessionId="$(BuildSessionId)" File="$(IpaPackagePath)" />
<CopyFileFromBuildServer Condition="('$(_DistributionType)' == 'AppStore' Or '$(_DistributionType)' == 'AdHoc') And '$(EmbedOnDemandResources)' == 'false'" SessionId="$(BuildSessionId)" File="$(IpaPackageDir)\OnDemandResources\%(_AssetPack.DirectoryName)" />
<CopyFileFromBuildServer Condition="('$(_DistributionType)' == 'AppStore' Or '$(_DistributionType)' == 'AdHoc') And '$(EmbedOnDemandResources)' == 'false'" SessionId="$(BuildSessionId)" File="$(IpaPackageDir)\OnDemandResources\AssetPackManifest.plist" />
</Target>
<!-- Override Build -->
<Target Name="Build" Condition=" '$(_InvalidConfigurationWarning)' != 'true' " DependsOnTargets="$(BuildDependsOn)" Returns="@(TargetPath)">
<ItemGroup>
<TargetPath Include="$(TargetPath)">
<ArchivePath Condition="'$(ArchiveOnBuild)' == 'true'">$(ArchivePath)</ArchivePath>
</TargetPath>
</ItemGroup>
</Target>
<Target Name="CopyArchiveFromMac" Condition="'$(_CanArchive)' == 'true' And '$(ArchiveOnBuild)' == 'true'">
<Error Condition="'$(IsMacEnabled)' != 'true'" Text="A connection to a Mac is required in order to continue" />
<PropertyGroup>
<_ArchiveName>$([System.IO.Path]::GetFileName($(ArchiveDir)))</_ArchiveName>
<_ArchiveZipWorkingDirOnMac>$(DeviceSpecificIntermediateOutputPath)archives</_ArchiveZipWorkingDirOnMac>
<_ArchiveZipFileNameOnMac>$([System.Guid]::NewGuid())</_ArchiveZipFileNameOnMac>
<_ArchiveZipFileNameOnMac>$(_ArchiveZipWorkingDirOnMac)\$(_ArchiveZipFileNameOnMac.Substring(0, $(_ArchiveZipFileNameOnMac.IndexOf('-')))).zip</_ArchiveZipFileNameOnMac>
</PropertyGroup>
<MakeDir SessionId="$(BuildSessionId)" Directories="$(_ArchiveZipWorkingDirOnMac)" />
<CopyArchiveFiles ArchivePath="$(ArchiveDir)" SessionId="$(BuildSessionId)" AppName="$(BuildAppName)" TargetPath="$(_ArchiveZipWorkingDirOnMac)" />
<Zip SessionId="$(BuildSessionId)" Condition="'$(MtouchTargetsEnabled)'" ToolExe="$(ZipExe)" ToolPath="$(ZipPath)" Recursive="true" Symlinks="true" Sources="$(ArchiveDir)" OutputFile="$(_ArchiveZipFileNameOnMac)" WorkingDirectory="$([System.IO.Path]::GetDirectoryName($(ArchiveDir)))" />
<CreateArchiveDirectory ArchiveBasePath="$(ArchiveBasePath)">
<Output TaskParameter="ArchiveRootDir" PropertyName="ArchiveRootDirOnWin" />
</CreateArchiveDirectory>
<PropertyGroup>
<_ArchiveZipFileNameOnWin>$(ArchiveRootDirOnWin)\$([System.IO.Path]::GetFileName($(_ArchiveZipFileNameOnMac)))</_ArchiveZipFileNameOnWin>
<ArchivePath>$(ArchiveRootDirOnWin)\$(_ArchiveName)</ArchivePath>
</PropertyGroup>
<CopyFileFromBuildServer SessionId="$(BuildSessionId)" File="$(_ArchiveZipFileNameOnMac)" TargetFile="$(_ArchiveZipFileNameOnWin)" />
<LocalUnzip ZipFilePath="$(_ArchiveZipFileNameOnWin)" ExtractionPath="$(ArchiveRootDirOnWin)" />
<Delete Files="$(_ArchiveZipFileNameOnMac)" />
<Delete Files="$(_ArchiveZipFileNameOnWin)" />
</Target>
<Target Name="CopyArchiveToMac" Condition="'$(_CanArchive)' == 'true'">
<Error Condition="'$(IsMacEnabled)' != 'true'" Text="A connection to a Mac is required in order to continue" />
<PropertyGroup>
<_ArchiveName>$([System.IO.Path]::GetFileName($(ArchivePath)))</_ArchiveName>
</PropertyGroup>
<ItemGroup>
<_ArchiveFiles Include="$(ArchivePath)\**\*.*" Exclude="$(ArchivePath)\**\_CodeSignature\CodeResources" />
<_ArchiveItems Include="@(_ArchiveFiles)">
<TargetPath>$(MSBuildProjectDirectory)\$(DeviceSpecificIntermediateOutputPath)archives\$(_ArchiveName)\%(_ArchiveFiles.RecursiveDir)%(_ArchiveFiles.Filename)%(_ArchiveFiles.Extension)</TargetPath>
</_ArchiveItems>
<_ArchiveCodeResourceToDelete Include="$(DeviceSpecificIntermediateOutputPath)archives\$(_ArchiveName)\**\_CodeSignature\CodeResources" />
</ItemGroup>
<CopyFilesToBuildServer SessionId="$(BuildSessionId)" Files="@(_ArchiveItems)" />
<PropertyGroup>
<!-- Overrides $(ArchivePath) with the path of the file copied the Mac -->
<ArchivePath>$(MSBuildProjectDirectory)\$(DeviceSpecificIntermediateOutputPath)archives\$(_ArchiveName)</ArchivePath>
</PropertyGroup>
<!-- Ensure there's no CodeResources file in the archive folder that will be used as output of _CodesignAppBundle -->
<!-- since publishing needs to force siging the bundle on each run -->
<Delete Files="@(_ArchiveCodeResourceToDelete)" />
<!-- Copying archive on Windows to the same location it was copied on the Mac because of _CalculateCodesignAppBundleInputs -->
<CopyLongPaths SourceFiles="@(_ArchiveItems)" DestinationFiles="%(_ArchiveItems.TargetPath)">
<Output TaskParameter="CopiedFiles" ItemName="FileWrites" />
</CopyLongPaths>
</Target>
<Target Name="CopyDSYMFromMac" DependsOnTargets="_SayHello" Condition="'$(IsMacEnabled)' == 'true' And '$(IsAppExtension)' == 'false' And '$(ComputedPlatform)' == 'iPhone' And '$(CopyDSYM)' == 'true' And ('$(BuildIpa)' == 'true' Or '$(CopyAppBundle)' == 'true')">
<!--Copy watchOS Dsym folders from Mac-->
<MSBuild Projects="@(_WatchAppReferenceWithConfigurationExistent)" Targets="CopyDSYMFromMac" Properties="%(_WatchAppReferenceWithConfigurationExistent.SetConfiguration); %(_WatchAppReferenceWithConfigurationExistent.SetPlatform); BuildIpa=true" Condition="'$(IsWatchApp)' == 'false' And '@(_WatchAppReferenceWithConfigurationExistent)' != '' And '$(_BuildReferencedExtensionProjects)' != 'true'"></MSBuild>
<!--Look for all *.dsym folders int the output path of the main app -->
<GetDirectories SessionId="$(BuildSessionId)" Condition="'$(IsMacEnabled)' == 'true'" Path="$(DeviceSpecificOutputPath)" Pattern="*.dSYM">
<Output TaskParameter="Directories" ItemName="_DSYMDir" />
</GetDirectories>
<ItemGroup>
<_DSYMDir>
<DsymFileName>%(_DSYMDir.Filename)%(_DSYMDir.Extension)</DsymFileName>
</_DSYMDir>
</ItemGroup>
<MakeDir Condition="'$(MtouchTargetsEnabled)' And '$(IsMacEnabled)' == 'true' And '@(_DSYMDir)' != ''" SessionId="$(BuildSessionId)" Directories="$(DeviceSpecificIntermediateOutputPath)dsym" />
<!--Zip Dsym folders-->
<Zip SessionId="$(BuildSessionId)" Condition="'$(MtouchTargetsEnabled)' And '$(IsMacEnabled)' == 'true' And '@(_DSYMDir)' != ''" ToolExe="$(ZipExe)" ToolPath="$(ZipPath)" Recursive="true" Symlinks="true" Sources="@(_DSYMDir)" OutputFile="$(DeviceSpecificOutputPath)%(_DSYMDir.DsymFileName).zip" WorkingDirectory="$(DeviceSpecificIntermediateOutputPath)dsym" />
<CopyFileFromBuildServer Condition="'$(MtouchTargetsEnabled)' And '$(IsMacEnabled)' == 'true' And '@(_DSYMDir)' != ''" SessionId="$(BuildSessionId)" File="$(DeviceSpecificOutputPath)%(_DSYMDir.DsymFileName).zip" />
<LocalUnzip Condition="Exists('$(DeviceSpecificOutputPath)%(_DSYMDir.DsymFileName).zip')" ZipFilePath="$(DeviceSpecificOutputPath)%(_DSYMDir.DsymFileName).zip" ExtractionPath="$(DeviceSpecificOutputPath)%(_DSYMDir.DsymFileName)" />
<Delete Condition="'$(MtouchTargetsEnabled)' And '$(IsMacEnabled)' == 'true' And Exists('$(DeviceSpecificOutputPath)%(_DSYMDir.DsymFileName).zip')" SessionId="$(BuildSessionId)" Files="$(DeviceSpecificOutputPath)%(_DSYMDir.DsymFileName).zip" />
</Target>
<Target Name="_AfterCreateIpaForDistribution" Condition="'$(IsAppDistribution)' == 'true'" AfterTargets="CreateIpa" DependsOnTargets="_SaveIpaForDistributionMacPath;_SayGoodbye" />
<Target Name="_AfterValidateBundleForDistribution" Condition="'$(IsAppDistribution)' == 'true'" AfterTargets="ValidateAppStoreBundle" DependsOnTargets="_SayGoodbye" />
<Target Name="_AfterUploadBundleForDistribution" Condition="'$(IsAppDistribution)' == 'true'" AfterTargets="UploadAppStoreBundle" DependsOnTargets="_SayGoodbye" />
<Target Name="_SaveIpaForDistributionMacPath" Condition="'$(IsAppDistribution)' == 'true'" >
<WriteItemsToFile Items="$(IpaPackagePath)" ItemName="_IpaPackagePath" File="$(DeviceSpecificIntermediateOutputPath)IpaPackagePath" Overwrite="true" />
</Target>
<Target Name="_BeforeValidateAppStoreBundle" BeforeTargets="ValidateAppStoreBundle" DependsOnTargets="_ReadIpaForDistributionMacPath"/>
<Target Name="_BeforeUploadAppStoreBundle" BeforeTargets="UploadAppStoreBundle" DependsOnTargets="_ReadIpaForDistributionMacPath"/>
<Target Name="_ReadIpaForDistributionMacPath" >
<ReadItemsFromFile File="$(DeviceSpecificIntermediateOutputPath)IpaPackagePath" Condition="Exists('$(DeviceSpecificIntermediateOutputPath)IpaPackagePath')">
<Output TaskParameter="Items" ItemName="IpaPackagePath" />
</ReadItemsFromFile>
<PropertyGroup>
<FilePath>%(IpaPackagePath.Identity)</FilePath>
</PropertyGroup>
<Message Importance="high" Text="Resolved Path: $(IpaPackagePath)" />
</Target>
<Target Name="_SetMtouchProjectDirectory" AfterTargets="_SayHello" BeforeTargets="_CompileToNative">
<PropertyGroup>
<MtouchProjectDirectory>$(MacBuildPath)</MtouchProjectDirectory>
</PropertyGroup>
</Target>
<Target Name="_ResolveUniversalTypeIdentifiers" BeforeTargets="_CompileImageAssets" Condition="'$(IsMacEnabled)' == 'true'"
Inputs="@(ImageAsset);" Outputs="@(ImageAsset -> '$(DeviceSpecificIntermediateOutputPath)%(FileName)%(Extension).ResolveUTIs.stamp')">
<ItemGroup>
<_ResolveUTIOutputs Include="@(ImageAsset -> '$(DeviceSpecificIntermediateOutputPath)%(FileName)%(Extension).ResolveUTIs.stamp')" />
<FileWrites Include="@(_ResolveUTIOutputs)" />
</ItemGroup>
<ResolveUniversalTypeIdentifiers
Condition="'@(ImageAsset)' != ''"
SessionId="$(BuildSessionId)"
ImageAssets="@(ImageAsset)"
ProjectDir="$(MSBuildProjectDirectory)" />
<Touch AlwaysCreate="true" Files="@(_ResolveUTIOutputs)" />
</Target>
<!-- Copies files needed by _CopyResolvedFilesToPublishPreserveNewest to the sever -->
<Target Name="_CopyResolvedFilesToPublishPreserveNewestToServer" BeforeTargets="_CopyResolvedFilesToPublishPreserveNewest">
<ItemGroup>
<_ResolvedFileToPublishPreserveNewestToServer Include="@(_ResolvedFileToPublishPreserveNewest)">
<TargetPath>%(Identity)</TargetPath>
</_ResolvedFileToPublishPreserveNewestToServer>
</ItemGroup>
<CopyFilesToBuildServer
Condition="'$(IsMacEnabled)' == 'true'"
SessionId="$(BuildSessionId)"
Files="@(_ResolvedFileToPublishPreserveNewestToServer)" />
</Target>
<!-- Copies files needed by _CopyResolvedFilesToPublishAlways to the sever -->
<Target Name="_CopyResolvedFilesToPublishAlwaysToServer" BeforeTargets="_CopyResolvedFilesToPublishAlways">
<ItemGroup>
<_ResolvedFileToPublishAlwaysToServer Include="@(_ResolvedFileToPublishAlways)">
<TargetPath>%(Identity)</TargetPath>
</_ResolvedFileToPublishAlwaysToServer>
</ItemGroup>
<CopyFilesToBuildServer
Condition="'$(IsMacEnabled)' == 'true'"
SessionId="$(BuildSessionId)"
Files="@(_ResolvedFileToPublishAlwaysToServer)" />
</Target>
<!-- This overrides the NET SDK target, it does the same thing but we add the SessionId property so the copy is also executed remotely -->
<!-- https://github.com/dotnet/sdk/blob/master/src/Tasks/Microsoft.NET.Build.Tasks/targets/Microsoft.NET.Publish.targets#L222-L250 -->
<Target Name="_CopyResolvedFilesToPublishPreserveNewest"
DependsOnTargets="_ComputeResolvedFilesToPublishTypes"
Inputs="@(_ResolvedFileToPublishPreserveNewest)"
Outputs="@(_ResolvedFileToPublishPreserveNewest->'$(PublishDir)%(RelativePath)')">
<!--
PreserveNewest means that we will only copy the source to the destination if the source is newer.
SkipUnchangedFiles is not used for that purpose because it will copy if the source and destination
differ by size too. Instead, this target uses inputs and outputs to only copy when the source is newer.
-->
<Copy Condition="'$(IsMacEnabled)' == 'true'"
SessionId="$(BuildSessionId)"
SourceFiles="@(_ResolvedFileToPublishPreserveNewest)"
DestinationFiles="@(_ResolvedFileToPublishPreserveNewest->'$(PublishDir)%(RelativePath)')"
OverwriteReadOnlyFiles="$(OverwriteReadOnlyFiles)"
Retries="$(CopyRetryCount)"
RetryDelayMilliseconds="$(CopyRetryDelayMilliseconds)"
UseHardlinksIfPossible="$(CreateHardLinksForPublishFilesIfPossible)"
UseSymboliclinksIfPossible="$(CreateSymbolicLinksForPublishFilesIfPossible)">
<Output TaskParameter="DestinationFiles" ItemName="FileWrites"/>
</Copy>
</Target>
<!-- This overrides the NET SDK target, it does the same thing but we add the SessionId property so the copy is also executed remotely -->
<!-- https://github.com/dotnet/sdk/blob/master/src/Tasks/Microsoft.NET.Build.Tasks/targets/Microsoft.NET.Publish.targets#L252-L279 -->
<Target Name="_CopyResolvedFilesToPublishAlways" DependsOnTargets="_ComputeResolvedFilesToPublishTypes">
<!--
Use SkipUnchangedFiles to prevent unnecessary file copies. The copy will occur if the
destination doesn't exist, the source is newer than the destination, or if the source and
destination differ by file size.
-->
<Copy Condition="'$(IsMacEnabled)' == 'true'"
SessionId="$(BuildSessionId)"
SourceFiles = "@(_ResolvedFileToPublishAlways)"
DestinationFiles="@(_ResolvedFileToPublishAlways->'$(PublishDir)%(RelativePath)')"
SkipUnchangedFiles="$(SkipCopyUnchangedFiles)"
OverwriteReadOnlyFiles="$(OverwriteReadOnlyFiles)"
Retries="$(CopyRetryCount)"
RetryDelayMilliseconds="$(CopyRetryDelayMilliseconds)"
UseHardlinksIfPossible="$(CreateHardLinksForPublishFilesIfPossible)"
UseSymboliclinksIfPossible="$(CreateSymbolicLinksForPublishFilesIfPossible)">
<Output TaskParameter="DestinationFiles" ItemName="FileWrites"/>
</Copy>
</Target>
<PropertyGroup>
<_UpdateDynamicLibraryIdDependsOn>
$(_UpdateDynamicLibraryIdDependsOn);
CopyDynamicLibrariesToMac;
</_UpdateDynamicLibraryIdDependsOn>
</PropertyGroup>
<Target Name="CopyDynamicLibrariesToMac" Condition="'$(_PlatformName)' != 'macOS'">
<ItemGroup>
<_MonoLibraryFixToMac Include="%(_MonoLibraryFix.FullPath)">
<TargetPath>%(FullPath)</TargetPath>
</_MonoLibraryFixToMac>
</ItemGroup>
<CopyFilesToBuildServer
Condition="'$(IsMacEnabled)' == 'true'"
SessionId="$(BuildSessionId)"
Files="@(_MonoLibraryFixToMac)" />
</Target>
<!-- Overrides Core SDK target to remote the ILLink execution -->
<!-- https://github.com/dotnet/sdk/blob/cdf57465e1cba9e44b5c9a76a403d41b1b8f178c/src/Tasks/Microsoft.NET.Build.Tasks/targets/Microsoft.NET.ILLink.targets#L76-L132 -->
<Target Name="_RunILLink"
DependsOnTargets="_ComputeManagedAssemblyToLink;PrepareForILLink"
Inputs="$(MSBuildAllProjects);@(ManagedAssemblyToLink);@(TrimmerRootDescriptor);@(ReferencePath)"
Outputs="$(_LinkSemaphore)">
<PropertyGroup>
<!-- TODO: get the dotnet path from the Mac -->
<_RemoteDotNetDir>/usr/local/share/dotnet/</_RemoteDotNetDir>
<!-- We need to use net5.0 because when building from VS it sets MSBuildRuntimeType to Core and will pick net472 (which doesn't contain the illink assembly) -->
<_ILLinkDir>$(_ILLinkTasksDirectoryRoot)net5.0/</_ILLinkDir>
<_ILLinkRemoteDir>$([System.String]::Copy('$(_ILLinkDir)').Replace('$(NetCoreRoot)', '$(_RemoteDotNetDir)'))/</_ILLinkRemoteDir>
</PropertyGroup>
<ItemGroup>
<!-- Include Debug symbols as input so those are copied to the server -->
<_ILLinkDebugSymbols Include="@(_DebugSymbolsIntermediatePath)" Condition="'$(_DebugSymbolsProduced)'=='true'" />
</ItemGroup>
<ItemGroup>
<!-- Replace the custom steps using the remote file paths for those -->
<_TrimmerCustomSteps Remove="$(_AdditionalTaskAssembly)" />
<_TrimmerCustomSteps Include="$([System.String]::Copy('$(_AdditionalTaskAssembly)').Replace('$(NetCoreRoot)', '$(_RemoteDotNetDir)'))">
<BeforeStep>LoadReferencesStep</BeforeStep>
<Type>Xamarin.SetupStep</Type>
</_TrimmerCustomSteps>
</ItemGroup>
<Delete SessionId="$(BuildSessionId)" Files="@(_LinkedResolvedFileToPublishCandidate)" />
<Xamarin.iOS.Tasks.ILLink
SessionId="$(BuildSessionId)"
AssemblyPaths="@(ManagedAssemblyToLink)"
ReferenceAssemblyPaths="@(ReferencePath)"
RootAssemblyNames="@(TrimmerRootAssembly)"
TrimMode="$(TrimMode)"
RemoveSymbols="$(TrimmerRemoveSymbols)"
FeatureSettings="@(_TrimmerFeatureSettings)"
CustomData="@(_TrimmerCustomData)"
BeforeFieldInit="$(_TrimmerBeforeFieldInit)"
OverrideRemoval="$(_TrimmerOverrideRemoval)"
UnreachableBodies="$(_TrimmerUnreachableBodies)"
UnusedInterfaces="$(_TrimmerUnusedInterfaces)"
IPConstProp="$(_TrimmerIPConstProp)"
Sealer="$(_TrimmerSealer)"
Warn="$(ILLinkWarningLevel)"
NoWarn="$(NoWarn)"
TreatWarningsAsErrors="$(ILLinkTreatWarningsAsErrors)"
WarningsAsErrors="$(WarningsAsErrors)"
WarningsNotAsErrors="$(WarningsNotAsErrors)"
CustomSteps="@(_TrimmerCustomSteps)"
RootDescriptorFiles="@(TrimmerRootDescriptor)"
OutputDirectory="$(IntermediateLinkDir)"
DumpDependencies="$(_TrimmerDumpDependencies)"
ExtraArgs="$(_ExtraTrimmerArgs)"
ToolExe="$(_DotNetHostFileName)"
ToolPath="$(_DotNetHostDirectory)"
ILLinkPath="$(_ILLinkRemoteDir)illink.dll"
LinkerItemsDirectory="$(_LinkerItemsDirectory)"
DebugSymbols="@(_ILLinkDebugSymbols)"
ContinueOnError="ErrorAndContinue">
<Output TaskParameter="ExitCode" PropertyName="_ILLinkExitCode" />
<Output TaskParameter="LinkedItems" ItemName="_XamarinLinkedItems" />
<Output TaskParameter="LinkerOutputItems" ItemName="_XamarinLinkerItems" />
</Xamarin.iOS.Tasks.ILLink>
<Touch Files="$(_LinkSemaphore)" AlwaysCreate="true" Condition=" '$(_ILLinkExitCode)' == '0' " />
</Target>
<!-- Allows providing SDK-specific target overrides -->
<PropertyGroup>
<XamarinAppleSdkTargets>$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), 'Xamarin.Apple.Sdk.targets'))\Xamarin.Apple.Sdk.targets</XamarinAppleSdkTargets>
</PropertyGroup>
<Import Project="$(XamarinAppleSdkTargets)" Condition="'$(XamarinAppleSdkTargetsImported)' != 'true' And Exists('$(XamarinAppleSdkTargets)')" />
</Project>

Просмотреть файл

@ -0,0 +1,19 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
***********************************************************************************************
Xamarin.iOS.Common.Before.props
WARNING: DO NOT MODIFY this file unless you are knowledgeable about MSBuild and have
created a backup copy. Incorrect changes to this file will make it
impossible to load or build your projects from the command-line or the IDE.
Copyright (C) 2011-2016 Xamarin. All rights reserved.
***********************************************************************************************
-->
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<!-- Allows providing SDK-specific property overrides -->
<PropertyGroup>
<XamarinAppleSdkProps>$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), 'Xamarin.Apple.Sdk.props'))\Xamarin.Apple.Sdk.props</XamarinAppleSdkProps>
</PropertyGroup>
<Import Project="$(XamarinAppleSdkProps)" Condition="'$(XamarinAppleSdkPropsImported)' != 'true' And Exists('$(XamarinAppleSdkProps)')" />
</Project>

Просмотреть файл

@ -0,0 +1,21 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
***********************************************************************************************
Xamarin.iOS.Common.Before.targets
WARNING: DO NOT MODIFY this file unless you are knowledgeable about MSBuild and have
created a backup copy. Incorrect changes to this file will make it
impossible to load or build your projects from the command-line or the IDE.
Copyright (C) 2010-2011 Novell. All rights reserved.
Copyright (C) 2011-2013 Xamarin. All rights reserved.
***********************************************************************************************
-->
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildThisFileDirectory)Xamarin.iOS.Windows.props" Condition="Exists('$(MSBuildThisFileDirectory)Xamarin.iOS.Windows.props')" />
<UsingTask TaskName="Xamarin.iOS.Tasks.ConvertPdbToMdb" AssemblyFile="$(CoreiOSSdkDirectory)Xamarin.iOS.Tasks.dll" />
<UsingTask TaskName="Xamarin.iOS.Tasks.CollectMonotouchReferences" AssemblyFile="$(CoreiOSSdkDirectory)Xamarin.iOS.Tasks.dll" />
<Import Project="$(MSBuildThisFileDirectory)Xamarin.iOS.Windows.Before.targets" Condition="Exists('$(MSBuildThisFileDirectory)Xamarin.iOS.Windows.Before.targets')" />
</Project>

Просмотреть файл

@ -0,0 +1,24 @@
<?xml version="1.0" encoding="utf-8"?>
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildThisFileDirectory)Xamarin.iOS.Windows.props" Condition="Exists('$(MSBuildThisFileDirectory)Xamarin.iOS.Windows.props')" />
<UsingTask TaskName="Xamarin.iOS.Tasks.PrepareObjCBindingNativeFrameworks" AssemblyFile="$(CoreiOSSdkDirectory)Xamarin.iOS.Tasks.dll" />
<Import Project="$(MSBuildThisFileDirectory)Xamarin.Messaging.Build.targets" Condition="Exists('$(MSBuildThisFileDirectory)Xamarin.Messaging.Build.targets') And '$(MessagingBuildTargetsImported)' != 'true'" />
<Target Name="CopyCompressedNativeFrameworkResources" Condition="'@(_NativeFrameworkResource)' != ''" AfterTargets="_CompressNativeFrameworkResources">
<CopyFileFromBuildServer SessionId="$(BuildSessionId)" File="$(IntermediateOutputPath)%(_NativeFramework.Filename)%(_NativeFramework.Extension)" />
</Target>
<!-- This target copies the ObjCBindingNativeFrameworks to the Mac -->
<Target Name="PrepareObjCBindingNativeFrameworks" BeforeTargets="_CompressObjCBindingNativeFrameworkResources">
<PrepareObjCBindingNativeFrameworks SessionId="$(BuildSessionId)" ObjCBindingNativeFrameworks="@(ObjCBindingNativeFramework)" />
</Target>
<!-- Allows providing SDK-specific property overrides -->
<PropertyGroup>
<XamarinAppleSdkProps>$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), 'Xamarin.Apple.Sdk.props'))\Xamarin.Apple.Sdk.props</XamarinAppleSdkProps>
</PropertyGroup>
<Import Project="$(XamarinAppleSdkProps)" Condition="'$(XamarinAppleSdkPropsImported)' != 'true' And Exists('$(XamarinAppleSdkProps)')" />
</Project>

Некоторые файлы не были показаны из-за слишком большого количества измененных файлов Показать больше