Skip to content

Commit

Permalink
feat: update to net8 and C#12
Browse files Browse the repository at this point in the history
  • Loading branch information
carlh98 committed Jan 9, 2024
1 parent 855e6dc commit 06c228b
Show file tree
Hide file tree
Showing 18 changed files with 38 additions and 34 deletions.
5 changes: 4 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,11 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)

Prefix your items with `(Template)` if the change is about the template and not the resulting application.

## 3.1.X
- Updated to .NET 8.

## 3.0.X
- Updated to Uno 5.
- Updated to Uno 5 and .NET 7.

## 2.2.X
- Added hooks for default analytics (page views and command invocations).
Expand Down
6 changes: 3 additions & 3 deletions build/stage-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ jobs:
- name: ApplicationEnvironment
value: ${{ parameters.applicationEnvironment }}
- name: BuildTargetFramework
value: net7.0-windows10.0.22621.0
value: net8.0-windows10.0.22621.0
# For optimization, if we are on light build, we only build the project else we publish it.
- name: dotNetCommand
${{ if eq(variables['IsLightBuild'], 'true') }}:
Expand Down Expand Up @@ -107,7 +107,7 @@ jobs:
- name: ApplicationPlatform
value: AnyCPU
- name: BuildTargetFramework
value: net7.0-android
value: net8.0-android

# For optimization, if we are on light build, we only build the project else we publish it.
- name: dotNetCommand
Expand All @@ -133,7 +133,7 @@ jobs:
- name: ApplicationEnvironment
value: ${{ parameters.applicationEnvironment }}
- name: BuildTargetFramework
value: net7.0-ios
value: net8.0-ios
- name: ArtifactName
value: $(iOSArtifactName)_${{ parameters.applicationEnvironment }}

Expand Down
2 changes: 1 addition & 1 deletion build/steps-build-android.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ steps:
displayName: 'Copy Binary Files'
retryCountOnTaskFailure: 3
inputs:
SourceFolder: '${{ parameters.pathToSrc }}/app/${{ parameters.solutionName }}.Mobile/bin/Release/net7.0-android'
SourceFolder: '${{ parameters.pathToSrc }}/app/${{ parameters.solutionName }}.Mobile/bin/Release/net8.0-android'
Contents: |
**/*.aab
**/*.apk
Expand Down
4 changes: 2 additions & 2 deletions build/steps-build-ios.yml
Original file line number Diff line number Diff line change
Expand Up @@ -81,15 +81,15 @@ steps:
inputs:
Contents: '**/*.ipa'
flattenFolders : true
SourceFolder: '${{ parameters.pathToSrc }}/app/${{ parameters.solutionName }}.Mobile/bin/Release/net7.0-ios'
SourceFolder: '${{ parameters.pathToSrc }}/app/${{ parameters.solutionName }}.Mobile/bin/Release/net8.0-ios'
TargetFolder: '$(Build.ArtifactStagingDirectory)'

- task: CopyFiles@2
displayName: 'Copy DSYM'
inputs:
Contents: '**/*.dSYM/**'
flattenFolders : true
SourceFolder: '${{ parameters.pathToSrc }}/app/${{ parameters.solutionName }}.Mobile/bin/Release/net7.0-ios'
SourceFolder: '${{ parameters.pathToSrc }}/app/${{ parameters.solutionName }}.Mobile/bin/Release/net8.0-ios'
TargetFolder: '$(Build.ArtifactStagingDirectory)/${{ parameters.solutionName }}.Mobile.dSYM'

- publish: $(Build.ArtifactStagingDirectory)
Expand Down
2 changes: 1 addition & 1 deletion build/templates/dotnet-install.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
parameters:
DotNetVersion: '7.0.400'
DotNetVersion: '8.0.100'
UnoCheck_Version: '1.17.0'
UnoCheck_Manifest: 'https://raw.githubusercontent.com/unoplatform/uno.check/262bebd06e916ec022b8fdc4a2a9df14f0554b92/manifests/uno.ui.manifest.json'

Expand Down
2 changes: 1 addition & 1 deletion doc/Architecture.md
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ See [Logging.md](Logging.md) for more details.
### Testing
The architecture of application was designed with automated testing in mind.
Automated testing explains why the application is divided in layers that are not multi-targeted.
> i.e. The Access, Business, and Presentation libs target only .net7.0, and **not** .net7.0-ios nor .net7.0-android.
> i.e. The Access, Business, and Presentation libs target only .net8.0, and **not** .net8.0-ios nor .net8.0-android.
It also explains the separation of `Startup` and `CoreStartup`. `CoreStartup` can setup all the services that are non-UI dependent which can then be used to run simulations of the application using ViewModels that aren't attached to any UI.

