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
15 changes: 15 additions & 0 deletions .github/workflows/fw-lite.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,21 @@ jobs:
dotnet publish -r linux-x64 --artifacts-path ../artifacts -p:PublishSingleFile=true -p:Version=${{ needs.build-and-test.outputs.semver-version }}
dotnet publish -r linux-arm64 --artifacts-path ../artifacts -p:PublishSingleFile=true -p:Version=${{ needs.build-and-test.outputs.semver-version }}

- name: Test Linux executable
working-directory: backend/FwLite/artifacts/publish/FwLiteWeb/release_linux-x64
run: |
set +e
chmod +x ./FwLiteWeb
output=$(timeout 10s ./FwLiteWeb 2>&1)
exit_code=$?
if [ $exit_code -eq 124 ] || [ $exit_code -eq 0 ]; then
echo "✅ Linux executable ran without crashing for 10s"
else
echo "❌ Linux executable exited with code $exit_code"
echo "$output"
exit 1
fi

- name: Upload FWLite Linux artifacts
uses: actions/upload-artifact@v4
with:
Expand Down
1 change: 1 addition & 0 deletions backend/FwLite/FwLiteWeb/FwLiteWeb.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
<SelfContained>true</SelfContained>
<FileVersion>$(ApplicationDisplayVersion)</FileVersion>
<LangVersion>preview</LangVersion>
<CompressionEnabled>false</CompressionEnabled>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)' == 'Release' ">
<!-- single file disabled as it's less efficient for updates-->
Expand Down
9 changes: 7 additions & 2 deletions backend/FwLite/FwLiteWeb/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,13 @@
using Microsoft.Extensions.Options;

//paratext won't let us change the working directory, and if it's not set correctly then loading js files doesn't work
Directory.SetCurrentDirectory(Path.GetDirectoryName(typeof(Program).Assembly.Location)!);
var app = FwLiteWebServer.SetupAppServer(new() {Args = args});
var assemblyLocation = typeof(Program).Assembly.Location;

Check warning on line 6 in backend/FwLite/FwLiteWeb/Program.cs

View workflow job for this annotation

GitHub Actions / Publish FW Lite app for Linux

'System.Reflection.Assembly.Location.get' always returns an empty string for assemblies embedded in a single-file app. If the path to the app directory is needed, consider calling 'System.AppContext.BaseDirectory'.

Check warning on line 6 in backend/FwLite/FwLiteWeb/Program.cs

View workflow job for this annotation

GitHub Actions / Publish FW Lite app for Linux

'System.Reflection.Assembly.Location.get' always returns an empty string for assemblies embedded in a single-file app. If the path to the app directory is needed, consider calling 'System.AppContext.BaseDirectory'.
var assemblyDirectory = !string.IsNullOrEmpty(assemblyLocation)
? Path.GetDirectoryName(assemblyLocation) : null;
var appDirectory = assemblyDirectory ?? AppContext.BaseDirectory;
Directory.SetCurrentDirectory(appDirectory);

