Skip to content
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
22 changes: 0 additions & 22 deletions Directory.Build.targets

This file was deleted.

23 changes: 0 additions & 23 deletions Directory.iOS.targets

This file was deleted.

4 changes: 3 additions & 1 deletion HelloAndroid/HelloAndroid.csproj
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
<Project Sdk="Microsoft.Android.Sdk">
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net5.0-android</TargetFramework>
<OutputType>Exe</OutputType>
<!-- TODO: disable Fast Deployment temporarily -->
<EmbedAssembliesIntoApk>true</EmbedAssembliesIntoApk>
</PropertyGroup>
</Project>
12 changes: 0 additions & 12 deletions HelloForms.Droid/HelloForms.Droid.csproj

This file was deleted.

11 changes: 0 additions & 11 deletions HelloForms.iOS/HelloForms.iOS.csproj

This file was deleted.

File renamed without changes.
90 changes: 90 additions & 0 deletions HelloForms/Directory.Build.props
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
<!--
A prototype of the setup for a Xamarin single project.
NOTE: this file will eventually go away to be part of Forms/MAUI itself
-->
<Project>

<!-- Properties -->
<PropertyGroup>
<EnableDefaultItems>false</EnableDefaultItems>
<!-- Android -->
<AndroidProjectFolder>Android\</AndroidProjectFolder>
<AndroidManifest>$(AndroidProjectFolder)AndroidManifest.xml</AndroidManifest>
<MonoAndroidResourcePrefix>$(AndroidProjectFolder)Resources</MonoAndroidResourcePrefix>
<MonoAndroidAssetsPrefix>$(AndroidProjectFolder)Assets</MonoAndroidAssetsPrefix>
<!-- TODO: disable Fast Deployment temporarily -->
<EmbedAssembliesIntoApk>true</EmbedAssembliesIntoApk>
<!-- iOS -->
<iOSProjectFolder>iOS\</iOSProjectFolder>
<IPhoneResourcePrefix>$(iOSProjectFolder)Resources</IPhoneResourcePrefix>
</PropertyGroup>

<!-- Shared -->
<ItemGroup>
<Compile Include="Shared\**$(DefaultLanguageSourceExtension)" Exclude="$(DefaultItemExcludes);$(DefaultExcludesInProjectFolder)" />
<EmbeddedResource Include="Shared\**\*.xaml" Exclude="$(DefaultItemExcludes);$(DefaultExcludesInProjectFolder)" />
</ItemGroup>

<!-- Android -->
<ItemGroup Condition=" '$(TargetPlatformIdentifier)' == 'android' ">
<Compile Include="$(AndroidProjectFolder)**$(DefaultLanguageSourceExtension)" Exclude="$(DefaultItemExcludes);$(DefaultExcludesInProjectFolder)" />
<AndroidResource Include="$(MonoAndroidResourcePrefix)\*\*.xml" />
<AndroidResource Include="$(MonoAndroidResourcePrefix)\*\*.axml" />
<AndroidResource Include="$(MonoAndroidResourcePrefix)\*\*.png" />
<AndroidResource Include="$(MonoAndroidResourcePrefix)\*\*.jpg" />
<AndroidResource Include="$(MonoAndroidResourcePrefix)\*\*.gif" />
<AndroidResource Include="$(MonoAndroidResourcePrefix)\font\*.ttf" />
<AndroidResource Include="$(MonoAndroidResourcePrefix)\font\*.otf" />
<AndroidResource Include="$(MonoAndroidResourcePrefix)\font\*.ttc" />
<AndroidResource Include="$(MonoAndroidResourcePrefix)\raw\*" Exclude="$(MonoAndroidResourcePrefix)\raw\.*" />
<AndroidAsset Include="$(MonoAndroidAssetsPrefix)\**\*" Exclude="$(MonoAndroidAssetsPrefix)\**\.*\**" />
</ItemGroup>

