Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 16 additions & 11 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,30 +9,35 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup .NET
uses: actions/setup-dotnet@v3
uses: actions/setup-dotnet@v4
with:
dotnet-version: |
6.0.x
7.0.x
8.0.x
dotnet-version: 9.0.x
- name: Retore Workload
run: dotnet workload restore
- name: Restore dependencies
run: dotnet restore
# This action does a nice job of updating the version, but it does not ensure a valid version format.
- name: .NET project version updater
- name: Prepare assembly version
id: version
run: |
VERSION=${{ github.event.release.name }}
echo "assembly=${VERSION%-*}.${{ github.run_number }}" >> "$GITHUB_OUTPUT"
- name: Update project version
uses: vers-one/dotnet-project-version-updater@v1.7
with:
file: |
"Float.Core/Float.Core.csproj", "**/*.nuspec", "**/AssemblyInfo.cs"
file: "**/*.csproj"
version: ${{ github.event.release.name }}
- name: Update assembly version
uses: vers-one/dotnet-project-version-updater@v1.7
with:
file: "**/AssemblyInfo.cs"
version: ${{ steps.version.outputs.assembly }}
- name: Build Library
run: dotnet build ./Float.Core/Float.Core.csproj --configuration Release --no-restore
- name: Pack and Upload
- name: Pack
run: dotnet pack --configuration Release --no-restore
- name: Archive artifact
uses: actions/upload-artifact@v4
Expand Down
7 changes: 3 additions & 4 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,13 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Setup .NET
uses: actions/setup-dotnet@v3
uses: actions/setup-dotnet@v4
with:
dotnet-version: |
6.0.x
7.0.x
8.0.x
9.0.x
- name: Restore Workload
run: dotnet workload restore
- name: Restore dependencies
Expand Down
4 changes: 3 additions & 1 deletion Float.Core.Tests/DebounceCommand.tests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ namespace Float.Core.Tests
{
public class DebounceCommandTests
{
Timer timer;

[Fact]
public async Task TestDoesDebounceTimer()
{
Expand All @@ -23,7 +25,7 @@ public async Task TestDoesDebounceTimer()
var debouncedIncrementCommand = new DebounceCommand(incrementCommand, 450);

// attempt to increment every 100ms
new Timer(arg => debouncedIncrementCommand.Execute(arg), null, 100, 100);
timer = new Timer(arg => debouncedIncrementCommand.Execute(arg), null, 100, 100);

// wait one second
await Task.Delay(1000);
Expand Down
17 changes: 8 additions & 9 deletions Float.Core.Tests/Float.Core.Tests.csproj
Original file line number Diff line number Diff line change
@@ -1,23 +1,22 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>net7.0;net8.0;</TargetFrameworks>
<TargetFrameworks>net8.0;net9.0;</TargetFrameworks>
<IsPackable>false</IsPackable>
<LangVersion>9.0</LangVersion>
<UseMaui>true</UseMaui>
</PropertyGroup>
<ItemGroup>
<AdditionalFiles Include="../stylecop.json" />
</ItemGroup>
<PropertyGroup>
<CodeAnalysisRuleSet>../stylecop.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<ItemGroup Condition="'$(TargetFramework)' == 'net8.0' OR '$(TargetFramework)' == 'net7.0'">
<PackageReference Include="coverlet.collector" Version="6.0.0">
<ItemGroup Condition="'$(TargetFramework)' == 'net9.0' OR '$(TargetFramework)' == 'net8.0'">
<PackageReference Include="coverlet.collector" Version="6.0.4">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="xunit" Version="2.5.0" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.5.0">
<PackageReference Include="xunit" Version="2.9.3" />
<PackageReference Include="xunit.runner.visualstudio" Version="3.1.0">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
Expand All @@ -33,9 +32,9 @@
</ItemGroup>
<ItemGroup>
<DotNetCliToolReference Include="dotnet-xunit" Version="2.3.1" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.4.1" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.2" />
<PackageReference Include="XunitContext" Version="3.2.5" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.14.0" />
<PackageReference Include="Newtonsoft.Json" Version="[13.0.3,]" />
<PackageReference Include="XunitContext" Version="3.3.2" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Float.Core\Float.Core.csproj" />
Expand Down
17 changes: 13 additions & 4 deletions Float.Core/Float.Core.csproj
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>net7.0;net8.0;</TargetFrameworks>
<TargetFrameworks>netstandard2;net7.0;net8.0;net9.0;</TargetFrameworks>
<AssemblyName>Float.Core</AssemblyName>
<AssemblyAuthor>Float</AssemblyAuthor>
<AssemblyDescription>Common utility code used by Float projects.</AssemblyDescription>
Expand Down Expand Up @@ -37,11 +37,20 @@
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="Newtonsoft.Json" Version="[12.0.1,]" />
<PackageReference Include="Newtonsoft.Json" Version="[13.0.1,]" />
<PackageReference Include="CommunityToolkit.Mvvm" Version="[8.2.2,9)" />
</ItemGroup>
<ItemGroup Condition="$(TargetFramework.StartsWith('netstandard'))">
<PackageReference Include="Xamarin.Forms" Version="[5.0.0.1874,6)" />
<ItemGroup Condition="$(TargetFramework.StartsWith('net7'))">
<PackageReference Include="Microsoft.Maui.Controls" Version="[8.0.20,9)" />
</ItemGroup>
<ItemGroup Condition="$(TargetFramework.StartsWith('net8'))">
<PackageReference Include="Microsoft.Maui.Controls" Version="[8.0.100,9)" />
</ItemGroup>
<ItemGroup Condition="$(TargetFramework.StartsWith('net9'))">
<PackageReference Include="Microsoft.Maui.Controls" Version="[9.0.0,10)" />
</ItemGroup>
<ItemGroup Condition="$(TargetFramework.StartsWith('netstandard'))">
<PackageReference Include="Xamarin.Forms" Version="[5.0.0.1874,6)" />
</ItemGroup>
<ItemGroup>
<Folder Include="Properties\" />
Expand Down
2 changes: 1 addition & 1 deletion Float.Core/L10n/TranslateExtension.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
using Xamarin.Forms;
using Xamarin.Forms.Xaml;
#else
using Microsoft.Maui;
using Microsoft.Maui.Controls;
using Microsoft.Maui.Controls.Xaml;
#endif
Expand All @@ -18,6 +17,7 @@ namespace Float.Core.L10n
/// The markup extension allowing XAML to contain localization.
/// </summary>
[ContentProperty("Text")]
[AcceptEmptyServiceProvider]
public class TranslateExtension : IMarkupExtension
{
static readonly List<ResourceManager> RegisteredResourceManagers = new ()
Expand Down
4 changes: 4 additions & 0 deletions Float.Core/Notifications/AlertNotificationHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,11 @@ protected void DisplayAlert(string title, string message)
{
DeviceProxy.BeginInvokeOnMainThread(() =>
{
#if NET8_0_OR_GREATER
var page = context ?? Application.Current.Windows[0].Page;
#else
var page = context ?? Application.Current.MainPage;
#endif
page.DisplayAlert(title, message, Localize.String("OK"));
});
}
Expand Down
14 changes: 0 additions & 14 deletions version.json

This file was deleted.