Граф коммитов

9 Коммитов

Автор SHA1 Сообщение Дата
Jonathan Peppers bb20b25e35
[build] bootstrap a local .\bin\dotnet\ with .NET Workloads (#514)
Based on: https://github.com/jonathanpeppers/maui-workload

This adds a new `DotNet.csproj` that provisions a local .NET 6 install
into `.\bin\dotnet\`.

Next, it uses versions defined in `eng/Versions.props` as required by
.NET version bumping infrastructure (called Darc):

    <Project>
      <PropertyGroup>
        <MicrosoftNETSdkPackageVersion>6.0.100-preview.2.21155.3</MicrosoftNETSdkPackageVersion>
        <MicrosoftAndroidSdkPackageVersion>11.0.200-ci.main.148</MicrosoftAndroidSdkPackageVersion>
        <MicrosoftMacCatalystSdkPackageVersion>14.3.100-ci.main.337</MicrosoftMacCatalystSdkPackageVersion>
        <MicrosoftiOSSdkPackageVersion>14.4.100-ci.main.1192</MicrosoftiOSSdkPackageVersion>
      </PropertyGroup>
    </Project>

Next, we can use these versions to consume NuGet packages for workloads:

    <PackageDownload Include="Microsoft.NET.Workload.Android"     Version="[$(MicrosoftAndroidSdkPackageVersion)]" />
    <PackageDownload Include="Microsoft.NET.Workload.MacCatalyst" Version="[$(MicrosoftMacCatalystSdkPackageVersion)]" />
    <PackageDownload Include="Microsoft.NET.Workload.iOS"         Version="[$(MicrosoftiOSSdkPackageVersion)]" />

Then the other packs they depend on:

    <PackageDownload Include="Microsoft.Android.Ref"            Version="[$(MicrosoftAndroidSdkPackageVersion)]" />
    <PackageDownload Include="Microsoft.Android.Sdk.win-x64"    Version="[$(MicrosoftAndroidSdkPackageVersion)]" Condition="$([MSBuild]::IsOSPlatform('windows'))" />
    <PackageDownload Include="Microsoft.Android.Sdk.osx-x64"    Version="[$(MicrosoftAndroidSdkPackageVersion)]" Condition="$([MSBuild]::IsOSPlatform('osx'))" />
    <PackageDownload Include="Microsoft.Android.Sdk.BundleTool" Version="[$(MicrosoftAndroidSdkPackageVersion)]" />
    <PackageDownload Include="Microsoft.MacCatalyst.Ref"        Version="[$(MicrosoftMacCatalystSdkPackageVersion)]" />
    <PackageDownload Include="Microsoft.MacCatalyst.Sdk"        Version="[$(MicrosoftMacCatalystSdkPackageVersion)]" />
    <PackageDownload Include="Microsoft.iOS.Ref"                Version="[$(MicrosoftiOSSdkPackageVersion)]" />
    <PackageDownload Include="Microsoft.iOS.Sdk"                Version="[$(MicrosoftiOSSdkPackageVersion)]" />

After doing this, I can build .NET 6 projects with:

    > .\bin\dotnet\dotnet.exe build .\src\Controls\samples\Controls.Sample.SingleProject\Maui.Controls.Sample.SingleProject.csproj

I can even build MacCatalyst apps on Windows!

I updated `build.cake` so the following builds for .NET 6 and opens
Visual Studio:

    > dotnet cake --target=VS-NET6

This is the equivalent of these commands if you want to run them
individually:

    dotnet build src\DotNet\DotNet.csproj
    .\bin\dotnet\dotnet build Microsoft.Maui.BuildTasks-net6.sln
    .\bin\dotnet\dotnet build Microsoft.Maui-net6.sln
    .\eng\dogfood.ps1

~~ Other Changes ~~

* Rework CI setup to use .\bin\dotnet\dotnet
* We don't need boots or URLs anymore
* Fixed `MSBuildTests` to use .\bin\dotnet\dotnet if found and fall
  back to the system `dotnet`
* Moved `.nuspec\package.ps1` to `eng\package.ps1`

~~ What problems does this solve? ~~

* MacCatalyst builds on Windows! (offline build that checks C#)
* Building Maui always gets you the right things installed.
* Maui becoming a .NET workload will be a breeze. We can copy files
  into `.\bin\dotnet\sdk-manifests` and `.\bin\dotnet\packs`.
* We can use Darc to bump dependencies within .NET:

https://github.com/dotnet/arcade/blob/main/Documentation/Darc.md
2021-03-22 10:16:06 +00:00
Matthew Leibowitz 17c5f977d5
Improves Samples (#447) 2021-03-09 04:44:52 +02:00
Jonathan Dick 1a2740aa5e
Build MAUI for MacCatalyst (#438)
* Add Mac Catalyst to the CI

* pack on mac just in case

* test

* Start adding catalyst support

* first maccatalyst frameworks to testthe waters

* oksy

* this for future

* revert

* revert

* Include maccatalyst for single project

* Treat Catalyst mostly like iOS for now

* Don't try fallback path for catalyst since API isn't there

* Xib not needed anymore

* Include iOS bits for catalyst on the compat project

* Fix linebreak mode to not use deprecated API (for catalyst too)

* Fix text/string attribute usage for catalyst/mac

* Fixed string attribute usage for catalyst/mac

* new toys

* Fix Delegate cast for catalyst

* Fix single project includes for catalyst

* Remove scene delegate for now

* Add catalyst specific assets for single project

* fix things

* Stop building catalyst on windows

* hax

* was bad hax

* Use UIStringAttributes for iOS and Catalyst both

* Do it right

* Revert "Use UIStringAttributes for iOS and Catalyst both"

This reverts commit 0d4b90aecb67c05432e04a1bde4a88e7405118d0.

* Fix the build tasks

Co-authored-by: Matthew Leibowitz <mattleibow@live.com>
Co-authored-by: Jonathan Peppers <jonathan.peppers@microsoft.com>
2021-03-05 20:12:14 -05:00
Jonathan Peppers af679489bd
.NET 6 maui-mobile template (#371) 2021-03-05 05:41:53 +02:00
Jonathan Dick bd64aa9742
Pack Essentials net6 (#13925)
* Build and pack essentials for net6

* Fix net6 pack for essentials

* Fix a property

* Pack net6 version of essentials
2021-03-03 11:12:28 -05:00
Rui Marinho 86a6601e7d
Enable unit tests (#13864)
* [Build] Remove old steps

* Fix reference of unit tests cspro

* Enable xaml unit tests

* [Build] Add build of xaml unit tests

* Try fix targets

* Fix Forms naming

* More naming fixes

* Revert versions

* Remove .Core

* More .Core removals and Fix Platform references

* Add RootNamespace to Build.Tasks

* Fix more Xamarin.Forms old usage

* Fix dll on build.targets

* Fix _XFBuildTasksLocation

* More fixes to _MauiBuildTasksLocation

* More fixes _MauiBuildTasksLocation

* Fix _MauiBuildTasksLocation

* remove debug info

* Remove issues for now

* Rename maps namespace

* Fix Assembly tests

* Fix more targets

* More map rename fixes

* Fix xaml reference on unit tests

* Fix MauiXamlCValidateOnly naming

* More MauiXamlCValidateOnly

* Add xaml page to sample

* Fix namespace on sample page

* oh, yeah

* Fix sample references

* Try run on release the xaml unit tests

* Try continueOnerror

* Update build-windows.yml

* added via the directory props

* ws

* We mights need this

* I think I did this

* This can be reused

* 🤦‍♀️

* this as well after the peppers PR

* Fix some bad renames

* i see

* Fix merge

* Fix sample

* Remove FromSource

* Add the packages

* this

* Yaysies!

* Fix all the non-msbuild tests

* Adding things back and gallery

* this

* Build the tasks first

* Got the Android control gallery running

* remove from the sln

* Xaml pages

* Reference XAML

* this

* better XAML

* this

* restore

* maybe

* include correctly

* symbols

* Try set the versions

* remove unused steps templates

versions things more cool yay

* Updating code to pre-fix xaml

* Now we do the targets

* Revert "Now we do the targets"

This reverts commit 2ce4984d48a00c1eab8037cdd8a35690feb0038e.

* maybe this?

* We have to set the variables

* Add the control gallery and xaml unit tests

* This might help

* xaml page

* Try use matrix for build/release macOS

* Fix variables

* Fix end of script

* use matrix for build on windows

* Fix Artifact upload at same time

Co-authored-by: Stephane Delcroix <stephane@delcroix.org>
Co-authored-by: Matthew Leibowitz <mattleibow@live.com>
2021-03-03 15:20:03 +00:00
Jonathan Dick 6aaa984d78
Make .NET 6 Packable (#13881)
* Add some common nupkg properties to everything

* Remove project property refactored into directory build props

* Remove properties now in common dir build props

* Add net6 version of project

* More net6

* Only target netstandard2.0 now

net4* is no longer needed as there's no more vs2017 support

* Clean up strong naming a bit

* Update dependencies

* Package all the things for build tasks in the -t:Pack

* Add more net6 project versions

* Clean up whitespace

* Needed moar NET6

* Name fixes

* Added meta project for packaging and package script

* Remove assembly copyright (now duplicates)

* Add resizetizer, add params to package script

* Disable strong naming for now

We need to re-evaluate how we do this a bit, we should probably use the `al` tool to do it now, and I believe the StrongNamer package may not work anymore, but we can do the same thing in a custom target at a later date.

* Fix path to tasks assembly

* don't build ios on android specific project

* Finish rename of toolbox file

* - add cake

* - fix cake extras

* fix the copy for the IDE

* Try packing on CI

* versions baby!

* build release

* this should od it

* this

* oops

* Move to an empty folder

* Use new symbol formats

* no symbols for build tasks and the head

* symbol all the things

* Compiler error with commented out code XD

* oopsies

* only build transitive

* Try this

* log everything

* This might work

* REPORTS

* previews

* needed

* versions

* duh

* Update build.cake

Co-authored-by: Shane Neuville <shneuvil@microsoft.com>
Co-authored-by: Matthew Leibowitz <mattleibow@live.com>
2021-03-02 12:36:17 -05:00
Jonathan Peppers 0e94f1401a
.NET Maui "Single Project" (#13858)
Context: fcd9c30164/Documentation/guides/OneDotNetSingleProject.md

We are aiming to get a new project type working that would have a
`.csproj` such as:

    <Project Sdk="Microsoft.NET.Sdk">
      <PropertyGroup>
        <TargetFramework>net6.0-android;net6.0-ios</TargetFramework>
        <OutputType>Exe</OutputType>
        <SingleProject>true</SingleProject>
      </PropertyGroup>
    </Project>

Within the project you would have:

* `*.cs` all shared code
* `iOS/*` - iOS only stuff, including `Info.plist`
* `Android/*` - Android only stuff, including `AndroidManifest.xml`

I also used some other new settings that results in a smaller
`Info.plist` and `AndroidManifest.xml`:

    <ApplicationTitle>Single Project</ApplicationTitle>
    <ApplicationId>com.microsoft.maui.singleproject</ApplicationId>
    <ApplicationVersion>1.0</ApplicationVersion>
    <AndroidVersionCode>1</AndroidVersionCode>

The eventual goal being we might be able to completely get rid of
`Info.plist` and `AndroidManifest.xml` for simple apps. You would only
need them for edge-case, platform-specific features.

To get this working within a NuGet package, we can include two new
files:

* `Xamarin.Forms.SingleProject.props`
* `Xamarin.Forms.SingleProject.targets`

They only enable things conditionally, if `$(SingleProject)` is set.

I created a new sample with a single `Label` to demonstrate things
working.
2021-02-26 09:07:26 -06:00
Jonathan Dick ac201994f2
Rename all of the things... All of them. (#13847)
* Rename all the things!

* Fix sln on cake

* targets

* Rename all the things!

* Fix sln on cake

* Add this back so the build works

* Added .nuspec\* back

* Remove Core from XamlC

* Update Build.Tasks

* Fix ErrorMessages

* Try fix build

* Update gitignore

* Update Microsoft.Maui-net6.sln

* Fix controlgallery reference

* Fix Maui reference on iOS sample

* Fix ControLGallery sln

* Fix xaml unit tests

* Fix Maps references

* Fix ControlGallery

* Don't build gallery

* Compile 462 for new

* Dont build UAP

* AndroidUseIntermediateDesignerFile

* Fix UAP

* Don't build control gallery for now

Co-authored-by: Rui Marinho <me@ruimarinho.net>
Co-authored-by: Matthew Leibowitz <mattleibow@live.com>
2021-02-24 23:50:31 +00:00