<!-- iOS -->
<ItemGroup Condition=" '$(TargetPlatformIdentifier)' == 'ios' ">
<Compile Include="$(iOSProjectFolder)**$(DefaultLanguageSourceExtension)" Exclude="$(DefaultItemExcludes);$(DefaultExcludesInProjectFolder)" />
<None Include="$(iOSProjectFolder)Info.plist" LogicalName="Info.plist" />
<SceneKitAsset Include="$(iOSProjectFolder)**\*.scnassets\*">
<IsDefaultItem>true</IsDefaultItem>
</SceneKitAsset>
<InterfaceDefinition Include="$(iOSProjectFolder)**\*.storyboard;$(iOSProjectFolder)**\*.xib">
<Link>$([MSBuild]::MakeRelative ('$(MSBuildProjectDirectory)', '%(Identity)'))</Link>
<IsDefaultItem>true</IsDefaultItem>
</InterfaceDefinition>
</ItemGroup>

<!-- Workarounds - not specific to default item groups -->

<!-- NOTE: the target below has workarounds for $(AssetTargetFallback) usage -->
<!-- see: https://github.com/NuGet/docs.microsoft.com-nuget/issues/1955 -->
<Target
Name="FixFormsNuGetAssemblies"
AfterTargets="ResolvePackageAssets"
Condition=" '$(PkgXamarin_Forms)' != '' and '$(TargetPlatformIdentifier)' == 'ios' ">
<ItemGroup>
<Reference Include="Xamarin.Forms.Platform.iOS" HintPath="$(PkgXamarin_Forms)\build\XCODE11\Xamarin.Forms.Platform.iOS.dll" />
<Reference Include="Xamarin.Forms.Platform" HintPath="$(PkgXamarin_Forms)\lib\Xamarin.iOS10\Xamarin.Forms.Platform.dll" />
<RuntimeCopyLocalItems Remove="$(PkgXamarin_Forms)\lib\netstandard2.0\Xamarin.Forms.Platform.dll" />
<ResolvedCompileFileDefinitions Remove="$(PkgXamarin_Forms)\lib\netstandard2.0\Xamarin.Forms.Platform.dll" />
</ItemGroup>
</Target>

<!--
The linker resolves some assembly references too eagerly, and
fails when it can't find them, so work around this by referencing
the missing assemblies.
See: https://github.com/mono/linker/issues/1139
-->
<PropertyGroup>
<_DotNetPackageVersion>5.0.0-rc.2.20475.5</_DotNetPackageVersion>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="System.CodeDom" Version="$(_DotNetPackageVersion)" />
<PackageReference Include="System.Diagnostics.EventLog" Version="$(_DotNetPackageVersion)" />
<PackageReference Include="System.Diagnostics.PerformanceCounter" Version="$(_DotNetPackageVersion)" />
<PackageReference Include="System.IO.Ports" Version="$(_DotNetPackageVersion)" />
<PackageReference Include="System.Security.Permissions" Version="$(_DotNetPackageVersion)" />
<PackageReference Include="System.Threading.AccessControl" Version="$(_DotNetPackageVersion)" />
</ItemGroup>

</Project>
6 changes: 4 additions & 2 deletions HelloForms/HelloForms.csproj
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net5.0</TargetFramework>
<TargetFrameworks>net5.0-android;net5.0-ios</TargetFrameworks>
<RuntimeIdentifier Condition=" '$(TargetFramework)' == 'net5.0-ios' ">ios-x64</RuntimeIdentifier>
<OutputType>Exe</OutputType>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Xamarin.Forms" Version="4.8.0.1364" />
<PackageReference Include="Xamarin.Forms" Version="4.8.0.1364" GeneratePathProperty="true" />
</ItemGroup>
</Project>
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion HelloForms.iOS/Info.plist → HelloForms/iOS/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
<key>MinimumOSVersion</key>
<string>8.0</string>
<string>7.0</string>
<key>CFBundleDisplayName</key>
<string>HelloForms</string>
<key>CFBundleIdentifier</key>
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion HelloiOS/HelloiOS.csproj
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<Project Sdk="Microsoft.iOS.Sdk">
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net5.0-ios</TargetFramework>
<RuntimeIdentifier>ios-x64</RuntimeIdentifier>
Expand Down
2 changes: 1 addition & 1 deletion HelloiOS/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<key>LSRequiresIPhoneOS</key>
<true/>
<key>MinimumOSVersion</key>
<string>11.0</string>
<string>7.0</string>
<key>UIDeviceFamily</key>
<array>
<integer>1</integer>
Expand Down
32 changes: 27 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,33 @@

