Skip to content

Commit

Permalink
Fixed build issues
Browse files Browse the repository at this point in the history
  • Loading branch information
AndreasReitberger committed Oct 11, 2024
1 parent c565b73 commit 6c9c9dd
Show file tree
Hide file tree
Showing 6 changed files with 48 additions and 53 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/build_publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
with:
dotnet-version: 8.0.x
- name: Build
run: dotnet build --configuration Release
run: dotnet build --configuration Release ./src
- name: Package NuGets
shell: pwsh
run: |
Expand All @@ -34,7 +34,7 @@ jobs:
echo "PACKAGE VERSION: $VERSION"
New-Item -ItemType Directory -Force -Path .\artifacts
# dotnet pack --output ./artifacts --configuration Release -p:PackageVersion=$VERSION ./src/MauiSettings/MauiSettings.csproj
dotnet pack --output ./artifacts --configuration Release -p:PackageVersion=$VERSION ./src/MauiSettings/MauiSettings.csproj
- name: Artifacts
uses: actions/upload-artifact@v4
Expand Down
13 changes: 5 additions & 8 deletions common.props
Original file line number Diff line number Diff line change
@@ -1,12 +1,7 @@

<Project>
<Import Project="framework.maui.props" />
<PropertyGroup>
<TargetFrameworks>net8.0-android;net8.0-ios;net8.0-maccatalyst</TargetFrameworks>
<TargetFrameworks Condition="$([MSBuild]::IsOSPlatform('windows'))">$(TargetFrameworks);net8.0-windows10.0.19041.0</TargetFrameworks>
<!-- Uncomment to also build the tizen app. You will need to install tizen by following this: https://github.com/Samsung/Tizen.NET -->
<!-- <TargetFrameworks>$(TargetFrameworks);net8.0-tizen</TargetFrameworks> -->
<WindowsSdkPackageVersion>10.0.19041.41</WindowsSdkPackageVersion>

<Version>1.0.10</Version>
<PackageIcon>ar_128.png</PackageIcon>
<NeutralLanguage>en</NeutralLanguage>
Expand All @@ -20,7 +15,6 @@
<Company>Andreas Reitberger</Company>
<Copyright>Andreas Reitberger</Copyright>
<LangVersion>12</LangVersion>
<PublishReadyToRun>false</PublishReadyToRun>
<Nullable>enable</Nullable>

<!--Source-Linking-->
Expand All @@ -37,6 +31,9 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="8.0.0" PrivateAssets="All"/>
<PackageReference Include="Microsoft.Maui.Controls" Version="8.0.91" />
<PackageReference Include="Microsoft.Maui.Controls.Compatibility" Version="8.0.91" />
<PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="8.0.1" />
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="8.0.0" PrivateAssets="All"/>
</ItemGroup>
</Project>
35 changes: 35 additions & 0 deletions framework.maui.props
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@

<Project>
<PropertyGroup>
<TargetFrameworks>net8.0-android</TargetFrameworks>
<!-- Needed for GitHub action, iOS and MacOS is not workig on Linux -->
<TargetFrameworks Condition="!$([MSBuild]::IsOSPlatform('linux'))">$(TargetFrameworks);net8.0-ios;net8.0-maccatalyst</TargetFrameworks>
<TargetFrameworks Condition="$([MSBuild]::IsOSPlatform('windows'))">$(TargetFrameworks);net8.0-windows10.0.19041.0</TargetFrameworks>

<!-- Uncomment to also build the tizen app. You will need to install tizen by following this: https://github.com/Samsung/Tizen.NET -->
<!-- <TargetFrameworks>$(TargetFrameworks);net8.0-tizen</TargetFrameworks> -->
<WindowsSdkPackageVersion>10.0.19041.41</WindowsSdkPackageVersion>

<!-- General -->
<UseMaui>true</UseMaui>
<SingleProject>true</SingleProject>
<ImplicitUsings>enable</ImplicitUsings>
<PublishReadyToRun>false</PublishReadyToRun>
<IsRidAgnostic Condition="'$(OutputType)' == 'Library'">true</IsRidAgnostic>

<!-- Needed with latest SDK 8 version? -->
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>

<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'ios'">14.2</SupportedOSPlatformVersion>
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'maccatalyst'">14.0</SupportedOSPlatformVersion>
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'android'">21.0</SupportedOSPlatformVersion>
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'windows'">10.0.17763.0</SupportedOSPlatformVersion>
<TargetPlatformMinVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'windows'">10.0.17763.0</TargetPlatformMinVersion>
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'tizen'">6.5</SupportedOSPlatformVersion>
</PropertyGroup>

