Skip to content

Commit 02a712f

Browse files
Merge pull request #140 from brminnick/Create-MAUI-Sample
Add MAUI Sample
2 parents 8963a87 + c45830d commit 02a712f

File tree

95 files changed

+3151
-71
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

95 files changed

+3151
-71
lines changed

.gitignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -348,3 +348,9 @@ MigrationBackup/
348348

349349
# Ionide (cross platform F# VS Code tools) working folder
350350
.ionide/
351+
352+
# JetBrains Rider
353+
.idea/
354+
*.sln.iml
355+
**/.DS_Store
356+
**/.meteor

azure-pipelines.yml

Lines changed: 83 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -1,46 +1,89 @@
1-
trigger:
2-
- master
3-
4-
pr:
5-
- master
6-
7-
pool:
8-
vmImage: 'windows-latest'
9-
101
variables:
112
solutionUwp: 'samples/MvvmSampleUwp.sln'
12-
solutionXf: 'samples/MvvmSampleUwp.sln'
3+
solutionXf: 'samples/MvvmSampleXF.sln'
4+
solutionMaui: 'samples/MvvmSampleMAUI.sln'
135
buildPlatform: 'x86|x64|ARM|ARM64'
146
buildConfiguration: 'Release'
157
appxPackageDir: '$(build.artifactStagingDirectory)\AppxPackages\\'
8+
Xcode_Version: '16'
9+
10+
trigger:
11+
branches:
12+
include:
13+
- master
14+
15+
pr:
16+
autoCancel: 'true'
17+
branches:
18+
include:
19+
- master
20+
21+
jobs:
22+
- job: build_samples
23+
displayName: Build Sample Apps
24+
strategy:
25+
matrix:
26+
'Windows':
27+
image: 'windows-latest'
28+
'macOS':
29+
image: 'macos-14'
30+
pool:
31+
vmImage: $(image)
32+
steps:
33+
- task: UseDotNet@2
34+
displayName: 'Install Latest .NET SDK, v8.0.x'
35+
inputs:
36+
packageType: 'sdk'
37+
version: '8.0.x'
38+
includePreviewVersions: false
39+
40+
- task: CmdLine@2
41+
displayName: 'Set Xcode v$(Xcode_Version)'
42+
condition: eq(variables['Agent.OS'], 'Darwin') # Only run this step on macOS
43+
inputs:
44+
script: echo '##vso[task.setvariable variable=MD_APPLE_SDK_ROOT;]'/Applications/Xcode_$(Xcode_Version).app;sudo xcode-select --switch /Applications/Xcode_$(Xcode_Version).app/Contents/Developer
45+
46+
- task: CmdLine@2
47+
displayName: 'Install Latest .NET MAUI Workload'
48+
inputs:
49+
script: 'dotnet workload install maui'
50+
51+
- task: NuGetToolInstaller@1
52+
displayName: Install NuGet tool
53+
54+
- task: CmdLine@2
55+
displayName: 'Update Git Submodules'
56+
inputs:
57+
script: 'git submodule update --init --recursive'
58+
59+
- task: NuGetCommand@2
60+
condition: eq(variables['Agent.OS'], 'Windows_NT') # Only run this step on Windows
61+
displayName: Restore NuGet Packages (Windows)
62+
inputs:
63+
command: 'restore'
64+
restoreSolution: '**/*.sln'
65+
feedsToUse: 'config'
66+
nugetConfigPath: ./samples/nuget.config
67+
68+
- task: CmdLine@2
69+
displayName: Restore NuGet Packages (macOS)
70+
condition: eq(variables['Agent.OS'], 'Darwin') # Only run this step on macOS
71+
inputs:
72+
script: |
73+
dotnet restore $(solutionUwp) --configfile ./samples/nuget.config
74+
dotnet restore $(solutionXf) --configfile ./samples/nuget.config
75+
dotnet restore $(solutionMaui) --configfile ./samples/nuget.config
76+
77+
- task: VSBuild@1
78+
displayName: Build UWP solution
79+
condition: eq(variables['Agent.OS'], 'Windows_NT') # Only run this step on Windows
80+
inputs:
81+
platform: 'x86'
82+
solution: '$(solutionUwp)'
83+
configuration: '$(buildConfiguration)'
84+
msbuildArgs: '/p:AppxBundlePlatforms="$(buildPlatform)" /p:AppxPackageDir="$(appxPackageDir)" /p:AppxBundle=Always /p:UapAppxPackageBuildMode=StoreUpload'
1685

