Skip to content

Commit

Permalink
Merge the app and library sample projects (dotnet#6549)
Browse files Browse the repository at this point in the history
* Merge the app and library sample projects

* Fixed namespaces and removed old platform projects

* flip order for ease

* fix this page
  • Loading branch information
mattleibow committed Apr 27, 2022
1 parent abed59b commit 9aeaa32
Show file tree
Hide file tree
Showing 48 changed files with 71 additions and 498 deletions.
19 changes: 7 additions & 12 deletions .github/DEVELOPMENT.md
Original file line number Diff line number Diff line change
Expand Up @@ -141,17 +141,12 @@ dotnet build src\DotNet\DotNet.csproj
dotnet cake --target=VS-DOGFOOD
```

To build & run .NET 6 sample apps, you will also need to use `.\bin\dotnet\dotnet` or just `dotnet` if you've installed the workloads globally:
```dotnetcli
.\bin\dotnet\dotnet build src\Controls\samples\Controls.Sample.Droid\Maui.Controls.Sample.Droid.csproj -t:Run
.\bin\dotnet\dotnet build src\Controls\samples\Controls.Sample.iOS\Maui.Controls.Sample.iOS.csproj -t:Run
```

Try out a "single project", you will need the `-f` switch to choose the platform:
To build & run .NET 6 sample apps, you will also need to use `.\bin\dotnet\dotnet` or just `dotnet` if you've
installed the workloads globally: as well as need the `-f` switch to choose the platform:

```dotnetcli
.\bin\dotnet\dotnet build src\Controls\samples\Controls.Sample.SingleProject\Maui.Controls.Sample.SingleProject.csproj -t:Run -f net6.0-android
.\bin\dotnet\dotnet build src\Controls\samples\Controls.Sample.SingleProject\Maui.Controls.Sample.SingleProject.csproj -t:Run -f net6.0-ios
.\bin\dotnet\dotnet build src\Controls\samples\Controls.Sample\Maui.Controls.Sample.csproj -t:Run -f net6.0-android
.\bin\dotnet\dotnet build src\Controls\samples\Controls.Sample\Maui.Controls.Sample.csproj -t:Run -f net6.0-ios
```

#### MacOS
Expand All @@ -169,9 +164,9 @@ dotnet build Microsoft.Maui-mac.slnf
Try out a "single project", you will need the `-f` switch to choose the platform:

```bash
dotnet build src/Controls/samples/Controls.Sample.SingleProject/Maui.Controls.Sample.SingleProject.csproj -t:Run -f net6.0-ios
dotnet build src/Controls/samples/Controls.Sample.SingleProject/Maui.Controls.Sample.SingleProject.csproj -t:Run -f net6.0-maccatalyst
dotnet build src/Controls/samples/Controls.Sample.SingleProject/Maui.Controls.Sample.SingleProject.csproj -t:Run -f net6.0-android
dotnet build src/Controls/samples/Controls.Sample/Maui.Controls.Sample.csproj -t:Run -f net6.0-ios
dotnet build src/Controls/samples/Controls.Sample/Maui.Controls.Sample.csproj -t:Run -f net6.0-maccatalyst
dotnet build src/Controls/samples/Controls.Sample/Maui.Controls.Sample.csproj -t:Run -f net6.0-android
```

### Blazor Desktop
Expand Down
4 changes: 2 additions & 2 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,10 @@
// in vscode.
"id": "project",
"type": "pickString",
"default": "src/Controls/samples/Controls.Sample.SingleProject/Maui.Controls.Sample.SingleProject.csproj",
"default": "src/Controls/samples/Controls.Sample/Maui.Controls.Sample.csproj",
"description": "Pick the Project you want to build.",
"options": [
"src/Controls/samples/Controls.Sample.SingleProject/Maui.Controls.Sample.SingleProject.csproj",
"src/Controls/samples/Controls.Sample/Maui.Controls.Sample.csproj",
]
},
{
Expand Down
1 change: 0 additions & 1 deletion Microsoft.Maui-mac.slnf
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
"src\\Controls\\Maps\\src\\Controls.Maps.csproj",
"src\\Controls\\samples\\Controls.Sample.Profiling\\Maui.Controls.Sample.Profiling.csproj",
"src\\Controls\\samples\\Controls.Sample.Sandbox\\Maui.Controls.Sample.Sandbox.csproj",
"src\\Controls\\samples\\Controls.Sample.SingleProject\\Maui.Controls.Sample.SingleProject.csproj",
"src\\Controls\\samples\\Controls.Sample\\Maui.Controls.Sample.csproj",
"src\\Controls\\src\\Build.Tasks\\Controls.Build.Tasks.csproj",
"src\\Controls\\src\\Core.Design\\Controls.Core.Design.csproj",
Expand Down
1 change: 0 additions & 1 deletion Microsoft.Maui.Samples.slnf
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
"src\\BlazorWebView\\samples\\MauiRazorClassLibrarySample\\MauiRazorClassLibrarySample.csproj",
"src\\Controls\\Foldable\\src\\Controls.Foldable.csproj",
"src\\Controls\\samples\\Controls.Sample.Sandbox\\Maui.Controls.Sample.Sandbox.csproj",
"src\\Controls\\samples\\Controls.Sample.SingleProject\\Maui.Controls.Sample.SingleProject.csproj",
"src\\Controls\\samples\\Controls.Sample\\Maui.Controls.Sample.csproj"
]
}
Expand Down
15 changes: 5 additions & 10 deletions Microsoft.Maui.sln
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "samples", "samples", "{E108
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Maui.Controls.Sample", "src\Controls\samples\Controls.Sample\Maui.Controls.Sample.csproj", "{B8DC1324-977C-46F1-B697-9064ADE6099A}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Maui.Controls.Sample.SingleProject", "src\Controls\samples\Controls.Sample.SingleProject\Maui.Controls.Sample.SingleProject.csproj", "{CB495F62-CFE6-4975-AED8-F26B6C5D0113}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Compatibility", "Compatibility", "{123AA89E-1638-4E0E-B828-B8F9F9F906A2}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Core", "Core", "{09C264E9-E3F3-4586-9151-DCBB1F6DA7AB}"
Expand Down Expand Up @@ -201,9 +199,9 @@ EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "SharedSource", "SharedSource", "{4F2926C8-43AB-4328-A735-D9EAD699F81D}"
ProjectSection(SolutionItems) = preProject
src\BlazorWebView\src\SharedSource\QueryStringHelper.cs = src\BlazorWebView\src\SharedSource\QueryStringHelper.cs
src\BlazorWebView\src\SharedSource\UrlLoadingEventArgs.cs = src\BlazorWebView\src\SharedSource\UrlLoadingEventArgs.cs
src\BlazorWebView\src\SharedSource\UrlLoadingStrategy.cs = src\BlazorWebView\src\SharedSource\UrlLoadingStrategy.cs
src\BlazorWebView\src\SharedSource\WebView2WebViewManager.cs = src\BlazorWebView\src\SharedSource\WebView2WebViewManager.cs
src\BlazorWebView\src\SharedSource\UrlLoadingEventArgs.cs = src\BlazorWebView\src\SharedSource\UrlLoadingEventArgs.cs
EndProjectSection
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Benchmarks.Droid", "src\Core\tests\Benchmarks.Droid\Benchmarks.Droid.csproj", "{5B56A734-D53C-4635-A53E-F889FCFCDD66}"
Expand All @@ -228,14 +226,10 @@ Global
{00A11C2F-969F-4964-8557-91ADF4B1523D}.Release|Any CPU.Build.0 = Release|Any CPU
{B8DC1324-977C-46F1-B697-9064ADE6099A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{B8DC1324-977C-46F1-B697-9064ADE6099A}.Debug|Any CPU.Build.0 = Debug|Any CPU
{B8DC1324-977C-46F1-B697-9064ADE6099A}.Debug|Any CPU.Deploy.0 = Debug|Any CPU
{B8DC1324-977C-46F1-B697-9064ADE6099A}.Release|Any CPU.ActiveCfg = Release|Any CPU
{B8DC1324-977C-46F1-B697-9064ADE6099A}.Release|Any CPU.Build.0 = Release|Any CPU
{CB495F62-CFE6-4975-AED8-F26B6C5D0113}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{CB495F62-CFE6-4975-AED8-F26B6C5D0113}.Debug|Any CPU.Build.0 = Debug|Any CPU
{CB495F62-CFE6-4975-AED8-F26B6C5D0113}.Debug|Any CPU.Deploy.0 = Debug|Any CPU
{CB495F62-CFE6-4975-AED8-F26B6C5D0113}.Release|Any CPU.ActiveCfg = Release|Any CPU
{CB495F62-CFE6-4975-AED8-F26B6C5D0113}.Release|Any CPU.Build.0 = Release|Any CPU
{CB495F62-CFE6-4975-AED8-F26B6C5D0113}.Release|Any CPU.Deploy.0 = Release|Any CPU
{B8DC1324-977C-46F1-B697-9064ADE6099A}.Release|Any CPU.Deploy.0 = Release|Any CPU
{75C380E0-CE53-4C01-B89F-CF685331DE18}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{75C380E0-CE53-4C01-B89F-CF685331DE18}.Debug|Any CPU.Build.0 = Debug|Any CPU
{75C380E0-CE53-4C01-B89F-CF685331DE18}.Release|Any CPU.ActiveCfg = Release|Any CPU
Expand Down Expand Up @@ -427,6 +421,7 @@ Global
{C7131F14-274F-4B55-ACA9-E81731AD012F}.Debug|Any CPU.Deploy.0 = Debug|Any CPU
{C7131F14-274F-4B55-ACA9-E81731AD012F}.Release|Any CPU.ActiveCfg = Release|Any CPU
{C7131F14-274F-4B55-ACA9-E81731AD012F}.Release|Any CPU.Build.0 = Release|Any CPU
{C7131F14-274F-4B55-ACA9-E81731AD012F}.Release|Any CPU.Deploy.0 = Release|Any CPU
{A34EBE01-25BF-4E69-A2DC-2288DC625541}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{A34EBE01-25BF-4E69-A2DC-2288DC625541}.Debug|Any CPU.Build.0 = Debug|Any CPU
{A34EBE01-25BF-4E69-A2DC-2288DC625541}.Release|Any CPU.ActiveCfg = Release|Any CPU
Expand All @@ -440,6 +435,7 @@ Global
{C677BF3D-B234-491D-BA48-D9742DB564F8}.Debug|Any CPU.Deploy.0 = Debug|Any CPU
{C677BF3D-B234-491D-BA48-D9742DB564F8}.Release|Any CPU.ActiveCfg = Release|Any CPU
{C677BF3D-B234-491D-BA48-D9742DB564F8}.Release|Any CPU.Build.0 = Release|Any CPU
{C677BF3D-B234-491D-BA48-D9742DB564F8}.Release|Any CPU.Deploy.0 = Release|Any CPU
{F7DB0CB3-D244-403A-8C3B-B1ED5E5838EC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{F7DB0CB3-D244-403A-8C3B-B1ED5E5838EC}.Debug|Any CPU.Build.0 = Debug|Any CPU
{F7DB0CB3-D244-403A-8C3B-B1ED5E5838EC}.Release|Any CPU.ActiveCfg = Release|Any CPU
Expand Down Expand Up @@ -516,7 +512,6 @@ Global
{00A11C2F-969F-4964-8557-91ADF4B1523D} = {446EB407-57EB-441D-9ADB-1A006CBF672A}
{E1082E26-D700-4127-9329-66D673FD2D55} = {459BF674-83CB-46F6-881F-A2D2117DBF4D}
{B8DC1324-977C-46F1-B697-9064ADE6099A} = {E1082E26-D700-4127-9329-66D673FD2D55}
{CB495F62-CFE6-4975-AED8-F26B6C5D0113} = {E1082E26-D700-4127-9329-66D673FD2D55}
{75C380E0-CE53-4C01-B89F-CF685331DE18} = {50C758FE-4E10-409A-94F5-A75480960864}
{39B47A3C-21CA-4B28-9250-14FD957EB0FC} = {A1D83459-24AC-4124-AE5F-09F0318AF0EB}
{9909F93F-C085-4F76-B92A-5D8C516BF47D} = {F3FFE2E4-E89E-46A9-A180-FDA8908BA21D}
Expand Down
9 changes: 0 additions & 9 deletions _omnisharp.sln
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "samples", "samples", "{E108
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Maui.Controls.Sample", "src\Controls\samples\Controls.Sample\Maui.Controls.Sample.csproj", "{B8DC1324-977C-46F1-B697-9064ADE6099A}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Maui.Controls.Sample.SingleProject", "src\Controls\samples\Controls.Sample.SingleProject\Maui.Controls.Sample.SingleProject.csproj", "{CB495F62-CFE6-4975-AED8-F26B6C5D0113}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Compatibility", "Compatibility", "{123AA89E-1638-4E0E-B828-B8F9F9F906A2}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Core", "Core", "{09C264E9-E3F3-4586-9151-DCBB1F6DA7AB}"
Expand Down Expand Up @@ -116,12 +114,6 @@ Global
{B8DC1324-977C-46F1-B697-9064ADE6099A}.Debug|Any CPU.Build.0 = Debug|Any CPU
{B8DC1324-977C-46F1-B697-9064ADE6099A}.Release|Any CPU.ActiveCfg = Release|Any CPU
{B8DC1324-977C-46F1-B697-9064ADE6099A}.Release|Any CPU.Build.0 = Release|Any CPU
{CB495F62-CFE6-4975-AED8-F26B6C5D0113}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{CB495F62-CFE6-4975-AED8-F26B6C5D0113}.Debug|Any CPU.Build.0 = Debug|Any CPU
{CB495F62-CFE6-4975-AED8-F26B6C5D0113}.Debug|Any CPU.Deploy.0 = Debug|Any CPU
{CB495F62-CFE6-4975-AED8-F26B6C5D0113}.Release|Any CPU.ActiveCfg = Release|Any CPU
{CB495F62-CFE6-4975-AED8-F26B6C5D0113}.Release|Any CPU.Build.0 = Release|Any CPU
{CB495F62-CFE6-4975-AED8-F26B6C5D0113}.Release|Any CPU.Deploy.0 = Release|Any CPU
{39B47A3C-21CA-4B28-9250-14FD957EB0FC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{39B47A3C-21CA-4B28-9250-14FD957EB0FC}.Debug|Any CPU.Build.0 = Debug|Any CPU
{39B47A3C-21CA-4B28-9250-14FD957EB0FC}.Release|Any CPU.ActiveCfg = Release|Any CPU
Expand Down Expand Up @@ -223,7 +215,6 @@ Global
{00A11C2F-969F-4964-8557-91ADF4B1523D} = {446EB407-57EB-441D-9ADB-1A006CBF672A}
{E1082E26-D700-4127-9329-66D673FD2D55} = {459BF674-83CB-46F6-881F-A2D2117DBF4D}
{B8DC1324-977C-46F1-B697-9064ADE6099A} = {E1082E26-D700-4127-9329-66D673FD2D55}
{CB495F62-CFE6-4975-AED8-F26B6C5D0113} = {E1082E26-D700-4127-9329-66D673FD2D55}
{39B47A3C-21CA-4B28-9250-14FD957EB0FC} = {A1D83459-24AC-4124-AE5F-09F0318AF0EB}
{92644F6F-5946-48FC-A21A-A3D6EE24E8B3} = {C564DDD6-DE79-45CD-88EA-3F690481572A}
{E8AD265B-3C67-4640-AC58-A522F9FB3361} = {09C264E9-E3F3-4586-9151-DCBB1F6DA7AB}
Expand Down
8 changes: 0 additions & 8 deletions build.cake
Original file line number Diff line number Diff line change
Expand Up @@ -844,14 +844,6 @@ Task("VSMAC")
GetMSBuildSettings()
.WithRestore());
MSBuild("src/Controls/samples/Controls.Sample.Droid/Controls.Sample.Droid.csproj",
GetMSBuildSettings()
.WithRestore());
MSBuild("src/Controls/samples/Controls.Sample.iOS/Controls.Sample.iOS.csproj",
new MSBuildSettings().WithRestore());
MSBuild("src/Essentials/src/Essentials.csproj",
GetMSBuildSettings()
.WithRestore());
Expand Down
28 changes: 0 additions & 28 deletions eng/cake/dotnet.cake
Original file line number Diff line number Diff line change
Expand Up @@ -393,34 +393,6 @@ Task("VS-ANDROID")
StartVisualStudioForDotNet6("./Microsoft.Maui.Droid.sln");
});

Task("SAMPLE-ANDROID")
.Description("Provisions .NET 6 and launches Android Sample.")
.IsDependentOn("dotnet")
.IsDependentOn("dotnet-buildtasks")
.Does(() =>
{
RunMSBuildWithDotNet("./src/Controls/samples/Controls.Sample.Droid/Maui.Controls.Sample.Droid.csproj", target: "Run");
});

Task("SAMPLE-IOS")
.Description("Provisions .NET 6 and launches launches iOS Sample.")
.IsDependentOn("dotnet")
.IsDependentOn("dotnet-buildtasks")
.Does(() =>
{
RunMSBuildWithDotNet("./src/Controls/samples/Controls.Sample.iOS/Maui.Controls.Sample.iOS.csproj", target: "Run");
});

Task("SAMPLE-MAC")
.Description("Provisions .NET 6 and launches Mac Catalyst Sample.")
.IsDependentOn("dotnet")
.IsDependentOn("dotnet-buildtasks")
.Does(() =>
{
RunMSBuildWithDotNet("./src/Controls/samples/Controls.Sample.MacCatalyst/Maui.Controls.Sample.MacCatalyst.csproj", target: "Run");
});


string FindMSBuild()
{
if (!string.IsNullOrWhiteSpace(MSBuildExe))
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
using Android.Content.PM;
using Microsoft.Maui;

namespace Maui.Controls.Sample.Droid
namespace Maui.Controls.Sample.Platform
{
[Activity(
Theme = "@style/Maui.SplashTheme",
Expand Down
Loading

0 comments on commit 9aeaa32

Please sign in to comment.