<!-- https://github.com/dotnet/maui/issues/9299 -->
<PropertyGroup Condition=" $([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'windows' and '$(Configuration)' == 'Release' ">
<PublishReadyToRun>true</PublishReadyToRun>
</PropertyGroup>
</Project>
32 changes: 3 additions & 29 deletions src/MauiSettings.Example/MauiSettings.Example.csproj
Original file line number Diff line number Diff line change
@@ -1,24 +1,8 @@
<Project Sdk="Microsoft.NET.Sdk">
<Import Project="..\..\common.props" />
<PropertyGroup>
<TargetFrameworks>net8.0-android;net8.0-ios;net8.0-maccatalyst</TargetFrameworks>
<TargetFrameworks Condition="$([MSBuild]::IsOSPlatform('windows'))">$(TargetFrameworks);net8.0-windows10.0.19041.0</TargetFrameworks>
<!-- Uncomment to also build the tizen app. You will need to install tizen by following this: https://github.com/Samsung/Tizen.NET -->
<!-- <TargetFrameworks>$(TargetFrameworks);net8.0-tizen</TargetFrameworks> -->
<WindowsSdkPackageVersion>10.0.19041.41</WindowsSdkPackageVersion>
<!-- Note for MacCatalyst:
The default runtime is maccatalyst-x64, except in Release config, in which case the default is maccatalyst-x64;maccatalyst-arm64.
When specifying both architectures, use the plural <RuntimeIdentifiers> instead of the singular <RuntimeIdentifier>.
The Mac App Store will NOT accept apps with ONLY maccatalyst-arm64 indicated;
either BOTH runtimes must be indicated or ONLY macatalyst-x64. -->
<!-- For example: <RuntimeIdentifiers>maccatalyst-x64;maccatalyst-arm64</RuntimeIdentifiers> -->

<OutputType>Exe</OutputType>
<RootNamespace>MauiSettings.Example</RootNamespace>
<UseMaui>true</UseMaui>
<SingleProject>true</SingleProject>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>


<!-- Display name -->
<ApplicationTitle>MauiSettings Example</ApplicationTitle>

Expand All @@ -28,13 +12,6 @@
<!-- Versions -->
<ApplicationDisplayVersion>1.0</ApplicationDisplayVersion>
<ApplicationVersion>1</ApplicationVersion>

<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'ios'">11.0</SupportedOSPlatformVersion>
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'maccatalyst'">13.1</SupportedOSPlatformVersion>
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'android'">21.0</SupportedOSPlatformVersion>
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'windows'">10.0.17763.0</SupportedOSPlatformVersion>
<TargetPlatformMinVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'windows'">10.0.17763.0</TargetPlatformMinVersion>
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'tizen'">6.5</SupportedOSPlatformVersion>
</PropertyGroup>

<ItemGroup>
Expand All @@ -56,10 +33,7 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="CommunityToolkit.Mvvm" Version="8.3.1" />
<PackageReference Include="Microsoft.Maui.Controls" Version="8.0.90" />
<PackageReference Include="Microsoft.Maui.Controls.Compatibility" Version="8.0.90" />
<PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="8.0.0" />
<PackageReference Include="CommunityToolkit.Mvvm" Version="8.3.2" />
</ItemGroup>

<ItemGroup>
Expand Down
1 change: 1 addition & 0 deletions src/MauiSettings.sln
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{3CBCD659-10AB-4B69-B12E-48998DEE148E}"
ProjectSection(SolutionItems) = preProject
..\common.props = ..\common.props
..\framework.maui.props = ..\framework.maui.props
nuget.config = nuget.config
EndProjectSection
EndProject
Expand Down
16 changes: 2 additions & 14 deletions src/MauiSettings/MauiSettings.csproj
Original file line number Diff line number Diff line change
@@ -1,18 +1,8 @@
<Project Sdk="Microsoft.NET.Sdk">
<Import Project="..\..\common.props" />
<PropertyGroup>
<UseMaui>true</UseMaui>
<SingleProject>true</SingleProject>
<ImplicitUsings>enable</ImplicitUsings>
<PublishReadyToRun>false</PublishReadyToRun>
<Nullable>enable</Nullable>

<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'ios'">14.2</SupportedOSPlatformVersion>
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'maccatalyst'">14.0</SupportedOSPlatformVersion>
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'android'">21.0</SupportedOSPlatformVersion>
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'windows'">10.0.17763.0</SupportedOSPlatformVersion>
<TargetPlatformMinVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'windows'">10.0.17763.0</TargetPlatformMinVersion>
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'tizen'">6.5</SupportedOSPlatformVersion>
<TargetFrameworks>$(TargetFrameworks);net8.0</TargetFrameworks>
<OutputType>Library</OutputType>

<RootNamespace>AndreasReitberger.Maui</RootNamespace>
<Description>A .NET MAUI library to store settings locally and in the cloud</Description>
Expand All @@ -29,8 +19,6 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.Maui.Controls" Version="8.0.90" />
<PackageReference Include="Microsoft.Maui.Controls.Compatibility" Version="8.0.90" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
<PackageReference Include="SharedNetCoreLibrary" Version="1.1.12" />
</ItemGroup>
Expand Down

0 comments on commit 6c9c9dd

Please sign in to comment.