Skip to content

Commit

Permalink
Remove xcsync from SDK and install as .NET Global Tool
Browse files Browse the repository at this point in the history
(cherry picked from commit 44b44a8)
  • Loading branch information
mcumming committed Aug 27, 2024
1 parent 92be6e8 commit f53ae00
Show file tree
Hide file tree
Showing 15 changed files with 65 additions and 178 deletions.
1 change: 1 addition & 0 deletions dotnet/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ $(1)_NUGET_TARGETS = \
$(DOTNET_DESTDIR)/$($(1)_NUGET_SDK_NAME)/targets/Xamarin.Shared.Sdk.props \
$(DOTNET_DESTDIR)/$($(1)_NUGET_SDK_NAME)/targets/Xamarin.Shared.Sdk.Trimming.props \
$(DOTNET_DESTDIR)/$($(1)_NUGET_SDK_NAME)/targets/Xamarin.Shared.Sdk.targets \
$(DOTNET_DESTDIR)/$($(1)_NUGET_SDK_NAME)/targets/dotnet-xcsync.targets \

endef
$(foreach platform,$(DOTNET_PLATFORMS),$(eval $(call DefineTargets,$(platform))))
Expand Down
3 changes: 0 additions & 3 deletions dotnet/Microsoft.MacCatalyst.Sdk/data/UnixFilePermissions.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,4 @@
<!-- bgen -->
<File Path="tools/bin/bgen" Permission="755" />
<File Path="tools/lib/bgen/bgen" Permission="755" />
<!-- xcsync -->
<File Path="tools/bin/dotnet-xcsync" Permission="755" />
<File Path="tools/lib/xcsync" Permission="755" />
</FileList>
3 changes: 0 additions & 3 deletions dotnet/Microsoft.iOS.Sdk/data/UnixFilePermissions.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,4 @@
<!-- mlaunch -->
<File Path="tools/bin/mlaunch" Permission="755" />
<File Path="tools/lib/mlaunch/mlaunch.app/Contents/MacOS/mlaunch" Permission="755" />
<!-- xcsync -->
<File Path="tools/bin/dotnet-xcsync" Permission="755" />
<File Path="tools/lib/xcsync" Permission="755" />
</FileList>
3 changes: 0 additions & 3 deletions dotnet/Microsoft.macOS.Sdk/data/UnixFilePermissions.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,4 @@
<!-- bgen -->
<File Path="tools/bin/bgen" Permission="755" />
<File Path="tools/lib/bgen/bgen" Permission="755" />
<!-- xcsync -->
<File Path="tools/bin/dotnet-xcsync" Permission="755" />
<File Path="tools/lib/xcsync" Permission="755" />
</FileList>
3 changes: 0 additions & 3 deletions dotnet/Microsoft.tvOS.Sdk/data/UnixFilePermissions.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,4 @@
<!-- mlaunch -->
<File Path="tools/bin/mlaunch" Permission="755" />
<File Path="tools/lib/mlaunch/mlaunch.app/Contents/MacOS/mlaunch" Permission="755" />
<!-- xcsync -->
<File Path="tools/bin/dotnet-xcsync" Permission="755" />
<File Path="tools/lib/xcsync" Permission="755" />
</FileList>
59 changes: 0 additions & 59 deletions dotnet/Workloads/SignList.xml
Original file line number Diff line number Diff line change
Expand Up @@ -133,65 +133,6 @@
<FirstParty Include="Microsoft.MacCatalyst.dll" />
<FirstParty Include="Microsoft.macOS.dll" />
<FirstParty Include="Microsoft.tvOS.dll" />

