From bc3d8b212e02bc8cc814d0be0d2e062b83e43780 Mon Sep 17 00:00:00 2001 From: Jason Naylor Date: Fri, 22 May 2026 14:16:59 -0700 Subject: [PATCH 1/2] Fix LT-22527: Repair the ILRepack build functionality * The SDK targets are always imported after everything in the project file. So the SDK's empty `AfterBuild` silently overwrote the one from ILRepack.targets with no warning * Change from the `AfterBuild` override pattern to `AfterTargets=Build` Co-Authored-By: Claude Opus 4.6 --- .gitattributes | 1 - Bin/ilrepack-assemblies | 31 ------------------- Directory.Packages.props | 1 + .../FwParatextLexiconPlugin.csproj | 2 ++ Src/FwParatextLexiconPlugin/ILRepack.targets | 17 +++++----- 5 files changed, 11 insertions(+), 41 deletions(-) delete mode 100755 Bin/ilrepack-assemblies diff --git a/.gitattributes b/.gitattributes index 8cf8104b2a..55bdc47fa2 100644 --- a/.gitattributes +++ b/.gitattributes @@ -27,7 +27,6 @@ FwHelpAbout.cs -whitespace LICENSE -whitespace RealSplashScreen.cs -whitespace run-app -whitespace -Bin/ilrepack-assemblies -whitespace *.json -whitespace *.js -whitespace Src/LexText/ParserCore/ParserCoreTests/**/*.txt -whitespace diff --git a/Bin/ilrepack-assemblies b/Bin/ilrepack-assemblies deleted file mode 100755 index bc0d30ea84..0000000000 --- a/Bin/ilrepack-assemblies +++ /dev/null @@ -1,31 +0,0 @@ -#!/bin/bash - -# Repack an assembly. -# Created 2018-08-13 -# -# Usage: ./ilrepack-assemblies /path/to/PrimaryAssembly.dll [/path/to/OtherAssemblies.dll ...] -# -# Original PrimaryAssembly.dll is left as PrimaryAssembly.dll~. -# -# Environment variables: -# ILREPACK - path to ILRepack.exe to use. - -set -e -o pipefail -u - -PRIMARY_ASSEMBLY="$1" -ILREPACK="${ILREPACK-"$(dirname "$0")/../packages/ILRepack.2.0.15/tools/ILRepack.exe"}" -TMP_ASSEMBLY=$(mktemp -d)/"$(basename "$PRIMARY_ASSEMBLY")" -# Set ASSEMBLIES to the remaining arguments. -shift -ASSEMBLIES="${@}" - -LIBSARGS=/lib:"$(dirname "$PRIMARY_ASSEMBLY")" -mono "$ILREPACK" /out:"$TMP_ASSEMBLY" "$LIBSARGS" "$PRIMARY_ASSEMBLY" $ASSEMBLIES -mv "$PRIMARY_ASSEMBLY" "$PRIMARY_ASSEMBLY~" -mv "$TMP_ASSEMBLY" "$PRIMARY_ASSEMBLY" - -for assembly in $ASSEMBLIES; do - if [[ -f $assembly.config ]]; then - echo >&2 "ilrepack-assemblies($$): WARNING: Not including settings from $assembly.config for $PRIMARY_ASSEMBLY." - fi -done diff --git a/Directory.Packages.props b/Directory.Packages.props index fd6974bad6..4c64f845ad 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -103,6 +103,7 @@ ============================================================= --> + diff --git a/Src/FwParatextLexiconPlugin/FwParatextLexiconPlugin.csproj b/Src/FwParatextLexiconPlugin/FwParatextLexiconPlugin.csproj index 4627293a85..07e0ca9cad 100644 --- a/Src/FwParatextLexiconPlugin/FwParatextLexiconPlugin.csproj +++ b/Src/FwParatextLexiconPlugin/FwParatextLexiconPlugin.csproj @@ -28,6 +28,7 @@ + @@ -53,4 +54,5 @@ + \ No newline at end of file diff --git a/Src/FwParatextLexiconPlugin/ILRepack.targets b/Src/FwParatextLexiconPlugin/ILRepack.targets index bdc0217354..c6bb8d8443 100644 --- a/Src/FwParatextLexiconPlugin/ILRepack.targets +++ b/Src/FwParatextLexiconPlugin/ILRepack.targets @@ -6,9 +6,7 @@ This software is licensed under the LGPL, version 2.1 or later --> - ../.. - "$(FwrtPath)\packages\ILRepack.2.0.16\tools\ILRepack.exe" - mono "$(FwrtPath)\packages\ILRepack.2.0.16\tools\ILRepack.exe" + "$(PkgILRepack)\tools\ILRepack.exe" $(OutputPath)/FwParatextLexiconPlugin.dll @@ -27,16 +25,17 @@ This software is licensed under the LGPL, version 2.1 or later - - - - + + + - - + + From 253ed95b226c1fc2b34746ac31ba51a28b649ba1 Mon Sep 17 00:00:00 2001 From: Jason Naylor Date: Tue, 26 May 2026 14:42:35 -0700 Subject: [PATCH 2/2] Compile FwParatextLexiconPlugin against pre-ILRepack assembly SDK projects package references conflict with the internalized reapacked assemblies. Copy un-merged assembly before ILRepack overwrites it, then have the test project compile and run against that copy: - ILRepack.targets: copy to .PreMerge.dll and use it as ILRepack input - Test csproj: ProjectReference with ReferenceOutputAssembly=false plus explicit Reference to the PreMerge DLL via HintPath - Test App.config: codeBase redirect so the runtime loads the PreMerge copy instead of the packed DLL from the shared output directory - Directory.Packages.props: pin System.Text.Encoding.CodePages to 10.0.3 (the PreMerge HintPath reference loses NuGet graph unification, so the transitive version from SIL.Machine must be pinned explicitly) - Heat-exclude files: exclude PreMerge.dll from WiX 3 and WiX 6 harvests Co-Authored-By: Claude Opus 4.6 --- Directory.Packages.props | 3 ++ .../PatchableInstallerHeatExclude.xml | 2 ++ .../wix6/Shared/Base/heat-exclude.xml | 2 ++ .../FwParatextLexiconPluginTests/App.config | 34 +++++++++++++++++++ .../FwParatextLexiconPluginTests.csproj | 11 ++++-- Src/FwParatextLexiconPlugin/ILRepack.targets | 14 +++++--- .../Properties/AssemblyInfo.cs | 2 +- 7 files changed, 60 insertions(+), 8 deletions(-) create mode 100644 Src/FwParatextLexiconPlugin/FwParatextLexiconPluginTests/App.config diff --git a/Directory.Packages.props b/Directory.Packages.props index 4c64f845ad..3c9315077e 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -45,6 +45,9 @@ + + + + diff --git a/FLExInstaller/wix6/Shared/Base/heat-exclude.xml b/FLExInstaller/wix6/Shared/Base/heat-exclude.xml index 7629b0dd49..a70b1d155d 100644 --- a/FLExInstaller/wix6/Shared/Base/heat-exclude.xml +++ b/FLExInstaller/wix6/Shared/Base/heat-exclude.xml @@ -6,4 +6,6 @@ --> + + diff --git a/Src/FwParatextLexiconPlugin/FwParatextLexiconPluginTests/App.config b/Src/FwParatextLexiconPlugin/FwParatextLexiconPluginTests/App.config new file mode 100644 index 0000000000..34e4d2f626 --- /dev/null +++ b/Src/FwParatextLexiconPlugin/FwParatextLexiconPluginTests/App.config @@ -0,0 +1,34 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Src/FwParatextLexiconPlugin/FwParatextLexiconPluginTests/FwParatextLexiconPluginTests.csproj b/Src/FwParatextLexiconPlugin/FwParatextLexiconPluginTests/FwParatextLexiconPluginTests.csproj index 3b03e2b20a..277ad554d1 100644 --- a/Src/FwParatextLexiconPlugin/FwParatextLexiconPluginTests/FwParatextLexiconPluginTests.csproj +++ b/Src/FwParatextLexiconPlugin/FwParatextLexiconPluginTests/FwParatextLexiconPluginTests.csproj @@ -29,13 +29,20 @@ + + + $(OutputPath)FwParatextLexiconPlugin.PreMerge.dll + - + + - + PreserveNewest diff --git a/Src/FwParatextLexiconPlugin/ILRepack.targets b/Src/FwParatextLexiconPlugin/ILRepack.targets index c6bb8d8443..18bd584edc 100644 --- a/Src/FwParatextLexiconPlugin/ILRepack.targets +++ b/Src/FwParatextLexiconPlugin/ILRepack.targets @@ -8,6 +8,10 @@ This software is licensed under the LGPL, version 2.1 or later "$(PkgILRepack)\tools\ILRepack.exe" $(OutputPath)/FwParatextLexiconPlugin.dll + + $(OutputPath)/FwParatextLexiconPlugin.PreMerge.dll @@ -26,14 +30,14 @@ This software is licensed under the LGPL, version 2.1 or later - - + + - + diff --git a/Src/FwParatextLexiconPlugin/Properties/AssemblyInfo.cs b/Src/FwParatextLexiconPlugin/Properties/AssemblyInfo.cs index 79acdfa859..0013a147eb 100644 --- a/Src/FwParatextLexiconPlugin/Properties/AssemblyInfo.cs +++ b/Src/FwParatextLexiconPlugin/Properties/AssemblyInfo.cs @@ -20,4 +20,4 @@ // The following GUID is for the ID of the typelib if this project is exposed to COM [assembly: Guid("a787fc88-0ff6-4982-9305-8da92ef8fc7f")] -[assembly: InternalsVisibleTo("FwParatextLexiconPluginTests")] \ No newline at end of file +[assembly: InternalsVisibleTo("FwParatextLexiconPluginTests")]