Skip to content

Commit

Permalink
EditorFeatures.Cocoa: Build with net6.0-macos
Browse files Browse the repository at this point in the history
Use a 6.0.200 SDK and macos workload 12.1.301-preview.13.7

Builds fine on Windows. On Mac, first build fails with:

/usr/local/share/dotnet/sdk/6.0.200/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.FrameworkReferenceResolution.targets(356,5): error NETSDK1073: The FrameworkReference 'Microsoft.WindowsDesktop.App.WPF' was not recognized [/Users/sandy/xam-git/roslyn/src/EditorFeatures/Core/Microsoft.CodeAnalysis.EditorFeatures.csproj]

Second build succeeds.
  • Loading branch information
sandyarmstrong committed Mar 1, 2022
1 parent ebac581 commit 53c35bb
Show file tree
Hide file tree
Showing 6 changed files with 45 additions and 9 deletions.
6 changes: 3 additions & 3 deletions eng/Versions.props
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,7 @@
<MicrosoftVisualStudioExtensibilityTestingVersion>0.1.127-beta</MicrosoftVisualStudioExtensibilityTestingVersion>
<!-- CodeStyleAnalyzerVersion should we updated together with version of dotnet-format in dotnet-tools.json -->
<CodeStyleAnalyzerVersion>4.0.1</CodeStyleAnalyzerVersion>
<VisualStudioEditorPackagesVersion>16.10.230</VisualStudioEditorPackagesVersion>
<VisualStudioEditorNewPackagesVersion>17.0.487</VisualStudioEditorNewPackagesVersion>
<VisualStudioEditorNewPackagesVersion>17.2.178-preview</VisualStudioEditorNewPackagesVersion>
<ILAsmPackageVersion>5.0.0-alpha1.19409.1</ILAsmPackageVersion>
<ILDAsmPackageVersion>5.0.0-preview.1.20112.8</ILDAsmPackageVersion>
<MicrosoftVisualStudioLanguageServerProtocolPackagesVersion>17.2.3</MicrosoftVisualStudioLanguageServerProtocolPackagesVersion>
Expand Down Expand Up @@ -136,6 +135,7 @@
<MicrosoftVisualStudioEditorVersion>$(VisualStudioEditorNewPackagesVersion)</MicrosoftVisualStudioEditorVersion>
<MicrosoftVisualStudioExtensibilityTestingSourceGeneratorVersion>$(MicrosoftVisualStudioExtensibilityTestingVersion)</MicrosoftVisualStudioExtensibilityTestingSourceGeneratorVersion>
<MicrosoftVisualStudioExtensibilityTestingXunitVersion>$(MicrosoftVisualStudioExtensibilityTestingVersion)</MicrosoftVisualStudioExtensibilityTestingXunitVersion>
<MicrosoftVisualStudioFPFVersion>$(VisualStudioEditorNewPackagesVersion)</MicrosoftVisualStudioFPFVersion>
<MicrosoftVisualStudioGraphModelVersion>$(MicrosoftVisualStudioShellPackagesVersion)</MicrosoftVisualStudioGraphModelVersion>
<MicrosoftVisualStudioImageCatalogVersion>$(MicrosoftVisualStudioShellPackagesVersion)</MicrosoftVisualStudioImageCatalogVersion>
<MicrosoftVisualStudioImagingVersion>$(MicrosoftVisualStudioShellPackagesVersion)</MicrosoftVisualStudioImagingVersion>
Expand Down Expand Up @@ -173,7 +173,7 @@
<MicrosoftVisualStudioTextLogicVersion>$(VisualStudioEditorNewPackagesVersion)</MicrosoftVisualStudioTextLogicVersion>
<MicrosoftVisualStudioTextUIVersion>$(VisualStudioEditorNewPackagesVersion)</MicrosoftVisualStudioTextUIVersion>
<MicrosoftVisualStudioTextUIWpfVersion>$(VisualStudioEditorNewPackagesVersion)</MicrosoftVisualStudioTextUIWpfVersion>
<MicrosoftVisualStudioTextUICocoaVersion>$(VisualStudioEditorPackagesVersion)</MicrosoftVisualStudioTextUICocoaVersion>
<MicrosoftVisualStudioTextUICocoaVersion>$(VisualStudioEditorNewPackagesVersion)</MicrosoftVisualStudioTextUICocoaVersion>
<MicrosoftVisualStudioThreadingAnalyzersVersion>17.0.64</MicrosoftVisualStudioThreadingAnalyzersVersion>
<MicrosoftVisualStudioThreadingVersion>17.0.64</MicrosoftVisualStudioThreadingVersion>
<MicrosoftVisualStudioUtilitiesVersion>$(MicrosoftVisualStudioShellPackagesVersion)</MicrosoftVisualStudioUtilitiesVersion>
Expand Down
24 changes: 24 additions & 0 deletions eng/build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -723,6 +723,30 @@ try {

if ($restore) {
&(Ensure-DotNetSdk) tool restore

# TODO: Move this to Install-DotNetWorkload.ps1
# TODO: Implement the same thing in bash for build.sh, even though we don't build EF.Cocoa on Unix
foreach ($workload in $GlobalJson.workloads.PSObject.Properties) {
$workloadName = $workload.Name
$shortWorkloadName = $workloadName.Substring($workloadName.LastIndexOf(".") + 1)

$rollbackJson = @{}
$rollbackJson[$workloadName] = $workload.Value.version

$rollbackFile = New-TemporaryFile
$rollbackJson | ConvertTo-Json | Set-Content -Path $rollbackFile

$sourcesArgs = @()
foreach ($source in $workload.Value.sources) {
$sourcesArgs += "--source"
$sourcesArgs += $source
}

# NOTE: This requires elevated access if using a system dotnet install
&(Ensure-DotNetSdk) workload install $shortWorkloadName --from-rollback-file $rollbackFile $sourcesArgs

Remove-Item $rollbackFile
}
}

try
Expand Down
1 change: 1 addition & 0 deletions eng/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -295,6 +295,7 @@ fi
InitializeDotNetCli $install
if [[ "$restore" == true && "$source_build" != true ]]; then
dotnet tool restore
dotnet workload install macos # TODO: Specify version
fi

bootstrap_dir=""
Expand Down
13 changes: 11 additions & 2 deletions global.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
{
"sdk": {
"version": "6.0.100",
"version": "6.0.200",
"allowPrerelease": true,
"rollForward": "latestPatch"
},
"tools": {
"dotnet": "6.0.100",
"dotnet": "6.0.200",
"vs": {
"version": "16.10"
},
Expand All @@ -14,5 +14,14 @@
"msbuild-sdks": {
"Microsoft.DotNet.Arcade.Sdk": "7.0.0-beta.22122.3",
"Microsoft.DotNet.Helix.Sdk": "7.0.0-beta.22122.3"
},
"workloads": {
"microsoft.net.sdk.macos": {
"version": "12.1.301-preview.13.7",
"sources": [
"https://aka.ms/dotnet6/nuget/index.json",
"https://api.nuget.org/v3/index.json"
]
}
}
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net472</TargetFramework>
<TargetFramework>net6.0-macos</TargetFramework>
<DefineConstants>$(DefineConstants);COCOA</DefineConstants>
<!-- https://github.com/dotnet/roslyn/pull/59429#issuecomment-1043195174 -->
<EnableDefaultmacOSItems>false</EnableDefaultmacOSItems>

<!-- NuGet -->
<IsPackable>true</IsPackable>
Expand Down Expand Up @@ -31,7 +33,7 @@

<ItemGroup>
<PackageReference Include="Microsoft.VisualStudio.Composition" Version="$(MicrosoftVisualStudioCompositionVersion)" />
<PackageReference Include="Microsoft.VisualStudio.ImageCatalog" Version="$(MicrosoftVisualStudioImageCatalogVersion)" />
<PackageReference Include="Microsoft.VisualStudio.FPF.PresentationFramework" Version="$(MicrosoftVisualStudioFPFVersion)" />
<PackageReference Include="Microsoft.VisualStudio.Imaging" Version="$(MicrosoftVisualStudioImagingVersion)" />
<PackageReference Include="Microsoft.VisualStudio.Imaging.Interop.14.0.DesignTime" Version="$(MicrosoftVisualStudioImagingInterop140DesignTimeVersion)" />
<PackageReference Include="Microsoft.VisualStudio.Text.Data" Version="$(MicrosoftVisualStudioTextDataVersion)" />
Expand All @@ -41,7 +43,6 @@
<PackageReference Include="Microsoft.VisualStudio.Language.Intellisense" Version="$(MicrosoftVisualStudioLanguageIntellisenseVersion)" />
<PackageReference Include="Microsoft.VisualStudio.Language.StandardClassification" Version="$(MicrosoftVisualStudioLanguageStandardClassificationVersion)" />

<PackageReference Include="XamarinMac" Version="$(XamarinMacVersion)" />
<PackageReference Include="System.ValueTuple" Version="$(SystemValueTupleVersion)" />
</ItemGroup>

Expand Down
3 changes: 2 additions & 1 deletion src/EditorFeatures/Core.Cocoa/Preview/PreviewPane.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
using System.Collections.Generic;
using AppKit;
using Foundation;
using ObjCRuntime;
using Microsoft.CodeAnalysis.Editor.Shared.Extensions;
using Microsoft.VisualStudio.Text.Differencing;

Expand Down Expand Up @@ -95,7 +96,7 @@ public PreviewPane(string? id, string? title, Uri? helpLink, string? helpLinkToo
new Microsoft.VisualStudio.Text.SnapshotPoint(_differenceViewerPreview.Viewer.InlineView.TextSnapshot, 0));
}

public PreviewPane(IntPtr ptr)
public PreviewPane(NativeHandle ptr)
: base(ptr)
{
}
Expand Down

0 comments on commit 53c35bb

Please sign in to comment.