<!-- Adding xcsync dlls -->
<FirstParty Include="Microsoft.Bcl.AsyncInterfaces.dll" />
<FirstParty Include="Microsoft.CodeAnalysis.CSharp.dll" />
<FirstParty Include="Microsoft.CodeAnalysis.CSharp.resources.dll" />
<FirstParty Include="Microsoft.CodeAnalysis.CSharp.Workspaces.dll" />
<FirstParty Include="Microsoft.CodeAnalysis.CSharp.Workspaces.resources.dll" />
<FirstParty Include="Microsoft.CodeAnalysis.dll" />
<FirstParty Include="Microsoft.CodeAnalysis.resources.dll" />
<FirstParty Include="Microsoft.CodeAnalysis.VisualBasic.dll" />
<FirstParty Include="Microsoft.CodeAnalysis.VisualBasic.resources.dll" />
<FirstParty Include="Microsoft.CodeAnalysis.VisualBasic.Workspaces.dll" />
<FirstParty Include="Microsoft.CodeAnalysis.VisualBasic.Workspaces.resources.dll" />
<FirstParty Include="Microsoft.CodeAnalysis.Workspaces.dll" />
<FirstParty Include="Microsoft.CodeAnalysis.Workspaces.MSBuild.BuildHost.dll" />
<FirstParty Include="Microsoft.CodeAnalysis.Workspaces.MSBuild.BuildHost.exe" />
<FirstParty Include="Microsoft.CodeAnalysis.Workspaces.MSBuild.dll" />
<FirstParty Include="Microsoft.CodeAnalysis.Workspaces.MSBuild.resources.dll" />
<FirstParty Include="Microsoft.CodeAnalysis.Workspaces.resources.dll" />
<FirstParty Include="Microsoft.Extensions.Configuration.Abstractions.dll" />
<FirstParty Include="Microsoft.Extensions.Configuration.Binder.dll" />
<FirstParty Include="Microsoft.Extensions.Configuration.dll" />
<FirstParty Include="Microsoft.Extensions.DependencyInjection.Abstractions.dll" />
<FirstParty Include="Microsoft.Extensions.DependencyInjection.dll" />
<FirstParty Include="Microsoft.Extensions.Logging.Abstractions.dll" />
<FirstParty Include="Microsoft.Extensions.Logging.Configuration.dll" />
<FirstParty Include="Microsoft.Extensions.Logging.Console.dll" />
<FirstParty Include="Microsoft.Extensions.Logging.dll" />
<FirstParty Include="Microsoft.Extensions.Options.ConfigurationExtensions.dll" />
<FirstParty Include="Microsoft.Extensions.Options.dll" />
<FirstParty Include="Microsoft.Extensions.Primitives.dll" />
<FirstParty Include="Microsoft.VisualStudio.Setup.Configuration.Interop.dll" />
<FirstParty Include="System.Buffers.dll" />
<FirstParty Include="System.CodeDom.dll" />
<FirstParty Include="System.CommandLine.dll" />
<FirstParty Include="System.CommandLine.resources.dll" />
<FirstParty Include="System.Composition.AttributedModel.dll" />
<FirstParty Include="System.Composition.Convention.dll" />
<FirstParty Include="System.Composition.Hosting.dll" />
<FirstParty Include="System.Composition.Runtime.dll" />
<FirstParty Include="System.Composition.TypedParts.dll" />
<FirstParty Include="System.Configuration.ConfigurationManager.dll" />
<FirstParty Include="System.Diagnostics.EventLog.dll" />
<FirstParty Include="System.Diagnostics.EventLog.Messages.dll" />
<FirstParty Include="System.IO.Pipelines.dll" />
<FirstParty Include="System.Numerics.Vectors.dll" />
<FirstParty Include="System.Resources.Extensions.dll" />
<FirstParty Include="System.Runtime.CompilerServices.Unsafe.dll" />
<FirstParty Include="System.Security.Cryptography.Pkcs.dll" />
<FirstParty Include="System.Security.Cryptography.ProtectedData.dll" />
<FirstParty Include="System.Security.Cryptography.Xml.dll" />
<FirstParty Include="System.Security.Permissions.dll" />
<FirstParty Include="System.Text.Encoding.CodePages.dll" />
<FirstParty Include="System.Text.Encodings.Web.dll" />
<FirstParty Include="System.Threading.Tasks.Extensions.dll" />
<FirstParty Include="System.ValueTuple.dll" />
<FirstParty Include="System.Windows.Extensions.dll" />
<FirstParty Include="xcsync.dll" />
<FirstParty Include="xcsync.resources.dll" />
</ItemGroup>