_This is an *early* preview of Xamarin in .NET 6 **not for production use**. Expect breaking changes as Xamarin is still in development for .NET 6._

This repo requires a specific build of .NET 5 rc 2:
This repo requires a specific build of .NET 5 rtm:

* https://dotnetcli.azureedge.net/dotnet/Sdk/5.0.100-rc.2.20480.7/dotnet-sdk-5.0.100-rc.2.20480.7-win-x64.exe
* https://dotnetcli.azureedge.net/dotnet/Sdk/5.0.100-rc.2.20480.7/dotnet-sdk-5.0.100-rc.2.20480.7-osx-x64.pkg
* Windows: https://dotnetcli.azureedge.net/dotnet/Sdk/5.0.100-rtm.20509.5/dotnet-sdk-5.0.100-rtm.20509.5-win-x64.exe
* macOS: https://dotnetcli.azureedge.net/dotnet/Sdk/5.0.100-rtm.20509.5/dotnet-sdk-5.0.100-rtm.20509.5-osx-x64.pkg

_NOTE: newer builds *may* work, but your mileage may vary. You can find the full list of builds at the [dotnet/installer][dotnet/installer] repo._
You will also need to install builds of the iOS and Android workloads:

Android:
* Windows: https://dl.internalx.com/vsts-devdiv/Xamarin.Android/public/4181754/master/519ca83979916cfb1424ea4406639fd665fc1af7/Microsoft.NET.Workload.Android.11.0.100.208.msi
* macOS: https://dl.internalx.com/vsts-devdiv/Xamarin.Android/public/4181754/master/519ca83979916cfb1424ea4406639fd665fc1af7/Microsoft.NET.Workload.Android-11.0.100-ci.master.208.pkg

iOS:
* Windows: Coming Soon
* macOS: https://bosstoragemirror.blob.core.windows.net/wrench/jenkins/main/923aef0838a64d7c2886716806c669d107fa399b/467/package/Microsoft.iOS.Bundle.14.1.100-ci.main.27.pkg

_NOTE: newer builds of .NET 5 *may* work, but your mileage may vary.
The workload installers enable a feature flag file via
`sdk/5.0.100-rtm.20509.5/EnableWorkloadResolver.sentinel`, which would
need to be created manually for other .NET 5 versions. You can find
the full list of builds at the [dotnet/installer][dotnet/installer]
repo._

Projects:

* HelloAndroid - a native Xamarin.Android application
* HelloiOS - a native Xamarin.iOS application
* HelloForms, HelloForms.iOS, HelloForms.Droid - a cross-platform Xamarin.Forms application
* HelloForms - a multi-targeted Xamarin.Forms application for iOS and Android.

[dotnet/installer]: https://github.com/dotnet/installer#installers-and-binaries

Expand Down Expand Up @@ -45,6 +60,13 @@ To launch the iOS project on a simulator:

dotnet build HelloiOS/HelloiOS.csproj -t:Run

## Xamarin.Forms

To launch the Forms project, you will need to specify a `$(TargetFramework)`:

dotnet build HelloForms/HelloForms.csproj -t:Run -p:TargetFramework=net5.0-android
dotnet build HelloForms/HelloForms.csproj -t:Run -p:TargetFramework=net5.0-ios