17-
steps:
18-
- task: NuGetToolInstaller@1
19-
displayName: Install NuGet tool
20-
21-
- task: CmdLine@2
22-
inputs:
23-
script: 'git submodule update --init --recursive'
24-
25-
- task: NuGetCommand@2
26-
displayName: Restore solution(s)
27-
inputs:
28-
command: 'restore'
29-
restoreSolution: '**/*.sln'
30-
feedsToUse: 'config'
31-
nugetConfigPath: ./samples/nuget.config
32-
33-
- task: VSBuild@1
34-
displayName: Build UWP solution
35-
inputs:
36-
platform: 'x86'
37-
solution: '$(solutionUwp)'
38-
configuration: '$(buildConfiguration)'
39-
msbuildArgs: '/p:AppxBundlePlatforms="$(buildPlatform)" /p:AppxPackageDir="$(appxPackageDir)" /p:AppxBundle=Always /p:UapAppxPackageBuildMode=StoreUpload'
40-
41-
- task: VSBuild@1
42-
displayName: Build Xamarin.Forms solution
43-
inputs:
44-
platform: 'Any CPU'
45-
solution: '$(solutionXf)'
46-
configuration: '$(buildConfiguration)'
86+
- task: CmdLine@2
87+
displayName: 'Build .NET MAUI solution'
88+
inputs:
89+
script: 'dotnet build -c Release $(solutionMaui)'

samples/Directory.Build.props

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
<Project>
22
<PropertyGroup>
3-
<LangVersion>10.0</LangVersion>
3+
<NetVersion>net8.0</NetVersion>
4+
<LangVersion>latest</LangVersion>
45
<Nullable>enable</Nullable>
56
</PropertyGroup>
67
</Project>

samples/Directory.Build.targets

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<Project>
3+
<ItemGroup Condition="$(TargetFramework.StartsWith('Xamarin.iOS')) != true AND $(TargetFramework.StartsWith('$(NetVersion)-ios')) != true">
4+
<Compile Remove="**\**\*.ios.cs" />
5+
<None Include="**\**\*.ios.cs" Exclude="$(DefaultItemExcludes);$(DefaultExcludesInProjectFolder)" />
6+
<Compile Remove="**\ios\**\*.cs" />
7+
<None Include="**\ios\**\*.cs" Exclude="$(DefaultItemExcludes);$(DefaultExcludesInProjectFolder)" />
8+
</ItemGroup>
9+
<ItemGroup Condition="$(TargetFramework.StartsWith('Xamarin.Mac')) != true AND $(TargetFramework.StartsWith('$(NetVersion)-maccatalyst')) != true">
10+
<Compile Remove="**\*.macos.cs" />
11+
<None Include="**\*.macos.cs" Exclude="$(DefaultItemExcludes);$(DefaultExcludesInProjectFolder)" />
12+
<Compile Remove="**\macos\**\*.cs" />
13+
<None Include="**\macos\**\*.cs" Exclude="$(DefaultItemExcludes);$(DefaultExcludesInProjectFolder)" />
14+
</ItemGroup>
15+
<ItemGroup Condition="$(TargetFramework.StartsWith('Xamarin.Mac')) != true AND $(TargetFramework.StartsWith('Xamarin.iOS')) != true AND $(TargetFramework.StartsWith('$(NetVersion)-ios')) != true AND $(TargetFramework.StartsWith('$(NetVersion)-maccatalyst')) != true">
16+
<Compile Remove="**\*.macios.cs" />
17+
<None Include="**\*.macios.cs" Exclude="$(DefaultItemExcludes);$(DefaultExcludesInProjectFolder)" />
18+
<Compile Remove="**\macios\**\*.cs" />
19+
<None Include="**\macios\**\*.cs" Exclude="$(DefaultItemExcludes);$(DefaultExcludesInProjectFolder)" />
20+
</ItemGroup>
21+
<ItemGroup Condition="$(TargetFramework.StartsWith('MonoAndroid')) != true AND $(TargetFramework.StartsWith('$(NetVersion)-android')) != true ">
22+
<Compile Remove="**\**\*.android.cs" />
23+
<None Include="**\**\*.android.cs" Exclude="$(DefaultItemExcludes);$(DefaultExcludesInProjectFolder)" />
24+
<Compile Remove="**\android\**\*.cs" />
25+
<None Include="**\android\**\*.cs" Exclude="$(DefaultItemExcludes);$(DefaultExcludesInProjectFolder)" />
26+
</ItemGroup>
27+
<ItemGroup Condition="$(TargetFramework.Contains('-windows')) != true ">
28+
<Compile Remove="**\*.windows.cs" />
29+
<None Include="**\*.windows.cs" Exclude="$(DefaultItemExcludes);$(DefaultExcludesInProjectFolder)" />
30+
<Compile Remove="**\windows\**\*.cs" />
31+
<None Include="**\windows\**\*.cs" Exclude="$(DefaultItemExcludes);$(DefaultExcludesInProjectFolder)" />
32+
</ItemGroup>
33+
<ItemGroup Condition="$(TargetFramework.Contains('-tizen')) != true ">
34+
<Compile Remove="**\*.tizen.cs" />
35+
<None Include="**\*.tizen.cs" Exclude="$(DefaultItemExcludes);$(DefaultExcludesInProjectFolder)" />
36+
<Compile Remove="**\tizen\**\*.cs" />
37+
<None Include="**\tizen\**\*.cs" Exclude="$(DefaultItemExcludes);$(DefaultExcludesInProjectFolder)" />
38+
</ItemGroup>
39+
<ItemGroup Condition="!($(TargetFramework.StartsWith('net')) == true AND $(TargetFramework.EndsWith('.0')) == true AND $(TargetFramework.Contains('-')) != true)"> <!-- e.g net6.0 or net7.0 -->
40+
<Compile Remove="**\*.net.cs" />
41+
<None Include="**\*.net.cs" Exclude="$(DefaultItemExcludes);$(DefaultExcludesInProjectFolder)" />
42+
<Compile Remove="**\net\**\*.cs" />
43+
<None Include="**\net\**\*.cs" Exclude="$(DefaultItemExcludes);$(DefaultExcludesInProjectFolder)" />
44+
</ItemGroup>
45+
</Project>