var app = FwLiteWebServer.SetupAppServer(new() { Args = args });
await using (app)
{
await app.StartAsync();
Expand Down
6 changes: 6 additions & 0 deletions backend/FwLite/LcmCrdt/LcmCrdt.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,12 @@
<PackageReference Include="Refit" />
<PackageReference Include="Refit.HttpClientFactory" />
</ItemGroup>
<ItemGroup Condition="$([MSBuild]::IsOsPlatform('linux'))">
<PackageReference Include="SQLitePCLRaw.bundle_e_sqlite3" />
<PackageReference Include="SQLitePCLRaw.core" />
<PackageReference Include="SQLitePCLRaw.lib.e_sqlite3" />
<PackageReference Include="SQLitePCLRaw.provider.e_sqlite3" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\harmony\src\SIL.Harmony\SIL.Harmony.csproj" />
<ProjectReference Include="..\MiniLcm\MiniLcm.csproj" />
Expand Down
2 changes: 1 addition & 1 deletion backend/FwLite/MiniLcm/Models/RichString.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
namespace MiniLcm.Models;

[JsonConverter(typeof(RichStringConverter))]
public class RichString(ICollection<RichSpan> spans) : IEquatable<RichString>

Check warning on line 9 in backend/FwLite/MiniLcm/Models/RichString.cs

View workflow job for this annotation

GitHub Actions / Build FwHeadless / publish-fw-headless

'RichString' overrides Object.Equals(object o) but does not override Object.GetHashCode()

Check warning on line 9 in backend/FwLite/MiniLcm/Models/RichString.cs

View workflow job for this annotation

GitHub Actions / Build FwHeadless / publish-fw-headless

'RichString' overrides Object.Equals(object o) but does not override Object.GetHashCode()

Check warning on line 9 in backend/FwLite/MiniLcm/Models/RichString.cs

View workflow job for this annotation

GitHub Actions / Build API / publish-api

'RichString' overrides Object.Equals(object o) but does not override Object.GetHashCode()

Check warning on line 9 in backend/FwLite/MiniLcm/Models/RichString.cs

View workflow job for this annotation

GitHub Actions / Build API / publish-api

'RichString' overrides Object.Equals(object o) but does not override Object.GetHashCode()

Check warning on line 9 in backend/FwLite/MiniLcm/Models/RichString.cs

View workflow job for this annotation

GitHub Actions / Build FW Lite and run tests

'RichString' overrides Object.Equals(object o) but does not override Object.GetHashCode()

Check warning on line 9 in backend/FwLite/MiniLcm/Models/RichString.cs

View workflow job for this annotation

GitHub Actions / Build FW Lite and run tests

'RichString' overrides Object.Equals(object o) but does not override Object.GetHashCode()

Check warning on line 9 in backend/FwLite/MiniLcm/Models/RichString.cs

View workflow job for this annotation

GitHub Actions / Publish FW Lite app for Linux

'RichString' overrides Object.Equals(object o) but does not override Object.GetHashCode()

Check warning on line 9 in backend/FwLite/MiniLcm/Models/RichString.cs

View workflow job for this annotation

GitHub Actions / Publish FW Lite app for Mac

'RichString' overrides Object.Equals(object o) but does not override Object.GetHashCode()

Check warning on line 9 in backend/FwLite/MiniLcm/Models/RichString.cs

View workflow job for this annotation

GitHub Actions / Publish FW Lite app for Mac

'RichString' overrides Object.Equals(object o) but does not override Object.GetHashCode()

Check warning on line 9 in backend/FwLite/MiniLcm/Models/RichString.cs

View workflow job for this annotation

GitHub Actions / Publish FW Lite app for Mac

'RichString' overrides Object.Equals(object o) but does not override Object.GetHashCode()

Check warning on line 9 in backend/FwLite/MiniLcm/Models/RichString.cs

View workflow job for this annotation

GitHub Actions / GHA integration tests / dotnet

'RichString' overrides Object.Equals(object o) but does not override Object.GetHashCode()

Check warning on line 9 in backend/FwLite/MiniLcm/Models/RichString.cs

View workflow job for this annotation

GitHub Actions / GHA integration tests / dotnet

'RichString' overrides Object.Equals(object o) but does not override Object.GetHashCode()

Check warning on line 9 in backend/FwLite/MiniLcm/Models/RichString.cs

View workflow job for this annotation

GitHub Actions / Publish FW Lite app for Windows

'RichString' overrides Object.Equals(object o) but does not override Object.GetHashCode()

Check warning on line 9 in backend/FwLite/MiniLcm/Models/RichString.cs

View workflow job for this annotation

GitHub Actions / Publish FW Lite app for Android

'RichString' overrides Object.Equals(object o) but does not override Object.GetHashCode()
{
public RichString(string text, WritingSystemId ws = default) : this([new RichSpan { Text = text, Ws = ws}])
{
Expand Down Expand Up @@ -290,7 +290,7 @@
return this with { ObjData = ObjData is null ? null : ObjData with { }, Tags = Tags?.ToArray() };
}

public virtual bool Equals(RichSpan? other)

Check warning on line 293 in backend/FwLite/MiniLcm/Models/RichString.cs

View workflow job for this annotation

GitHub Actions / Build FwHeadless / publish-fw-headless

'RichSpan' defines 'Equals' but not 'GetHashCode'

Check warning on line 293 in backend/FwLite/MiniLcm/Models/RichString.cs

View workflow job for this annotation

GitHub Actions / Build FwHeadless / publish-fw-headless

'RichSpan' defines 'Equals' but not 'GetHashCode'

Check warning on line 293 in backend/FwLite/MiniLcm/Models/RichString.cs

View workflow job for this annotation

GitHub Actions / Build API / publish-api

'RichSpan' defines 'Equals' but not 'GetHashCode'

Check warning on line 293 in backend/FwLite/MiniLcm/Models/RichString.cs

View workflow job for this annotation

GitHub Actions / Build API / publish-api

'RichSpan' defines 'Equals' but not 'GetHashCode'

Check warning on line 293 in backend/FwLite/MiniLcm/Models/RichString.cs

View workflow job for this annotation

GitHub Actions / Build FW Lite and run tests

'RichSpan' defines 'Equals' but not 'GetHashCode'

Check warning on line 293 in backend/FwLite/MiniLcm/Models/RichString.cs

View workflow job for this annotation

GitHub Actions / Build FW Lite and run tests

'RichSpan' defines 'Equals' but not 'GetHashCode'

Check warning on line 293 in backend/FwLite/MiniLcm/Models/RichString.cs

View workflow job for this annotation

GitHub Actions / Publish FW Lite app for Linux

'RichSpan' defines 'Equals' but not 'GetHashCode'

Check warning on line 293 in backend/FwLite/MiniLcm/Models/RichString.cs

View workflow job for this annotation

GitHub Actions / Publish FW Lite app for Mac

'RichSpan' defines 'Equals' but not 'GetHashCode'

Check warning on line 293 in backend/FwLite/MiniLcm/Models/RichString.cs

View workflow job for this annotation

GitHub Actions / Publish FW Lite app for Mac

'RichSpan' defines 'Equals' but not 'GetHashCode'

Check warning on line 293 in backend/FwLite/MiniLcm/Models/RichString.cs

View workflow job for this annotation

GitHub Actions / Publish FW Lite app for Mac

'RichSpan' defines 'Equals' but not 'GetHashCode'

Check warning on line 293 in backend/FwLite/MiniLcm/Models/RichString.cs

View workflow job for this annotation

GitHub Actions / GHA integration tests / dotnet

'RichSpan' defines 'Equals' but not 'GetHashCode'

Check warning on line 293 in backend/FwLite/MiniLcm/Models/RichString.cs

View workflow job for this annotation

GitHub Actions / GHA integration tests / dotnet

'RichSpan' defines 'Equals' but not 'GetHashCode'

Check warning on line 293 in backend/FwLite/MiniLcm/Models/RichString.cs

View workflow job for this annotation

GitHub Actions / Publish FW Lite app for Windows

'RichSpan' defines 'Equals' but not 'GetHashCode'

Check warning on line 293 in backend/FwLite/MiniLcm/Models/RichString.cs

View workflow job for this annotation

GitHub Actions / Publish FW Lite app for Android

'RichSpan' defines 'Equals' but not 'GetHashCode'
{
if (other is null) return false;
if (ReferenceEquals(this, other)) return true;
Expand Down Expand Up @@ -327,7 +327,7 @@
BulNumTxtAft == other.BulNumTxtAft && BulNumFontInfo == other.BulNumFontInfo &&
CustomBullet == other.CustomBullet && TabList == other.TabList && TableRule == other.TableRule &&
FieldName == other.FieldName && Equals(ObjData, other.ObjData) &&
(Equals(Tags, other.Tags) || Tags.SequenceEqual(other.Tags));
(Equals(Tags, other.Tags) || (Tags is not null && other.Tags is not null && Tags.SequenceEqual(other.Tags)));
}
}

Expand Down
1 change: 1 addition & 0 deletions frontend/viewer/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ export default defineConfig(({ mode, command }) => {
base: command == "build" ? '/_content/FwLiteShared/viewer' : '/',
build: {
outDir: '../../backend/FwLite/FwLiteShared/wwwroot/viewer',
emptyOutDir: true,
manifest: true,
minify: false,
sourcemap: true,
Expand Down
Loading