## Known Issues

Currently...
Expand Down
43 changes: 35 additions & 8 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,11 @@ pr:
- main

variables:
DotNetVersion: 5.0.100-rc.2.20480.7
DotNetVersion: 5.0.100-rtm.20509.5
DotNet.Cli.Telemetry.OptOut: true
Android.Msi: https://dl.internalx.com/vsts-devdiv/Xamarin.Android/public/4181754/master/519ca83979916cfb1424ea4406639fd665fc1af7/Microsoft.NET.Workload.Android.11.0.100.208.msi
Android.Pkg: https://dl.internalx.com/vsts-devdiv/Xamarin.Android/public/4181754/master/519ca83979916cfb1424ea4406639fd665fc1af7/Microsoft.NET.Workload.Android-11.0.100-ci.master.208.pkg
iOS.Pkg: https://bosstoragemirror.blob.core.windows.net/wrench/jenkins/main/923aef0838a64d7c2886716806c669d107fa399b/467/package/Microsoft.iOS.Bundle.14.1.100-ci.main.27.pkg

jobs:
- job: windows
Expand All @@ -25,10 +29,15 @@ jobs:
errorActionPreference: stop

- powershell: |
& dotnet build HelloAndroid\HelloAndroid.csproj -c Debug -bl:$(LogDirectory)\Debug-HelloAndroid.binlog
& dotnet tool install --global boots
& boots $(Android.Msi)
displayName: install .NET workloads

- powershell: |
& dotnet build HelloAndroid\HelloAndroid.csproj -c Debug -bl:$(LogDirectory)\Debug-HelloAndroid.binlog
& dotnet build HelloAndroid\HelloAndroid.csproj -c Release -bl:$(LogDirectory)\Release-HelloAndroid.binlog
& dotnet build HelloForms.Droid\HelloForms.Droid.csproj -c Debug -bl:$(LogDirectory)\Debug-HelloForms.binlog
& dotnet build HelloForms.Droid\HelloForms.Droid.csproj -c Release -bl:$(LogDirectory)\Release-HelloForms.binlog
& dotnet build HelloForms\HelloForms.csproj -c Debug -bl:$(LogDirectory)\Debug-HelloForms.binlog -p:TargetFramework=net5.0-android
& dotnet build HelloForms\HelloForms.csproj -c Release -bl:$(LogDirectory)\Release-HelloForms.binlog -p:TargetFramework=net5.0-android
displayName: build samples
errorActionPreference: stop

Expand Down Expand Up @@ -56,13 +65,31 @@ jobs:
- group: Xamarin-Secrets
- name: LogDirectory
value: $(Build.ArtifactStagingDirectory)/logs
- name: DotNet.Root
value: /usr/local/share/dotnet/
- name: DotNet.Tools
value: ~/.dotnet/tools
steps:
- task: UseDotNet@2
displayName: install .NET Core 3.1
inputs:
version: 3.1.x
installationPath: $(DotNet.Root)

- bash: >
export PATH="$(DotNet.Root):$(DotNet.Tools):$PATH" &&
curl -L https://dot.net/v1/dotnet-install.sh > dotnet-install.sh &&
sh dotnet-install.sh --version $(DotNetVersion) --install-dir ~/.dotnet/ --verbose &&
dotnet --list-sdks
sh dotnet-install.sh --version $(DotNetVersion) --install-dir $DOTNET_ROOT --verbose &&
dotnet --list-sdks &&
echo "##vso[task.setvariable variable=PATH]$PATH"
displayName: install .NET $(DotNetVersion)

- bash: |
dotnet tool install --global boots
boots $(Android.Pkg)
boots $(iOS.Pkg)
displayName: install .NET workloads

