Skip to content

Commit f20f1eb

Browse files
Added support for the new solution format (slnx) to L10n.BuildTasks
ALso improved error message when unable to find root.
1 parent 92433a2 commit f20f1eb

3 files changed

Lines changed: 9 additions & 3 deletions

File tree

MN.L10n.BuildTasks/MN.L10n.BuildTasks.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<OutputType>Exe</OutputType>
77
<StartupObject>MN.L10n.BuildTasks.Program</StartupObject>
88
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
9-
<Version>4.0.5</Version>
9+
<Version>4.0.6</Version>
1010
<Authors>Chris Gårdenberg</Authors>
1111
<Company>MultiNet Interactive AB</Company>
1212
</PropertyGroup>

MN.L10n.BuildTasks/Program.cs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,14 @@ public async static Task<int> Main(string[] args)
4444

4545
stw.Start();
4646

47-
while (!baseDir.EnumerateFiles().Any(x => x.Extension == ".sln" || x.Extension == L10nRoot))
47+
var startDir = baseDir;
48+
while (!baseDir.EnumerateFiles().Any(x => x.Extension is ".sln" or ".slnx" || x.Extension == L10nRoot))
4849
{
50+
if(baseDir.Parent == null)
51+
{
52+
Console.WriteLine($"Unable to find solution root, stopping L10n build task. Checked {startDir} and all parent directories up to {baseDir}");
53+
return -1;
54+
}
4955
baseDir = baseDir.Parent;
5056
}
5157

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ First of all, you need to install the NuGet-package `MN.L10n.BuildTask` in at le
123123

124124
Currently, it will only run while the solution is being compiled in `Release`-config, so that we don't slow down local build times too much.
125125

126-
When the solution is run in `Release`-mode, L10n will look for either a `.l10nconfig` or the `.sln`-file, as the root for where it should look for phrases.
126+
When the solution is run in `Release`-mode, L10n will look for either a `.l10nconfig` or the `.sln/.slnx`-file, as the root for where it should look for phrases.
127127

128128
---
129129

0 commit comments

Comments
 (0)