From 8df475461ca9fab5e5a02a2256511c51fe3759fc Mon Sep 17 00:00:00 2001 From: Manuel de la Pena Date: Fri, 24 Jan 2025 17:13:55 -0500 Subject: [PATCH] [RGen] Make the transformer generator be netstandard2.1 to make editors happy. (#22039) In theory we can use net9.0 but some editors need netstandard2.1. We don't want yet to move Rgen, but we do want to move the transformer one beause it makes workign with the project easier. --- src/rgen/Microsoft.Macios.Generator/TabbedStringBuilder.cs | 6 +++++- .../Microsoft.Macios.Transformer.Generator.csproj | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/rgen/Microsoft.Macios.Generator/TabbedStringBuilder.cs b/src/rgen/Microsoft.Macios.Generator/TabbedStringBuilder.cs index e52db59f42a..2acc76651c9 100644 --- a/src/rgen/Microsoft.Macios.Generator/TabbedStringBuilder.cs +++ b/src/rgen/Microsoft.Macios.Generator/TabbedStringBuilder.cs @@ -122,6 +122,8 @@ public TabbedStringBuilder AppendLine (ReadOnlySpan span) return this; } +#if NET9_0 + public TabbedStringBuilder Append (ref DefaultInterpolatedStringHandler handler) { WriteTabs ().Append (handler.ToStringAndClear ()); @@ -133,7 +135,7 @@ public TabbedStringBuilder AppendLine (ref DefaultInterpolatedStringHandler hand WriteTabs ().Append (handler.ToStringAndClear ()).AppendLine (); return this; } - + /// /// Append a new raw literal by prepending the correct indentation. @@ -156,6 +158,8 @@ public TabbedStringBuilder AppendRaw (string rawString) return this; } + +#endif /// /// Append the generated code attribute to the current string builder. Added for convenience. diff --git a/src/rgen/Microsoft.Macios.Transformer.Generator/Microsoft.Macios.Transformer.Generator/Microsoft.Macios.Transformer.Generator.csproj b/src/rgen/Microsoft.Macios.Transformer.Generator/Microsoft.Macios.Transformer.Generator/Microsoft.Macios.Transformer.Generator.csproj index 6d19ba95766..ad39f750c0e 100644 --- a/src/rgen/Microsoft.Macios.Transformer.Generator/Microsoft.Macios.Transformer.Generator/Microsoft.Macios.Transformer.Generator.csproj +++ b/src/rgen/Microsoft.Macios.Transformer.Generator/Microsoft.Macios.Transformer.Generator/Microsoft.Macios.Transformer.Generator.csproj @@ -1,7 +1,7 @@ - net$(BundledNETCoreAppTargetFrameworkVersion) + netstandard2.1 false enable latest