Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable macOS support #788

Merged
merged 11 commits into from
Apr 18, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 50 additions & 0 deletions .azure-devops-macos.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
jobs:
- job: macOS
variables:
CI_Build: true
SourceLinkEnabled: false

pool:
vmImage: 'macOS-10.14'

steps:
- checkout: self
clean: true

- bash: /bin/bash -c "sudo $AGENT_HOMEDIRECTORY/scripts/select-xamarin-sdk.sh 5_18_1"
displayName: Select Xamarin Version

- task: NuGetToolInstaller@0
inputs:
versionSpec: 4.7.0
checkLatest: false

- task: MSBuild@1
inputs:
solution: src/SamplesApp/SamplesApp.macOS/SamplesApp.macOS.csproj
msbuildLocationMethod: version
msbuildVersion: latest
msbuildArchitecture: x86
msbuildArguments: /r /p:Configuration=Release /detailedsummary /bl:$(build.artifactstagingdirectory)/build-macos.binlog
clean: false
maximumCpuCount: true
restoreNugetPackages: false
logProjectEvents: false
createLogFile: false

- task: CopyFiles@2
displayName: 'Copy macOS artifacts'
inputs:
SourceFolder: $(build.sourcesdirectory)/src/SamplesApp/SamplesApp.macOS/bin/Release
Contents: '**/*.pkg'
TargetFolder: $(build.artifactstagingdirectory)
CleanTargetFolder: false
OverWrite: false
flattenFolders: false

- task: PublishBuildArtifacts@1
condition: always()
inputs:
PathtoPublish: $(build.artifactstagingdirectory)
ArtifactName: uno-macos-artifacts
ArtifactType: Container
2 changes: 0 additions & 2 deletions .azure-devops-wasm-uitests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,6 @@ jobs:
flattenFolders: false

- task: PublishBuildArtifacts@1
# https://developercommunity.visualstudio.com/content/problem/284991/public-vsts-previouw-cant-set-build-number-of-pr-b.html
condition: eq(variables['System.PullRequest.IsFork'], 'False')
inputs:
PathtoPublish: $(build.artifactstagingdirectory)
ArtifactName: wasm-uitests
Expand Down
51 changes: 1 addition & 50 deletions .vsts-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ resources:

jobs:
- template: .azure-devops-wasm-uitests.yml
- template: .azure-devops-macos.yml

- job: VS_Latest

Expand Down Expand Up @@ -96,56 +97,6 @@ jobs:
ArtifactName: NugetPackages
ArtifactType: Container

# Disabled until VS4Mac is updated to 7.7 or later.
#- job: macOS
# variables:
# NUGET_PACKAGES: $(Agent.WorkFolder)\.nuget
# NUGET_HTTP_CACHE_PATH: $(Agent.WorkFolder)\.nuget-http-cache
# CombinedConfiguration: Release|Any CPU
# CI_Build: true
# SourceLinkEnabled: false
#
# queue:
# name: Hosted macOS
#
# steps:
# - checkout: self
# clean: true
#
# - task: NuGetToolInstaller@0
# inputs:
# versionSpec: 4.7.0
# checkLatest: false
#
# - task: NuGetCommand@2
# inputs:
# command: restore
# solution: src/Uno.UI-vs4mac.sln
# selectOrConfig: select
# includeNuGetOrg: true
# verbosityRestore: Normal
#
# - task: MSBuild@1
# inputs:
# solution: Build/Uno.UI.proj
# msbuildLocationMethod: version
# msbuildVersion: latest
# msbuildArchitecture: x86
# msbuildArguments: /r /p:CheckExclusions=True "/p:CombinedConfiguration=$(CombinedConfiguration)" /detailedsummary /bl:$(build.artifactstagingdirectory)/build-macos.binlog
# clean: false
# maximumCpuCount: true
# restoreNugetPackages: false
# logProjectEvents: false
# createLogFile: false
#
# - task: PublishBuildArtifacts@1
# # https://developercommunity.visualstudio.com/content/problem/284991/public-vsts-previouw-cant-set-build-number-of-pr-b.html
# condition: eq(variables['System.PullRequest.IsFork'], 'False')
# inputs:
# PathtoPublish: $(build.artifactstagingdirectory)
# ArtifactName: uno-macos-artifacts
# ArtifactType: Container

- job: Documentation

pool:
Expand Down
15 changes: 14 additions & 1 deletion build/PackageDiffIgnore.xml
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@
reason="Removed as Routed Events implement it properly"/>

<Member fullName="System.Boolean Uno.Foundation.WebAssemblyRuntime.InvokeJSUnmarshalled(System.String functionIdentifier, System.IntPtr arg0, System.IntPtr arg1, System.IntPtr arg2)"
reason="Removed to improve the C#/JS call performance"/>
reason="Removed to improve the C#/JS call performance"/>
</Methods>