- task: provisionator@2
displayName: install Xcode
inputs:
Expand All @@ -73,11 +100,11 @@ jobs:
- bash: |
set -x
mkdir -p ~/Library/Preferences/Xamarin
/usr/libexec/PlistBuddy -c "add :AppleSdkRoot string $(dirname $(dirname $(xcode-select -p)))" ~/Library/Preferences/Xamarin/Settings.plist
/usr/libexec/PlistBuddy -c "add :AppleSdkRoot string $(dirname $(dirname $(xcode-select -p)))" ~/Library/Preferences/Xamarin/Settings.plist || true
displayName: configure vsmac xcode

- bash: |
dotnet build net6-samples.sln -c Debug -bl:$(LogDirectory)/Debug.binlog &&
dotnet build net6-samples.sln -c Debug -bl:$(LogDirectory)/Debug.binlog &&
dotnet build net6-samples.sln -c Release -bl:$(LogDirectory)/Release.binlog
displayName: build samples

Expand Down
7 changes: 4 additions & 3 deletions global.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"msbuild-sdks": {
"Microsoft.iOS.Sdk": "14.0.100-ci.main.568",
"Microsoft.Android.Sdk": "11.0.100-ci.master.169"
"sdk": {
"version": "5.0.100-rtm.20509.5",
"rollForward": "major",
"allowPrerelease": true
}
}
13 changes: 0 additions & 13 deletions net6-samples.sln
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,6 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "HelloAndroid", "HelloAndroi
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "HelloiOS", "HelloiOS\HelloiOS.csproj", "{E97A9C8C-8AD6-496A-A0A4-A5A90870E03D}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "HelloForms.Droid", "HelloForms.Droid\HelloForms.Droid.csproj", "{66B60757-4FA8-4CFF-9B44-637CA23BA493}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "HelloForms.iOS", "HelloForms.iOS\HelloForms.iOS.csproj", "{3B314BD0-0A8B-43E7-BF47-131D44EBB1F4}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "HelloForms", "HelloForms\HelloForms.csproj", "{36BB19AF-93D3-4704-AFCE-181941EBD691}"
EndProject
Global
Expand All @@ -29,15 +25,6 @@ Global
{E97A9C8C-8AD6-496A-A0A4-A5A90870E03D}.Debug|Any CPU.Build.0 = Debug|Any CPU
{E97A9C8C-8AD6-496A-A0A4-A5A90870E03D}.Release|Any CPU.ActiveCfg = Release|Any CPU
{E97A9C8C-8AD6-496A-A0A4-A5A90870E03D}.Release|Any CPU.Build.0 = Release|Any CPU
{66B60757-4FA8-4CFF-9B44-637CA23BA493}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{66B60757-4FA8-4CFF-9B44-637CA23BA493}.Debug|Any CPU.Build.0 = Debug|Any CPU
{66B60757-4FA8-4CFF-9B44-637CA23BA493}.Debug|Any CPU.Deploy.0 = Debug|Any CPU
{66B60757-4FA8-4CFF-9B44-637CA23BA493}.Release|Any CPU.ActiveCfg = Release|Any CPU
{66B60757-4FA8-4CFF-9B44-637CA23BA493}.Release|Any CPU.Build.0 = Release|Any CPU
{66B60757-4FA8-4CFF-9B44-637CA23BA493}.Release|Any CPU.Deploy.0 = Release|Any CPU
{3B314BD0-0A8B-43E7-BF47-131D44EBB1F4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{3B314BD0-0A8B-43E7-BF47-131D44EBB1F4}.Debug|Any CPU.Build.0 = Debug|Any CPU
{3B314BD0-0A8B-43E7-BF47-131D44EBB1F4}.Release|Any CPU.ActiveCfg = Release|iPhone
{36BB19AF-93D3-4704-AFCE-181941EBD691}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{36BB19AF-93D3-4704-AFCE-181941EBD691}.Debug|Any CPU.Build.0 = Debug|Any CPU
{36BB19AF-93D3-4704-AFCE-181941EBD691}.Release|Any CPU.ActiveCfg = Release|Any CPU
Expand Down
Loading