<Import Project="$(MSBuildThisFileDirectory)SignList.targets" />
Expand Down
1 change: 0 additions & 1 deletion dotnet/targets/Xamarin.Shared.Sdk.props
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,6 @@
<AllowPublishAotWithoutRuntimeIdentifier Condition="'$(AllowPublishAotWithoutRuntimeIdentifier)' == '' And '$(_UseNativeAot)' == 'true'">true</AllowPublishAotWithoutRuntimeIdentifier>
<AllowSelfContainedWithoutRuntimeIdentifier Condition="'$(AllowSelfContainedWithoutRuntimeIdentifier)' == ''">true</AllowSelfContainedWithoutRuntimeIdentifier>

<XcsyncPath Condition="'$(XcsyncPath)' == ''">$(_XamarinSdkRootDirectoryOnMac)tools/bin</XcsyncPath>
</PropertyGroup>

<!-- Set the default RuntimeIdentifier if not already specified. -->
Expand Down
37 changes: 1 addition & 36 deletions dotnet/targets/Xamarin.Shared.Sdk.targets
Original file line number Diff line number Diff line change
Expand Up @@ -2425,42 +2425,6 @@ global using nfloat = global::System.Runtime.InteropServices.NFloat%3B
</ItemGroup>
</Target>

<Target Name="ComputeXcsyncArguments">
<PropertyGroup>
<xcSyncExecute>PATH=$(XcsyncPath):$PATH $(DOTNET_HOST_PATH) xcsync</xcSyncExecute>
<xcSyncProjectFile Condition="'$(xcSyncProjectFile)' == ''">$(MSBuildProjectFullPath)</xcSyncProjectFile>
<xcSyncXcodeFolder Condition="'$(xcSyncXcodeFolder)' == ''">$(IntermediateOutputPath)xcode</xcSyncXcodeFolder>
<xcSyncTargetFrameworkMoniker Condition="'$(xcSyncTargetFrameworkMoniker)' == ''">$(TargetFramework)</xcSyncTargetFrameworkMoniker>
<xcSyncVerbosity Condition="'$(xcSyncVerbosity)' == ''">Diagnostic</xcSyncVerbosity>
<xcSyncOpenXcode Condition="'$(xcSyncOpenXcode)' == ''">true</xcSyncOpenXcode>

<XcsyncCommonArguments Condition="'$(xcSyncProjectFile)' != ''">$(XcsyncCommonArguments) -p "$(xcSyncProjectFile)"</XcsyncCommonArguments>
<XcsyncCommonArguments Condition="'$(xcSyncXcodeFolder)' != ''">$(XcsyncCommonArguments) -t "$(xcSyncXcodeFolder)"</XcsyncCommonArguments>
<XcsyncCommonArguments Condition="'$(xcSyncTargetFrameworkMoniker)' != ''">$(XcsyncCommonArguments) -tfm $(xcSyncTargetFrameworkMoniker)</XcsyncCommonArguments>
<XcsyncCommonArguments Condition="'$(xcSyncVerbosity)' != ''">$(XcsyncCommonArguments) -v $(xcSyncVerbosity)</XcsyncCommonArguments>
<XcsyncCommonArguments>$(XcsyncCommonArguments) --dotnet-path "$([System.IO.Path]::GetDirectoryName($(DOTNET_HOST_PATH)))"</XcsyncCommonArguments>

<XcsyncGenerateArguments>$(XcsyncCommonArguments) --force</XcsyncGenerateArguments>
<XcsyncGenerateArguments Condition="'$(xcSyncOpenXcode)' != 'false'">$(XcsyncGenerateArguments) --open</XcsyncGenerateArguments>

<XcsyncSyncArguments>$(XcsyncCommonArguments)</XcsyncSyncArguments>
</PropertyGroup>
</Target>

<Target Name="xcsync-generate" DependsOnTargets="ComputeXcsyncArguments">
<Message Importance="Normal" Text="Add $(XcsyncPath) to your path to invoke xcSync directly from the commandline." />
<Message Importance="Low" Text="Executing xcSync using: $(xcSyncExecute) generate $(XcsyncGenerateArguments)" />

<Exec SessionId="$(BuildSessionId)" Command="$(xcSyncExecute) generate $(XcsyncGenerateArguments)" />
</Target>