<Events>
Expand Down Expand Up @@ -92,5 +92,18 @@
reason="Unused Uno specific property" />
</Properties>
</IgnoreSet>

<IgnoreSet baseVersion="1.44.0">
<Types>
<Member fullName="Windows.UI.Xaml.UIElementExtensions"
reason="Moved to Uno.Extensions"/>
</Types>

<Methods>
<Member fullName="System.Boolean Uno.Foundation.WebAssemblyRuntime.InvokeJSUnmarshalled(System.String functionIdentifier, System.IntPtr arg0, System.IntPtr arg1, System.IntPtr arg2)"
reason="Removed to improve the C#/JS call performance"/>
</Methods>

</IgnoreSet>
</IgnoreSets>
</DiffIgnore>
37 changes: 35 additions & 2 deletions build/Uno.UI.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,13 @@
<dependency id="Uno.Core.Build" version="1.28.0-dev.86" />
</group>

<!-- iOS -->
<group targetFramework="xamarinmac20">
<dependency id="Uno.SourceGenerationTasks" version="1.31.0-dev.285" />
<dependency id="Uno.Core" version="1.28.0-dev.86" />
<dependency id="Uno.Core.Build" version="1.28.0-dev.86" />
</group>

<!-- .NET Standard 2.0 -->
<group targetFramework="netstandard2.0">
<dependency id="Uno.SourceGenerationTasks" version="1.31.0-dev.285" />
Expand All @@ -57,9 +64,14 @@
<frameworkAssembly assemblyName="System.Numerics" targetFramework="MonoAndroid" />
<frameworkAssembly assemblyName="System.Numerics.Vectors" targetFramework="MonoAndroid" />
<frameworkAssembly assemblyName="System.Memory" targetFramework="MonoAndroid" />

<frameworkAssembly assemblyName="System.Numerics" targetFramework="xamarinios10" />
<frameworkAssembly assemblyName="System.Numerics.Vectors" targetFramework="xamarinios10" />
<frameworkAssembly assemblyName="System.Memory" targetFramework="xamarinios10" />

<frameworkAssembly assemblyName="System.Numerics" targetFramework="xamarinmac20" />
<frameworkAssembly assemblyName="System.Numerics.Vectors" targetFramework="xamarinmac20" />
<frameworkAssembly assemblyName="System.Memory" targetFramework="xamarinmac20" />
</frameworkAssemblies>

<references>
Expand All @@ -82,6 +94,15 @@
<reference file="Uno.UI.Toolkit.dll" />
</group>

<!-- iOS -->
<group targetFramework="xamarinmac20">
<reference file="Uno.Xaml.dll" />
<reference file="Uno.UI.dll" />
<reference file="Uno.Foundation.dll" />
<reference file="Uno.dll" />
<reference file="Uno.UI.Toolkit.dll" />
</group>

<!-- Android -->
<group targetFramework="MonoAndroid">
<reference file="Uno.UI.BindingHelper.Android.dll" />
Expand Down Expand Up @@ -139,8 +160,7 @@
<file src="..\src\Uno.UI\Bin\Release\monoandroid90\Uno.Xaml.pdb" target="lib\MonoAndroid90" />
<file src="..\src\Uno.UI\Bin\Release\monoandroid90\*.xml" target="lib\MonoAndroid90" />


<!-- iOS Unified -->
<!-- iOS -->
<file src="..\src\Uno.UI\Bin\Release\xamarinios10\Uno.dll" target="lib\xamarinios10" />
<file src="..\src\Uno.UI\Bin\Release\xamarinios10\Uno.pdb" target="lib\xamarinios10" />
<file src="..\src\Uno.UI\Bin\Release\xamarinios10\Uno.Foundation.dll" target="lib\xamarinios10" />
Expand All @@ -151,6 +171,17 @@
<file src="..\src\Uno.UI\Bin\Release\xamarinios10\Uno.Xaml.pdb" target="lib\xamarinios10" />
<file src="..\src\Uno.UI\bin\Release\xamarinios10\*.xml" target="lib\xamarinios10" />