Expand Down
4 changes: 2 additions & 2 deletions doc/PlatformSpecifics.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@ To generate this file, following the following steps:

1. Open a command prompt or terminal against your Android project’s directory that contains the .csproj.
2. Ensure only one Android device is attached.
3. Execute the following command: `dotnet build -f net7.0-android -t:BuildAndStartAotProfiling`
3. Execute the following command: `dotnet build -f net8.0-android -t:BuildAndStartAotProfiling`
- The dotnet version targetted must match the one specified in the mobile csproj.
4. Let your application run until it’s loaded.
5. Execute the following command: `dotnet build -f net7.0-android -t:FinishAotProfiling`.
5. Execute the following command: `dotnet build -f net8.0-android -t:FinishAotProfiling`.
- The dotnet version targetted must match the one specified in the mobile csproj.
6. Use this configuration in your `.csproj`.

Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<LangVersion>11.0</LangVersion>
<TargetFramework>net8.0</TargetFramework>
<LangVersion>12.0</LangVersion>
<RootNamespace>ApplicationTemplate.DataAccess</RootNamespace>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<TreatWarningsAsErrors Condition="'$(Configuration)'=='Release'">true</TreatWarningsAsErrors>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<LangVersion>11.0</LangVersion>
<TargetFramework>net8.0</TargetFramework>
<LangVersion>12.0</LangVersion>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<TreatWarningsAsErrors Condition="'$(Configuration)'=='Release'">true</TreatWarningsAsErrors>
</PropertyGroup>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<LangVersion>11.0</LangVersion>
<TargetFrameworks>net7.0-android;net7.0-ios</TargetFrameworks>
<LangVersion>12.0</LangVersion>
<TargetFrameworks>net8.0-android;net8.0-ios</TargetFrameworks>
<SingleProject>true</SingleProject>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<OutputType>Exe</OutputType>
<IsUnoHead>true</IsUnoHead>
<UseMauiEssentials>true</UseMauiEssentials>
<SupportedOSPlatformVersion Condition="'$(TargetFramework)' == 'net7.0-android'">29.0</SupportedOSPlatformVersion>
<SupportedOSPlatformVersion Condition="'$(TargetFramework)' == 'net7.0-ios'">14.2</SupportedOSPlatformVersion>
<SupportedOSPlatformVersion Condition="'$(TargetFramework)' == 'net8.0-android'">29.0</SupportedOSPlatformVersion>
<SupportedOSPlatformVersion Condition="'$(TargetFramework)' == 'net8.0-ios'">14.2</SupportedOSPlatformVersion>
<NoWarn>Uno0001</NoWarn>
</PropertyGroup>
<!-- Linker configuration. -->
Expand Down Expand Up @@ -46,7 +46,7 @@
<ProjectReference Include="..\ApplicationTemplate.Presentation\ApplicationTemplate.Presentation.csproj" />
</ItemGroup>
<Choose>
<When Condition="'$(TargetFramework)'=='net7.0-android'">
<When Condition="'$(TargetFramework)'=='net8.0-android'">
<PropertyGroup>
<AndroidCreatePackagePerAbi>False</AndroidCreatePackagePerAbi>
<BundleAssemblies>False</BundleAssemblies>
Expand Down Expand Up @@ -100,7 +100,7 @@
<ItemGroup>
<PackageReference Include="Uno.UniversalImageLoader" Version="1.9.36" />
<PackageReference Include="Mono.AotProfiler.Android" Version="7.0.0" />
<PackageReference Include="Xamarin.Kotlin.StdLib.Jdk8" Version="1.8.0" />
<PackageReference Include="Xamarin.Kotlin.StdLib.Jdk8" Version="1.9.0.1" />
</ItemGroup>
<ItemGroup>
<AndroidAotProfile Include="custom.aprof" />
Expand Down Expand Up @@ -141,7 +141,7 @@
</AndroidResource>
</ItemGroup>
</When>
<When Condition="'$(TargetFramework)'=='net7.0-ios'">
<When Condition="'$(TargetFramework)'=='net8.0-ios'">
<PropertyGroup>
<MtouchExtraArgs>$(MtouchExtraArgs) --setenv=MONO_GC_PARAMS=soft-heap-limit=512m,nursery-size=64m,evacuation-threshold=66,major=marksweep,concurrent-sweep</MtouchExtraArgs>
<MtouchExtraArgs>$(MtouchExtraArgs) --xml=./iOS/LinkerExclusions.xml --linkskip=$(AssemblyName)</MtouchExtraArgs>
Expand Down
Binary file modified src/app/ApplicationTemplate.Mobile/custom.aprof
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<LangVersion>11.0</LangVersion>
<TargetFramework>net8.0</TargetFramework>
<LangVersion>12.0</LangVersion>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<TreatWarningsAsErrors Condition="'$(Configuration)'=='Release'">true</TreatWarningsAsErrors>
</PropertyGroup>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<IsPackable>false</IsPackable>
<GenerateDocumentationFile>True</GenerateDocumentationFile>
<LangVersion>11.0</LangVersion>
<LangVersion>12.0</LangVersion>
<IsTestProject>True</IsTestProject>
<DefineConstants>TESTS</DefineConstants>
<RootNamespace></RootNamespace>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<IsPackable>false</IsPackable>
<GenerateDocumentationFile>True</GenerateDocumentationFile>
<LangVersion>11.0</LangVersion>
<LangVersion>12.0</LangVersion>
<IsTestProject>True</IsTestProject>
<DefineConstants>TESTS</DefineConstants>
</PropertyGroup>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<LangVersion>11.0</LangVersion>
<LangVersion>12.0</LangVersion>
<OutputType>WinExe</OutputType>
<TargetFramework>net7.0-windows10.0.22621.0</TargetFramework>
<TargetFramework>net8.0-windows10.0.22621.0</TargetFramework>
<TargetPlatformMinVersion>10.0.19041.0</TargetPlatformMinVersion>
<SupportedOSPlatformVersion>10.0.20348.0</SupportedOSPlatformVersion>
<RootNamespace>ApplicationTemplate</RootNamespace>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<ApplicationManifest>app.manifest</ApplicationManifest>
<Platforms>x86;x64;arm64</Platforms>
<RuntimeIdentifiers>win10-x86;win10-x64;win10-arm64</RuntimeIdentifiers>
<RuntimeIdentifiers>win-x86;win-x64;win-arm64</RuntimeIdentifiers>
<SelfContained>true</SelfContained>
<PublishProfile>win10-$(Platform).pubxml</PublishProfile>
<UseWinUI>true</UseWinUI>
<EnablePreviewMsixTooling>true</EnablePreviewMsixTooling>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ https://go.microsoft.com/fwlink/?LinkID=208121.
<PropertyGroup>
<PublishProtocol>FileSystem</PublishProtocol>
<Platform>arm64</Platform>
<RuntimeIdentifier>win10-arm64</RuntimeIdentifier>
<RuntimeIdentifier>win-arm64</RuntimeIdentifier>
<PublishDir>bin\$(Configuration)\$(TargetFramework)\$(RuntimeIdentifier)\publish\</PublishDir>
<SelfContained>true</SelfContained>
<PublishSingleFile>False</PublishSingleFile>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ https://go.microsoft.com/fwlink/?LinkID=208121.
<PropertyGroup>
<PublishProtocol>FileSystem</PublishProtocol>
<Platform>x64</Platform>
<RuntimeIdentifier>win10-x64</RuntimeIdentifier>
<RuntimeIdentifier>win-x64</RuntimeIdentifier>
<PublishDir>bin\$(Configuration)\$(TargetFramework)\$(RuntimeIdentifier)\publish\</PublishDir>
<SelfContained>true</SelfContained>
<PublishSingleFile>False</PublishSingleFile>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ https://go.microsoft.com/fwlink/?LinkID=208121.
<PropertyGroup>
<PublishProtocol>FileSystem</PublishProtocol>
<Platform>x86</Platform>
<RuntimeIdentifier>win10-x86</RuntimeIdentifier>
<RuntimeIdentifier>win-x86</RuntimeIdentifier>
<PublishDir>bin\$(Configuration)\$(TargetFramework)\$(RuntimeIdentifier)\publish\</PublishDir>
<SelfContained>true</SelfContained>
<PublishSingleFile>False</PublishSingleFile>
Expand Down

0 comments on commit 06c228b

Please sign in to comment.