<Target Name="xcsync-sync" DependsOnTargets="ComputeXcsyncArguments">
<Message Importance="Normal" Text="Add $(XcsyncPath) to your path to invoke xcSync directly from the commandline." />
<Message Importance="Low" Text="Executing xcSync using: $(xcSyncExecute) sync $(XcsyncSyncArguments)" />

<Exec SessionId="$(BuildSessionId)" Command="$(xcSyncExecute) sync $(XcsyncSyncArguments)" />
</Target>

<!-- Import existing targets -->

<PropertyGroup>
Expand Down Expand Up @@ -2493,4 +2457,5 @@ global using nfloat = global::System.Runtime.InteropServices.NFloat%3B
<Import Project="$(_TargetsDirectory)Xamarin.MacCatalyst.AppExtension.$(_ProjectLanguage).targets" Condition="'$(_ProjectType)' == 'MacCatalystAppExtensionProject' " />
<Import Project="$(_TargetsDirectory)Xamarin.MacCatalyst.ObjCBinding.$(_ProjectLanguage).targets" Condition="'$(_ProjectType)' == 'MacCatalystBindingProject' " />

<Import Project="dotnet-xcsync.targets" />
</Project>
62 changes: 62 additions & 0 deletions dotnet/targets/dotnet-xcsync.targets
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
<Project>
<Target Name="ComputeXcsyncArguments">
<PropertyGroup>
<XcsyncExecute>$(DOTNET_HOST_PATH) xcsync</XcsyncExecute>
<XcsyncProjectFile Condition="'$(XcsyncProjectFile)' == ''">$(MSBuildProjectFullPath)</XcsyncProjectFile>
<XcsyncXcodeFolder Condition="'$(XcsyncXcodeFolder)' == ''">$(IntermediateOutputPath)xcode</XcsyncXcodeFolder>
<XcsyncTargetFrameworkMoniker Condition="'$(XcsyncTargetFrameworkMoniker)' == ''">$(TargetFramework)</XcsyncTargetFrameworkMoniker>
<XcsyncVerbosity Condition="'$(XcsyncVerbosity)' == ''">Diagnostic</XcsyncVerbosity>
<XcsyncOpenXcode Condition="'$(XcsyncOpenXcode)' == ''">true</XcsyncOpenXcode>

<XcsyncCommonArguments Condition="'$(XcsyncProjectFile)' != ''">$(XcsyncCommonArguments) -p "$(XcsyncProjectFile)"</XcsyncCommonArguments>
<XcsyncCommonArguments Condition="'$(XcsyncXcodeFolder)' != ''">$(XcsyncCommonArguments) -t "$(XcsyncXcodeFolder)"</XcsyncCommonArguments>
<XcsyncCommonArguments Condition="'$(XcsyncTargetFrameworkMoniker)' != ''">$(XcsyncCommonArguments) -tfm $(XcsyncTargetFrameworkMoniker)</XcsyncCommonArguments>
<XcsyncCommonArguments Condition="'$(XcsyncVerbosity)' != ''">$(XcsyncCommonArguments) -v $(XcsyncVerbosity)</XcsyncCommonArguments>
<XcsyncCommonArguments>$(XcsyncCommonArguments) --dotnet-path "$([System.IO.Path]::GetDirectoryName($(DOTNET_HOST_PATH)))"</XcsyncCommonArguments>

<XcsyncGenerateArguments>$(XcsyncCommonArguments) --force</XcsyncGenerateArguments>
<XcsyncGenerateArguments Condition="'$(XcsyncOpenXcode)' != 'false'">$(XcsyncGenerateArguments) --open</XcsyncGenerateArguments>

<XcsyncSyncArguments>$(XcsyncCommonArguments)</XcsyncSyncArguments>
</PropertyGroup>
</Target>