<!-- macOS -->
<file src="..\src\Uno.UI\Bin\Release\xamarinmac20\Uno.dll" target="lib\xamarinmac20" />
<file src="..\src\Uno.UI\Bin\Release\xamarinmac20\Uno.pdb" target="lib\xamarinmac20" />
<file src="..\src\Uno.UI\Bin\Release\xamarinmac20\Uno.Foundation.dll" target="lib\xamarinmac20" />
<file src="..\src\Uno.UI\Bin\Release\xamarinmac20\Uno.Foundation.pdb" target="lib\xamarinmac20" />
<file src="..\src\Uno.UI\Bin\Release\xamarinmac20\Uno.UI.dll" target="lib\xamarinmac20" />
<file src="..\src\Uno.UI\Bin\Release\xamarinmac20\Uno.UI.pdb" target="lib\xamarinmac20" />
<file src="..\src\Uno.UI\Bin\Release\xamarinmac20\Uno.Xaml.dll" target="lib\xamarinmac20" />
<file src="..\src\Uno.UI\Bin\Release\xamarinmac20\Uno.Xaml.pdb" target="lib\xamarinmac20" />
<file src="..\src\Uno.UI\bin\Release\xamarinmac20\*.xml" target="lib\xamarinmac20" />

<!-- .NET Standard 2.0 -->
<file src="..\src\Uno.UI\Bin\Release\netstandard2.0\Uno.dll" target="lib\netstandard2.0" />
<file src="..\src\Uno.UI\Bin\Release\netstandard2.0\Uno.pdb" target="lib\netstandard2.0" />
Expand Down Expand Up @@ -182,9 +213,11 @@

<file src="Uno.UI.targets" target="build\MonoAndroid" />
<file src="Uno.UI.targets" target="build\xamarinios10" />
<file src="Uno.UI.targets" target="build\xamarinmac20" />
<file src="Uno.UI.targets" target="build\netstandard2.0" />
<file src="..\src\SourceGenerators\Uno.UI.Tasks\Content\Uno.UI.Tasks.targets" target="build\MonoAndroid" />
<file src="..\src\SourceGenerators\Uno.UI.Tasks\Content\Uno.UI.Tasks.targets" target="build\xamarinios10" />
<file src="..\src\SourceGenerators\Uno.UI.Tasks\Content\Uno.UI.Tasks.targets" target="build\xamarinmac20" />
<file src="..\src\SourceGenerators\Uno.UI.Tasks\Content\Uno.UI.Tasks.targets" target="build\netstandard2.0" />
<file src="_._" target="build\uap10.0" />

Expand Down
1 change: 1 addition & 0 deletions doc/ReleaseNotes/_ReleaseNotes.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
* [Wasm] Add support of hardware/browser back button in `SystemNavigationManager.BackRequested`
* [Wasm] Added support for custom DOM events
* WebAssembly UI tests are now integrated in the CI
* Enable support for macOS head development

