Skip to content
Open
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
34 changes: 5 additions & 29 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,9 @@ CI runs on Windows and Ubuntu. See .github/workflows/ci-cd.yml:

Always mirror this sequence when validating a change locally.

### Local build scripts (not validated here)
- Windows: build.cmd [Debug|Release] [Target] (uses MSBuild on LCM.sln).
- Linux: build.sh [Debug|Release] [Target] (sources environ, uses msbuild on LCM.sln).
These scripts call build/LCM.proj targets (Build/Test/Pack). If you use them, always run from repo root.
Use `dotnet build -m:1` for a cold-start build (a tree with no generated sources yet).
Parallel builds race on the generated sources and fail with `LcmGenerate` or `IdlImp`
errors. Plain `dotnet build` is fine once those sources exist.

### Tests per README (not validated here)
- Windows, ReSharper: open LCM.sln and “Run Unit Tests”.
Expand All @@ -40,8 +39,6 @@ These scripts call build/LCM.proj targets (Build/Test/Pack). If you use them, al
- dotnet build --configuration Release → FAILED
Failure signature (both commands): GitVersion.MsBuild (netcoreapp3.1 gitversion.dll) exited with code 1. This blocks build/test in this environment. CI uses fetch-depth 0, so ensure a full git history is available. If GitVersion still fails, check GitVersion prerequisites and local .NET runtime compatibility.

No command timeouts were observed.

### Known prerequisites and gotchas
- GitVersion.MsBuild is used across projects; it requires git metadata. CI checks out with fetch-depth 0.
- net462 builds on Windows require the .NET Framework 4.6.1 targeting pack (CI installs it).
Expand All @@ -53,8 +50,6 @@ No command timeouts were observed.

### Key solution and build files
- LCM.sln: solution entry point.
- build.cmd / build.sh: wrapper scripts for MSBuild.
- build/LCM.proj: orchestrated build/test/pack, uses NUnit console on output/ for legacy builds.
- Directory.Build.props / Directory.Build.targets: repo-wide build settings and packaging.
- Directory.Solution.props / Directory.Solution.targets: solution-level defaults.
- GitVersion.yml: GitVersion configuration.
Expand Down Expand Up @@ -90,38 +85,19 @@ Code generation targets to know about:
- Mono on Linux for some runtime/test workflows.
- GitVersion.MsBuild for versioning (requires git metadata).

## Root files list
- .editorconfig
- .gitattributes
- .gitignore
- build.cmd
- build.sh
- CHANGELOG.md
- Directory.Build.props
- Directory.Build.targets
- Directory.Solution.props
- Directory.Solution.targets
- environ
- GitVersion.yml
- global.json
- LCM.sln
- LCM.sln.DotSettings
- LICENSE
- README.md

## Repo top-level directories
- .github/ (GitHub Actions workflow)
- .vscode/ (VS settings)
- artifacts/ (build outputs)
- build/ (LCM.proj)
- src/ (production code)
- tests/ (unit tests)

## README highlights (summary)
- Describes liblcm as FieldWorks model library for linguistic analyses.
- Build: use build.cmd (Windows) or build.sh (Linux). Default Debug, optional Release.
- Build: use `dotnet build`. Default Debug, optional Release.
- Debugging: use LOCAL_NUGET_REPO to publish local packages; see NuGet local feeds.
- Tests: Windows via ReSharper or NUnit console; Linux via mono + NUnit console (requires environ).

## Trust these instructions
Follow this file first. Only search the repo if these instructions are incomplete or prove incorrect for your task.
If these instructions fail notify the author of the task that they should verify and update the instructions if necessary.
19 changes: 13 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,10 @@ with language and culture data, including anthropological, text corpus, and ling
1. Install Required Software

- git
- Visual Studio 2019 (with C++), MonoDevelop, or JetBrains Rider
- On Windows, Visual Studio 2022 with the "Desktop development with C++" workload.
The C++ build tools are required for any Windows build, not only for building
inside the IDE: code generation preprocesses the IDL with `cl.exe`.
- JetBrains Rider or MonoDevelop, if you prefer another IDE

2. Clone the liblcm repository

Expand All @@ -26,18 +29,22 @@ with language and culture data, including anthropological, text corpus, and ling

On Windows:

- Run the appropriate `vsvars*.bat`. Alternatively, `LCM.sln` can be built from within Visual Studio.
- Run `build.cmd` to build the liblcm library.
- Run `dotnet build -m:1` to build the liblcm library. Alternatively, `LCM.sln` can be
built from within Visual Studio.

On Linux:

- Run `build.sh` to build the liblcm library.
- Source `environ`, then run `dotnet build -m:1` to build the liblcm library.

Use `-m:1` for a cold-start build (a fresh clone or worktree, with no generated sources
yet). Parallel builds race on the generated sources. Plain `dotnet build` is fine once
those sources exist.

By default, this will build liblcm in the Debug configuration.
To build with a different configuration, use:

```bash
build.(cmd|sh) (Debug|Release)
dotnet build -m:1 --configuration (Debug|Release)
```

## Debugging
Expand All @@ -51,7 +58,7 @@ To publish and consume LCModel through local sources:
local network) to publish locally-built packages
- See [these instructions](https://docs.microsoft.com/en-us/nuget/hosting-packages/local-feeds)
to enable local package sources
- `build /t:pack` will pack nuget packages and publish them to `LOCAL_NUGET_REPO`
- `dotnet pack` will pack nuget packages and publish them to `LOCAL_NUGET_REPO`

## Tests

Expand Down
20 changes: 0 additions & 20 deletions build.cmd

This file was deleted.

22 changes: 0 additions & 22 deletions build.sh

This file was deleted.

109 changes: 0 additions & 109 deletions build/LCM.proj

This file was deleted.

2 changes: 1 addition & 1 deletion global.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"sdk": {
"version": "8.0.100",
"rollForward": "latestFeature"
"rollForward": "latestMajor"
}
}
12 changes: 2 additions & 10 deletions tests/SIL.LCModel.Core.Tests/Attributes/InitializeIcuAttribute.cs
Original file line number Diff line number Diff line change
Expand Up @@ -37,15 +37,7 @@ public override void BeforeTest(ITest testDetails)
if (IcuVersion > 0)
Wrapper.ConfineIcuVersions(IcuVersion);

try
{
Wrapper.Init();
}
catch (Exception e)
{
Console.WriteLine($"InitializeIcuAttribute: ERROR: failed when calling Wrapper.Init() with {e.GetType()}: {e.Message}");
}

// ICU_DATA has to be resolved before InitIcuDataDir hands the data directory to ICU.
EnsureIcuDataEnvironmentVariableIsSet();

try
Expand All @@ -54,7 +46,7 @@ public override void BeforeTest(ITest testDetails)
}
catch (Exception e)
{
Console.WriteLine($"InitializeIcuAttribute: ERROR: failed with {e.GetType()}: {e.Message}");
Console.WriteLine($"InitializeIcuAttribute: ERROR: failed when calling InitIcuDataDir() with {e.GetType()}: {e.Message}");
}
}

Expand Down
Loading