<Target Name="CheckXcsyncInstalled">
<Exec ContinueOnError="True" IgnoreStandardErrorWarningFormat="true" Command="$(XcsyncExecute)" ConsoleToMSBuild="true">
<Output TaskParameter="ExitCode" PropertyName="ErrorCode"/>
</Exec>
<Exec ContinueOnError="True" IgnoreStandardErrorWarningFormat="true" Command="$(DOTNET_HOST_PATH) tool run xcsync" Condition="'$(ErrorCode)' != '0'" ConsoleToMSBuild="true">
<Output TaskParameter="ExitCode" PropertyName="ErrorCode"/>
</Exec>
<Message Importance="High" Text="The xcsync tool is not installed." Condition="'$(ErrorCode)' != '0'" />
<PropertyGroup>
<XcsyncInstalled Condition="'$(ErrorCode)' == '0'">True</XcsyncInstalled>
<XcsyncInstalled Condition="'$(ErrorCode)' != '0'">False</XcsyncInstalled>
</PropertyGroup>
</Target>

<Target Name="InstallXcsync" DependsOnTargets="CheckXcsyncInstalled">
<Message Importance="High" Text="Installing xcsync tool..." Condition="'$(XcsyncInstalled)' == 'False'"/>
<Exec ContinueOnError="True" IgnoreStandardErrorWarningFormat="true" Command="$(DOTNET_HOST_PATH) tool install -g dotnet-xcsync --prerelease" Condition="'$(XcsyncInstalled)' == 'False'" ConsoleToMSBuild="true">
<Output TaskParameter="ExitCode" PropertyName="ErrorCode"/>
</Exec>
<Message Importance="High" Text="The xcsync tool could not be installed. Please install xcsync by running 'dotnet tool install -g dotnet-xcsync'." Condition="'$(ErrorCode)' != '0'" />
<PropertyGroup>
<XcsyncInstalled Condition="'$(ErrorCode)' == '0'">True</XcsyncInstalled>
<XcsyncInstalled Condition="'$(ErrorCode)' != '0'">False</XcsyncInstalled>
</PropertyGroup>
</Target>

<Target Name="xcsync-generate" DependsOnTargets="ComputeXcsyncArguments;InstallXcsync">
<Message Importance="Low" Text="Executing xcsync using: $(XcsyncExecute) generate $(XcsyncGenerateArguments)" Condition="'$(XcsyncInstalled)' == 'True'" />

<Exec SessionId="$(BuildSessionId)" Command="$(XcsyncExecute) generate $(XcsyncGenerateArguments)" Condition="'$(XcsyncInstalled)' == 'True'" />
</Target>

<Target Name="xcsync-sync" DependsOnTargets="ComputeXcsyncArguments;InstallXcsync">
<Message Importance="Low" Text="Executing xcsync using: $(XcsyncExecute) sync $(XcsyncSyncArguments)" Condition="'$(XcsyncInstalled)' == 'True'" />

<Exec SessionId="$(BuildSessionId)" Command="$(XcsyncExecute) sync $(XcsyncSyncArguments)" Condition="'$(XcsyncInstalled)' == 'True'" />
</Target>

</Project>
2 changes: 0 additions & 2 deletions mk/xamarin.mk
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,7 @@ endif

# Available versions can be seen here:
# https://dev.azure.com/dnceng/public/_artifacts/feed/dotnet-eng/NuGet/Microsoft.Tools.Mlaunch/versions
# https://dev.azure.com/dnceng/public/_artifacts/feed/dotnet-eng/NuGet/Microsoft.Tools.xcsync/versions
MLAUNCH_NUGET_VERSION=1.0.142
XCSYNC_NUGET_VERSION=1.0.90

define CheckVersionTemplate
check-$(1)::
Expand Down
2 changes: 1 addition & 1 deletion tools/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ ifdef INCLUDE_MTOUCH
SUBDIRS += mtouch
endif

SUBDIRS+=mlaunch siminstaller xcsync
SUBDIRS+=mlaunch siminstaller

ifdef ENABLE_DOTNET
ifdef INCLUDE_XAMARIN_LEGACY
Expand Down
2 changes: 0 additions & 2 deletions tools/xcsync/.gitignore

This file was deleted.

37 changes: 0 additions & 37 deletions tools/xcsync/Makefile

This file was deleted.

15 changes: 0 additions & 15 deletions tools/xcsync/README.md

This file was deleted.

13 changes: 0 additions & 13 deletions tools/xcsync/download-xcsync.csproj

This file was deleted.

0 comments on commit f53ae00

Please # to comment.