### Breaking Changes
* The `WebAssemblyRuntime.InvokeJSUnmarshalled` method with three parameters has been removed.
Expand Down
7 changes: 2 additions & 5 deletions doc/articles/debugging-uno-ui.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,17 +66,14 @@ to the documentation of the [Uno.PackageDiff tool](https://github.com/nventive/U

## Building Uno.UI for macOS using Visual Studio for Mac

Building Uno.UI for the macOS platform using vs4mac requires Visual Studio for mac 7.7 preview or later.
Building Uno.UI for the macOS platform using vs4mac requires Visual Studio for mac 8.0 or later.

A few steps to be able to build:
- The `xamarinmac20` Target Framework must be the first in the `TargetFrameworks` list of the `Uno.UI`, `Uno`, `Uno.Foundation` and `Uno.Xaml` projects. VS4Mac only builds the first Target Framework.
- In both `Uno` and `Uno.UI` the ItemGroups containing references to `Xamarin.Android.Support.v4` and `Xamarin.Android.Support.v7.AppCompat` must be commented out.
Failing to remove those groups will make the nuget restore fail, because VS4Mac does not support conditional package references.
- In `Uno.UI`, comment the project reference to the `Uno.UI.BindingHelper` project, because VS4Mac does not support conditional project references.
- Disable both nuget restore features in Visual Studio for Mac configuration

To build and run:
- In a shell in the `src/Uno.UI` folder, run `msbuild /r`. This will make the nuget restore work properly.
- In a shell in the `src/Uno.UI` folder, run `msbuild /r`. This will make the nuget restore work faster.
- Once done, in VS4Mac, run the `SampleApp.macOS` project, which will build the dependencies and the app itself.

## Troubleshooting Source Generation
Expand Down
19 changes: 0 additions & 19 deletions src/.vsconfig
Original file line number Diff line number Diff line change
Expand Up @@ -56,23 +56,13 @@
"Microsoft.VisualStudio.Component.DockerTools",
"Microsoft.VisualStudio.Component.Web",
"Microsoft.VisualStudio.Component.Wcf.Tooling",
"Microsoft.VisualStudio.Component.GraphDocument",
"Microsoft.VisualStudio.Component.CodeMap",
"Microsoft.VisualStudio.Workload.ManagedDesktop",
"Microsoft.VisualStudio.Component.VC.CoreIde",
"Microsoft.VisualStudio.Component.VC.Redist.14.Latest",
"Microsoft.VisualStudio.Component.ClassDesigner",
"Microsoft.VisualStudio.ComponentGroup.ArchitectureTools.Native",
"Microsoft.VisualStudio.ComponentGroup.NativeDesktop.Core",
"Microsoft.VisualStudio.Component.VC.Tools.x86.x64",
"Microsoft.VisualStudio.Component.Windows10SDK.17763",
"Microsoft.VisualStudio.Component.Graphics.Tools",
"Microsoft.VisualStudio.Component.VC.DiagnosticTools",
"Microsoft.VisualStudio.Component.VC.CMake.Project",
"Microsoft.VisualStudio.Component.VC.ATL",
"Microsoft.VisualStudio.Component.VC.TestAdapterForBoostTest",
"Microsoft.VisualStudio.Component.VC.TestAdapterForGoogleTest",
"Microsoft.VisualStudio.Workload.NativeDesktop",
"Microsoft.Component.NetFX.Native",
"Microsoft.VisualStudio.ComponentGroup.UWP.NetCoreAndStandard",
"Microsoft.VisualStudio.Component.Graphics",
Expand Down Expand Up @@ -100,15 +90,6 @@
"Microsoft.VisualStudio.Component.AspNet45",
"Microsoft.VisualStudio.Component.WebDeploy",
"Microsoft.VisualStudio.Workload.NetWeb",
"Microsoft.VisualStudio.ComponentGroup.Azure.Prerequisites",
"Microsoft.VisualStudio.Component.Azure.Waverton.BuildTools",
"Microsoft.VisualStudio.Component.Azure.Waverton",
"Microsoft.Component.Azure.DataLake.Tools",
"Microsoft.VisualStudio.Component.Azure.ResourceManager.Tools",
"Microsoft.VisualStudio.ComponentGroup.Azure.ResourceManager.Tools",
"Microsoft.VisualStudio.ComponentGroup.Azure.CloudServices",
"Microsoft.VisualStudio.Component.Azure.ServiceFabric.Tools",
"Microsoft.VisualStudio.Workload.Azure",
"Microsoft.VisualStudio.Component.Node.Tools",
"Microsoft.VisualStudio.Workload.Node",
"Microsoft.VisualStudio.Component.MonoDebugger",
Expand Down
2 changes: 1 addition & 1 deletion src/SamplesApp/SamplesApp.UWP/Package.appxmanifest
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

<Identity
Name="6c25beb3-e332-48d3-b4de-20a0b71935cd"
Publisher="CN=com.example"
Publisher="CN=uno"
Version="1.0.0.0" />

<mp:PhoneIdentity PhoneProductId="1897f84c-689e-44d3-a8b7-c521a62818ae" PhonePublisherId="00000000-0000-0000-0000-000000000000"/>
Expand Down
7 changes: 4 additions & 3 deletions src/SamplesApp/SamplesApp.UWP/SamplesApp.UWP.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
<FileAlignment>512</FileAlignment>
<ProjectTypeGuids>{A5A43C5B-DE2A-4C0C-9213-0A381AF9435A};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<PackageCertificateKeyFile>SamplesApp.UWP_TemporaryKey.pfx</PackageCertificateKeyFile>
<PackageCertificateThumbprint>8AE555112B5DF25CE67EF5BB90ADE081391BBC51</PackageCertificateThumbprint>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x86'">
<DebugSymbols>true</DebugSymbols>
Expand All @@ -39,7 +40,7 @@
<UseVSHostingProcess>false</UseVSHostingProcess>
<ErrorReport>prompt</ErrorReport>
<Prefer32Bit>true</Prefer32Bit>
<UseDotNetNativeToolchain>true</UseDotNetNativeToolchain>
<UseDotNetNativeToolchain>false</UseDotNetNativeToolchain>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|ARM'">
<DebugSymbols>true</DebugSymbols>
Expand All @@ -62,7 +63,7 @@
<UseVSHostingProcess>false</UseVSHostingProcess>
<ErrorReport>prompt</ErrorReport>
<Prefer32Bit>true</Prefer32Bit>
<UseDotNetNativeToolchain>true</UseDotNetNativeToolchain>
<UseDotNetNativeToolchain>false</UseDotNetNativeToolchain>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'">
<DebugSymbols>true</DebugSymbols>
Expand All @@ -85,7 +86,7 @@
<UseVSHostingProcess>false</UseVSHostingProcess>
<ErrorReport>prompt</ErrorReport>
<Prefer32Bit>true</Prefer32Bit>
<UseDotNetNativeToolchain>true</UseDotNetNativeToolchain>
<UseDotNetNativeToolchain>false</UseDotNetNativeToolchain>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.NETCore.UniversalWindowsPlatform">
Expand Down
Binary file not shown.
Loading