Skip to content

Commit

Permalink
Adding Framework 4.8.1 and .NET8 to targets.
Browse files Browse the repository at this point in the history
This required platform-specific references in the project files. I also fixed a warning about Assembly.CodeBase and some .NET8 warnings about manually copying duplicate files into our nuget package folder when packing. These files appear to be duplicates of what is copied during the .NET8 packaging.
  • Loading branch information
josephmyers committed Apr 12, 2024
1 parent 48700dc commit db84e34
Show file tree
Hide file tree
Showing 7 changed files with 21 additions and 12 deletions.
3 changes: 2 additions & 1 deletion Directory.Build.props
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project>
<PropertyGroup>
<TargetFrameworks>net461</TargetFrameworks>
<TargetFrameworks>net461;net481;net8.0-windows</TargetFrameworks>
<Company>SIL</Company>
<Authors>SIL International</Authors>
<Product>L10NSharp</Product>
Expand All @@ -24,6 +24,7 @@ See full changelog at https://github.com/sillsdev/l10nsharp/blob/master/CHANGELO
</AppendToReleaseNotesProperty>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<GenerateResourceUsePreserializedResources>true</GenerateResourceUsePreserializedResources>
<UseWindowsForms>true</UseWindowsForms>
</PropertyGroup>
<ItemGroup>
<!-- Without this line some projects fail to build on TC with "error : SourceRoot items
Expand Down
4 changes: 2 additions & 2 deletions src/CheckOrFixXliff/CheckOrFixXliff.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@
<PackageLicenseExpression>MIT</PackageLicenseExpression>
<PackageProjectUrl>https://github.com/sillsdev/l10nsharp/tree/master/src/CheckOrFixXliff</PackageProjectUrl>
<TargetsForTfmSpecificBuildOutput>$(TargetsForTfmSpecificBuildOutput);CopyProjectReferencesToPackage</TargetsForTfmSpecificBuildOutput>
<NoWarn>$(NoWarn);NU5128</NoWarn>
<NoWarn>$(NoWarn);NU5128;NU5118</NoWarn>
</PropertyGroup>
<ItemGroup>
<ItemGroup Condition=" '$(TargetFramework)' == 'net461' Or '$(TargetFramework)' == 'net481' ">
<Reference Include="System.ServiceModel" />
<Reference Include="System.Windows.Forms" />
</ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion src/CheckOrFixXliff/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ private static bool CheckForWellFormedXml(string filename)
private static bool ValidateXliffAgainstSchema(string filename)
{
bool valid = true;
var installedXliffDir = Path.GetDirectoryName(new Uri(Assembly.GetExecutingAssembly().CodeBase).LocalPath);
var installedXliffDir = Path.GetDirectoryName(new Uri(Assembly.GetExecutingAssembly().Location).LocalPath);
var schemaLocation = Path.Combine(installedXliffDir, "xliff-core-1.2-transitional.xsd");
var schemas = new XmlSchemaSet();
using (var reader = XmlReader.Create(schemaLocation))
Expand Down
4 changes: 2 additions & 2 deletions src/ExtractXliff/ExtractXliff.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@
<PackageId>L10NSharp.ExtractXliff</PackageId>
<PackageProjectUrl>https://github.com/sillsdev/l10nsharp/tree/master/src/ExtractXliff</PackageProjectUrl>
<TargetsForTfmSpecificBuildOutput>$(TargetsForTfmSpecificBuildOutput);CopyProjectReferencesToPackage</TargetsForTfmSpecificBuildOutput>
<NoWarn>$(NoWarn);NU5128</NoWarn>
<NoWarn>$(NoWarn);NU5128;NU5118</NoWarn>
</PropertyGroup>
<ItemGroup>
<ItemGroup Condition=" '$(TargetFramework)' == 'net461' Or '$(TargetFramework)' == 'net481' ">
<Reference Include="System.ServiceModel" />
<Reference Include="System.Windows.Forms" />
</ItemGroup>
Expand Down
14 changes: 11 additions & 3 deletions src/L10NSharp/L10NSharp.csproj
Original file line number Diff line number Diff line change
@@ -1,19 +1,27 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<RootNamespace>L10NSharp</RootNamespace>
<Description>L10NSharp is a .NET localization library for Windows Forms applications. It collects strings which need localization when your application first runs and saves them in a XLIFF file. It can also dynamically collect strings at runtime.</Description>
<AssemblyTitle>L10NSharp</AssemblyTitle>
<PackageId>L10NSharp</PackageId>
<PackageProjectUrl>https://github.com/sillsdev/l10nsharp</PackageProjectUrl>
</PropertyGroup>
<ItemGroup>
<ItemGroup Condition=" '$(TargetFramework)' == 'net461' Or '$(TargetFramework)' == 'net481' ">
<Reference Include="System.ServiceModel" />
<Reference Include="System.Windows.Forms" />
</ItemGroup>
<ItemGroup>
<ItemGroup Condition=" '$(TargetFramework)' == 'net461' Or '$(TargetFramework)' == 'net481' ">
<PackageReference Include="GitVersion.MsBuild" Version="5.11.1" PrivateAssets="all" />
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.1.1" PrivateAssets="all" />
<PackageReference Include="SIL.ReleaseTasks" Version="2.5.0" PrivateAssets="all" />
<PackageReference Include="System.Resources.Extensions" Version="6.0.0" />
</ItemGroup>
<ItemGroup Condition=" '$(TargetFramework)' == 'net8.0-windows' ">
<PackageReference Include="GitVersion.MsBuild" Version="5.11.1" PrivateAssets="all" />
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.1.1" PrivateAssets="all" />
<PackageReference Include="SIL.ReleaseTasks" Version="2.5.0" PrivateAssets="all" />
<PackageReference Include="System.Resources.Extensions" Version="6.0.0" />
<PackageReference Include="System.ServiceModel.Http" Version="6.2.0" />
<PackageReference Include="System.ServiceModel.Primitives" Version="6.2.0" />
</ItemGroup>
</Project>
4 changes: 2 additions & 2 deletions src/L10NSharpTests/L10NSharpTests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@
<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.4.0" />
<PackageReference Include="NUnit" Version="3.13.3" />
<PackageReference Include="NUnit3TestAdapter" Version="4.3.1" />
<PackageReference Include="NUnit3TestAdapter" Version="4.5.0" />
</ItemGroup>
<ItemGroup>
<ItemGroup Condition=" '$(TargetFramework)' == 'net461' Or '$(TargetFramework)' == 'net481' ">
<Reference Include="System.Windows.Forms" />
</ItemGroup>
</Project>
2 changes: 1 addition & 1 deletion src/SampleApp/SampleApp.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<AssemblyTitle>SampleApp</AssemblyTitle>
<IsPackable>false</IsPackable>
</PropertyGroup>
<ItemGroup>
<ItemGroup Condition=" '$(TargetFramework)' == 'net461' Or '$(TargetFramework)' == 'net481' ">
<Reference Include="System.Windows.Forms" />
</ItemGroup>
<ItemGroup>
Expand Down

0 comments on commit db84e34

Please sign in to comment.