samples/MvvmSampleMAUI.sln

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
2+
Microsoft Visual Studio Solution File, Format Version 12.00
3+
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{2F02FAF9-B9BD-405B-8987-51540C89ED18}"
4+
ProjectSection(SolutionItems) = preProject
5+
Directory.Build.props = Directory.Build.props
6+
Directory.Build.targets = Directory.Build.targets
7+
EndProjectSection
8+
EndProject
9+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MvvmSample.Core", "MvvmSample.Core\MvvmSample.Core.csproj", "{770388CB-6068-4201-89B6-CA131B1DC59D}"
10+
EndProject
11+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MvvmSampleMAUI", "MvvmSampleMAUI\MvvmSampleMAUI.csproj", "{9C555BCA-8745-4894-ABE4-2C7757E8450F}"
12+
EndProject
13+
Global
14+
GlobalSection(SolutionConfigurationPlatforms) = preSolution
15+
Debug|Any CPU = Debug|Any CPU
16+
Release|Any CPU = Release|Any CPU
17+
EndGlobalSection
18+
GlobalSection(ProjectConfigurationPlatforms) = postSolution
19+
{770388CB-6068-4201-89B6-CA131B1DC59D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
20+
{770388CB-6068-4201-89B6-CA131B1DC59D}.Debug|Any CPU.Build.0 = Debug|Any CPU
21+
{770388CB-6068-4201-89B6-CA131B1DC59D}.Release|Any CPU.ActiveCfg = Release|Any CPU
22+
{770388CB-6068-4201-89B6-CA131B1DC59D}.Release|Any CPU.Build.0 = Release|Any CPU
23+
{9C555BCA-8745-4894-ABE4-2C7757E8450F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
24+
{9C555BCA-8745-4894-ABE4-2C7757E8450F}.Debug|Any CPU.Build.0 = Debug|Any CPU
25+
{9C555BCA-8745-4894-ABE4-2C7757E8450F}.Release|Any CPU.ActiveCfg = Release|Any CPU
26+
{9C555BCA-8745-4894-ABE4-2C7757E8450F}.Release|Any CPU.Build.0 = Release|Any CPU
27+
EndGlobalSection
28+
EndGlobal

0 commit comments

Comments
 (0)