Compare commits

...
Author SHA1 Message Date
dependabot[bot] 3f7ee31998 Bump actions/checkout from 4 to 6
Bumps [actions/checkout](https://github.com/actions/checkout) from 4 to 6.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v4...v6)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-version: '6'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <[email protected]>
2026-02-03 15:07:01 +00:00
ds5678 d3c9111759 Bump version to 1.2.3
Updated the project version in AssetRipper.Text.SourceGeneration.csproj from 1.2.2 to 1.2.3. This prepares the project for a new release.
2026-02-01 14:01:08 -08:00
ds5678 3a13009315 Include README.md in NuGet package and metadata
Added PackageReadmeFile property and included README.md from the parent directory in the NuGet package. This ensures the README is displayed on nuget.org and included in the package contents.
2026-02-01 14:00:33 -08:00
ds5678 ed86e7bbea Update NuGet dependencies to latest versions
Updated test and source project dependencies:
- Microsoft.NET.Test.Sdk to 18.0.1
- NUnit to 4.4.0
- NUnit3TestAdapter to 6.1.0
- NUnit.Analyzers to 4.11.2
- Microsoft.SourceLink.GitHub to 10.0.102
2026-02-01 13:57:28 -08:00
ds5678 6c1c646c1c Update projects to target .NET 10.0
Replaced .NET 9.0 with .NET 10.0 in both the main and test
project files. The main project now multi-targets netstandard2.0
and net10.0, while the test project targets net10.0.
2026-02-01 13:56:21 -08:00
ds5678 65219667e7 Add support for get and set property accessors 2026-02-01 13:53:53 -08:00
ds5678 54c1d996cf Replace .sln with .slnx XML solution format
Removed the traditional Visual Studio .sln file and added a new .slnx solution file in XML format. The new file includes all solution items and project references in a structured layout.
2026-02-01 13:49:56 -08:00
ds5678 ba284d065e Support square brackets 2025-06-10 22:34:47 -07:00
ds5678 cd268a1ec6 Bump version of AssetRipper.Text.SourceGeneration
Updated the version number of the AssetRipper.Text.SourceGeneration project from 1.2.1 to 1.2.2.
2025-02-08 23:29:28 -08:00
ds5678 f1e3bb04a1 More xml documentation 2025-02-08 23:28:47 -08:00
ds5678 1493ad3736 Bump version of AssetRipper.Text.SourceGeneration
Updated the version number of the AssetRipper.Text.SourceGeneration project from 1.2.0 to 1.2.1 to reflect minor changes or improvements.
2025-02-08 22:53:30 -08:00
ds5678 d431e08d70 Update NuGet package versions in test project
Updated the following NuGet package versions in `AssetRipper.Text.SourceGeneration.Tests.csproj`:
- `NUnit` from `4.3.1` to `4.3.2`
- `NUnit3TestAdapter` from `4.6.0` to `5.0.0`
- `NUnit.Analyzers` from `4.5.0` to `4.6.0`
- `coverlet.collector` from `6.0.2` to `6.0.4`
2025-02-08 22:53:16 -08:00
ds5678 fbed176eaf Add WriteInheritDocumentation method to IndentedTextWriterExtensions
Introduce WriteInheritDocumentation method to IndentedTextWriterExtensions class. This method writes an XML documentation comment with the <inheritdoc/> tag, enabling inheritance of documentation from base classes or interfaces, thus reducing redundant documentation.
2025-02-08 22:52:40 -08:00
dependabot[bot] 3eb78aa0f0 Bump NUnit.Analyzers from 4.4.0 to 4.5.0
Bumps [NUnit.Analyzers](https://github.com/nunit/nunit.analyzers) from 4.4.0 to 4.5.0.
- [Release notes](https://github.com/nunit/nunit.analyzers/releases)
- [Changelog](https://github.com/nunit/nunit.analyzers/blob/master/CHANGES.md)
- [Commits](https://github.com/nunit/nunit.analyzers/compare/4.4.0...4.5.0)

---
updated-dependencies:
- dependency-name: NUnit.Analyzers
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>
2024-12-23 08:47:00 -08:00
dependabot[bot] 2f536575c5 Bump NUnit from 4.3.0 to 4.3.1
Bumps [NUnit](https://github.com/nunit/nunit) from 4.3.0 to 4.3.1.
- [Release notes](https://github.com/nunit/nunit/releases)
- [Changelog](https://github.com/nunit/nunit/blob/main/CHANGES.md)
- [Commits](https://github.com/nunit/nunit/compare/4.3.0...4.3.1)

---
updated-dependencies:
- dependency-name: NUnit
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>
2024-12-23 08:46:45 -08:00
ds5678 ea3375afab Bump version 2024-12-17 07:39:17 -08:00
ds5678 a1a99501d9 Remove reflection in DocumentationTests since it is no longer needed 2024-12-17 07:37:37 -08:00
ds5678 1b8a01dcbb Bump NuGet references 2024-12-17 07:36:57 -08:00
ds5678 8d6876dca9 Store new line separators in a static field 2024-12-17 07:31:27 -08:00
ds5678 034dac2dac Target .NET 9 and .NET Standard 2.0 2024-12-17 07:31:03 -08:00
Jeremy Pritts a0afb95b2b Create dotnet.yml 2024-12-17 07:00:01 -08:00
ds5678 b3c876fe78 Add dependabot 2024-12-17 06:58:57 -08:00
14 changed files with 206 additions and 56 deletions

No files matched your search

+18
View File
@@ -0,0 +1,18 @@
# To get started with Dependabot version updates, you'll need to specify which
# package ecosystems to update and where the package manifests are located.
# Please see the documentation for all configuration options:
# https://help.github.com/github/administering-a-repository/configuration-options-for-dependency-updates
version: 2
updates:
- package-ecosystem: "nuget" # See documentation for possible values
directory: "/" # Location of package manifests
schedule:
interval: "daily"
- package-ecosystem: "github-actions"
# Workflow files stored in the
# default location of `.github/workflows`
directory: "/"
schedule:
interval: "daily"
+28
View File
@@ -0,0 +1,28 @@
# This workflow will build a .NET project
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-net
name: .NET
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: 9.0.x
- name: Restore dependencies
run: dotnet restore
- name: Build
run: dotnet build --no-restore
- name: Test
run: dotnet test --no-build --verbosity normal
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<TargetFramework>net10.0</TargetFramework>
<LangVersion>Latest</LangVersion>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
@@ -11,11 +11,14 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.7.2" />
<PackageReference Include="NUnit" Version="3.13.3" />
<PackageReference Include="NUnit3TestAdapter" Version="4.5.0" />
<PackageReference Include="NUnit.Analyzers" Version="3.6.1" />
<PackageReference Include="coverlet.collector" Version="6.0.0">
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="18.0.1" />
<PackageReference Include="NUnit" Version="4.4.0" />
<PackageReference Include="NUnit3TestAdapter" Version="6.1.0" />
<PackageReference Include="NUnit.Analyzers" Version="4.11.2">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="coverlet.collector" Version="6.0.4">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
@@ -1,5 +1,4 @@
using System.CodeDom.Compiler;
using System.Reflection;
namespace AssetRipper.Text.SourceGeneration.Tests;
@@ -65,8 +64,10 @@ public class DocumentationTests
{
NewLine = "\n",
};
typeof(IndentedTextWriter).GetField("_tabsPending", BindingFlags.NonPublic | BindingFlags.Instance)!.SetValue(indentedWriter, true);
#if !NET8_0_OR_GREATER
typeof(IndentedTextWriter).GetField("_tabsPending", System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Instance)!.SetValue(indentedWriter, true);
//https://github.com/dotnet/runtime/issues/92039
#endif
writeAction(indentedWriter);
Assert.That(writer.ToString(), Is.EqualTo(expectedOutput));
}
-39
View File
@@ -1,39 +0,0 @@
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.7.33920.267
MinimumVisualStudioVersion = 10.0.40219.1
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AssetRipper.Text.SourceGeneration", "AssetRipper.Text.SourceGeneration\AssetRipper.Text.SourceGeneration.csproj", "{CB287F84-D891-4627-AA89-A908A9E78D63}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{A23AA605-8E97-4B83-AC29-1B3393DAED17}"
ProjectSection(SolutionItems) = preProject
.editorconfig = .editorconfig
.gitignore = .gitignore
LICENSE.txt = LICENSE.txt
README.md = README.md
EndProjectSection
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AssetRipper.Text.SourceGeneration.Tests", "AssetRipper.Text.SourceGeneration.Tests\AssetRipper.Text.SourceGeneration.Tests.csproj", "{5AD7EFFE-4402-4FA2-866F-2A13506D539C}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{CB287F84-D891-4627-AA89-A908A9E78D63}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{CB287F84-D891-4627-AA89-A908A9E78D63}.Debug|Any CPU.Build.0 = Debug|Any CPU
{CB287F84-D891-4627-AA89-A908A9E78D63}.Release|Any CPU.ActiveCfg = Release|Any CPU
{CB287F84-D891-4627-AA89-A908A9E78D63}.Release|Any CPU.Build.0 = Release|Any CPU
{5AD7EFFE-4402-4FA2-866F-2A13506D539C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{5AD7EFFE-4402-4FA2-866F-2A13506D539C}.Debug|Any CPU.Build.0 = Debug|Any CPU
{5AD7EFFE-4402-4FA2-866F-2A13506D539C}.Release|Any CPU.ActiveCfg = Release|Any CPU
{5AD7EFFE-4402-4FA2-866F-2A13506D539C}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {A3BEF7B6-5197-46BE-ADCB-8F296F9857BC}
EndGlobalSection
EndGlobal
+10
View File
@@ -0,0 +1,10 @@
<Solution>
<Folder Name="/Solution Items/">
<File Path=".editorconfig" />
<File Path=".gitignore" />
<File Path="LICENSE.txt" />
<File Path="README.md" />
</Folder>
<Project Path="AssetRipper.Text.SourceGeneration.Tests/AssetRipper.Text.SourceGeneration.Tests.csproj" />
<Project Path="AssetRipper.Text.SourceGeneration/AssetRipper.Text.SourceGeneration.csproj" />
</Solution>
@@ -1,16 +1,15 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<TargetFrameworks>netstandard2.0;net10.0</TargetFrameworks>
<LangVersion>Latest</LangVersion>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<IsTrimmable>true</IsTrimmable>
<CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>
<Authors>ds5678</Authors>
<Company>AssetRipper</Company>
<Version>1.1.0</Version>
<Version>1.2.3</Version>
<AssemblyVersion>$(Version)</AssemblyVersion>
<PackageId>AssetRipper.Text.SourceGeneration</PackageId>
<PackageTags>C# Text</PackageTags>
@@ -18,23 +17,36 @@
<PackageLicenseExpression>MIT</PackageLicenseExpression>
<RepositoryType>git</RepositoryType>
<PackageProjectUrl>https://github.com/AssetRipper/AssetRipper.Text.SourceGeneration</PackageProjectUrl>
<Copyright>Copyright (c) 2023 ds5678</Copyright>
<Copyright>Copyright (c) ds5678</Copyright>
<Description>Extension library for generating C# source code.</Description>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<PackageReadmeFile>README.md</PackageReadmeFile>
<Deterministic>true</Deterministic>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<NoWarn>1591</NoWarn>
</PropertyGroup>
<PropertyGroup Condition="$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', 'net6.0'))">
<IsTrimmable>true</IsTrimmable>
</PropertyGroup>
<PropertyGroup Condition="$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', 'net8.0'))">
<IsAotCompatible>true</IsAotCompatible>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.1.1">
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="10.0.102">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="PolySharp" Version="1.13.2">
<PackageReference Include="PolySharp" Version="1.15.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
</ItemGroup>
<ItemGroup>
<None Include="../README.md" Pack="true" PackagePath="\" />
</ItemGroup>
</Project>
+18
View File
@@ -0,0 +1,18 @@
namespace AssetRipper.Text.SourceGeneration;
public readonly ref struct Get
{
private readonly NamedBlock block;
public IndentedTextWriter Writer => block.Writer;
public Get(IndentedTextWriter writer)
{
block = new NamedBlock(writer, "get");
}
public void Dispose()
{
block.Dispose();
}
}
@@ -22,12 +22,14 @@ public static class IndentedTextWriterExtensions
{
writer.WriteLine($"/// <returns>{description}</returns>");
}
public static void WriteInheritDocumentation(this IndentedTextWriter writer) => writer.WriteLine("/// <inheritdoc/>");
public static void WriteInheritDocumentation(this IndentedTextWriter writer, string cref) => writer.WriteLine($"/// <inheritdoc cref=\"{cref}\"/>");
private static void WriteXmlDocumentation(this IndentedTextWriter writer, string tag, string content)
{
writer.WriteLine($"/// <{tag}>");
if (content.Contains('\n') || content.Contains('\r'))
{
string[] lines = content.Split(new[] { "\r\n", "\r", "\n" }, StringSplitOptions.None);
string[] lines = content.Split(NewLineSeparators, StringSplitOptions.None);
for (int i = 0; ; i++)
{
if (i == lines.Length - 1)
@@ -47,4 +49,6 @@ public static class IndentedTextWriterExtensions
}
writer.WriteLine($"/// </{tag}>");
}
private static readonly string[] NewLineSeparators = ["\r\n", "\r", "\n"];
}
@@ -16,12 +16,35 @@ public static class IndentedTextWriterFactory
string path = Path.Combine(directoryPath, $"{fileName}.g.cs");
Directory.CreateDirectory(directoryPath);
FileStream stream = File.Create(path);
StreamWriter streamWriter = new StreamWriter(stream, leaveOpen: false)
return Create(stream);
}
/// <summary>
/// Make a new <see cref="IndentedTextWriter"/>.
/// </summary>
/// <remarks>
/// This writer uses <see cref="StreamWriter.AutoFlush"/>, LF line endings, and tab indentation.
/// </remarks>
/// <param name="stream">The stream to write to.</param>
/// <returns>An <see cref="IndentedTextWriter"/> for the specified <paramref name="stream"/>.</returns>
public static IndentedTextWriter Create(Stream stream)
{
StreamWriter streamWriter = new StreamWriter(stream)
{
NewLine = "\n",
AutoFlush = true,
};
return new IndentedTextWriter(streamWriter, "\t")
return Create(streamWriter);
}
/// <summary>
/// Make a new <see cref="IndentedTextWriter"/>.
/// </summary>
/// <param name="writer">The <see cref="TextWriter"/> to use for output.</param>
/// <returns>An <see cref="IndentedTextWriter"/> that outputs to the specified <paramref name="writer"/>.</returns>
public static IndentedTextWriter Create(TextWriter writer)
{
return new IndentedTextWriter(writer, "\t")
{
NewLine = "\n",
};
+18
View File
@@ -0,0 +1,18 @@
namespace AssetRipper.Text.SourceGeneration;
public readonly ref struct Set
{
private readonly NamedBlock block;
public IndentedTextWriter Writer => block.Writer;
public Set(IndentedTextWriter writer)
{
block = new NamedBlock(writer, "set");
}
public void Dispose()
{
block.Dispose();
}
}
@@ -0,0 +1,20 @@
namespace AssetRipper.Text.SourceGeneration;
public readonly ref struct SquareBrackets
{
private readonly Indented indented;
public IndentedTextWriter Writer => indented.Writer;
public SquareBrackets(IndentedTextWriter writer)
{
writer.WriteLine('[');
indented = new Indented(writer);
}
public void Dispose()
{
indented.Dispose();
Writer.WriteLine(']');
}
}
@@ -0,0 +1,20 @@
namespace AssetRipper.Text.SourceGeneration;
public readonly ref struct SquareBracketsWithSemicolon
{
private readonly Indented indented;
public IndentedTextWriter Writer => indented.Writer;
public SquareBracketsWithSemicolon(IndentedTextWriter writer)
{
writer.WriteLine('[');
indented = new Indented(writer);
}
public void Dispose()
{
indented.Dispose();
Writer.WriteLine("];");
}
}
@@ -0,0 +1,14 @@
namespace AssetRipper.Text.SourceGeneration;
public static class XmlFormatter
{
public static string SeeCref(string cref) => $"<see cref=\"{cref}\"/>";
public static string SeeHref(string href) => $"<see href=\"{href}\"/>";
public static string SeeHref(string href, string text) => $"<see href=\"{href}\">{text}</see>";
public static string SeeLangword(string langword) => $"<see langword=\"{langword}\"/>";
public static string SeeAlsoCref(string cref) => $"<seealso cref=\"{cref}\"/>";
public static string SeeAlsoHref(string href) => $"<seealso href=\"{href}\"/>";
public static string SeeAlsoHref(string href, string text) => $"<seealso href=\"{href}\">{text}</seealso>";
public static string SeeAlsoLangword(string langword) => $"<seealso langword=\"{langword}\"/>";
}