Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .vscode/spellright.dict
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
unrecoverably
parameterless
Roslynator
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# 0.5.0
- Normalize line endings to Windows CLRF
- Add Roslynator suppression to line endings

# 0.4.1
- Add license URL to package

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ namespace AutSoft.UnityResourceGenerator.Sample
// ReSharper disable PartialTypeWithSinglePart
// ReSharper disable InconsistentNaming
// ReSharper disable IncorrectBlankLinesNearBraces
#pragma warning disable IDE0079 // Remove unnecessary suppression
#pragma warning disable RCS1036 // Remove redundant empty line.
public static partial class ResourcePaths
{
public static partial class Scenes
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,14 @@
using System;
using System.Linq;
using System.Text;
using System.Text.RegularExpressions;

namespace AutSoft.UnityResourceGenerator.Editor.Generation
{
public static class ResourceFileGenerator
{
private static readonly Regex NormalizedLineEndings = new Regex(@"\r\n|\n\r|\n|\r", RegexOptions.Compiled, TimeSpan.FromSeconds(10));

public static string CreateResourceFile(ResourceContext context)
{
// ReSharper disable once MissingIndent
Expand All @@ -17,6 +20,8 @@ namespace {0}
// ReSharper disable PartialTypeWithSinglePart
// ReSharper disable InconsistentNaming
// ReSharper disable IncorrectBlankLinesNearBraces
#pragma warning disable IDE0079 // Remove unnecessary suppression
#pragma warning disable RCS1036 // Remove redundant empty line.
public static partial class {1}
{";

Expand All @@ -31,6 +36,8 @@ public static partial class {1}
// ReSharper disable PartialTypeWithSinglePart
// ReSharper disable InconsistentNaming
// ReSharper disable IncorrectBlankLinesNearBraces
#pragma warning disable IDE0079 // Remove unnecessary suppression
#pragma warning disable RCS1036 // Remove redundant empty line.
public static partial class {1}
{";

Expand Down Expand Up @@ -63,6 +70,8 @@ public static partial class {1}
.OrderByDescending(p => p.PostProcessPriority)
.Aggregate(fileContent, (current, processor) => processor.PostProcess(context, current));

fileContent = NormalizedLineEndings.Replace(fileContent, "\r\n");

return fileContent;
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "com.autsoft.unityresourcegenerator",
"version": "0.4.1",
"version": "0.5.0",
"displayName": "Unity Resource Generator",
"description": "Generate path strings for Resources.Load",
"license": "MIT",
Expand Down