Skip to content

Commit f429ed9

Browse files
authored
Merge pull request #8 from AutSoft/develop
0.5.0
2 parents 9c0b186 + 2995592 commit f429ed9

File tree

5 files changed

+17
-1
lines changed

5 files changed

+17
-1
lines changed

.vscode/spellright.dict

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
unrecoverably
22
parameterless
3+
Roslynator

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
# 0.5.0
2+
- Normalize line endings to Windows CLRF
3+
- Add Roslynator suppression to line endings
4+
15
# 0.4.1
26
- Add license URL to package
37

UnityResourceGenerator/Assets/AutSoft.UnityResourceGenerator.Sample/ResourcePaths.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ namespace AutSoft.UnityResourceGenerator.Sample
66
// ReSharper disable PartialTypeWithSinglePart
77
// ReSharper disable InconsistentNaming
88
// ReSharper disable IncorrectBlankLinesNearBraces
9+
#pragma warning disable IDE0079 // Remove unnecessary suppression
10+
#pragma warning disable RCS1036 // Remove redundant empty line.
911
public static partial class ResourcePaths
1012
{
1113
public static partial class Scenes

UnityResourceGenerator/Assets/AutSoft.UnityResourceGenerator/Editor/Generation/ResourceFileGenerator.cs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,14 @@
22
using System;
33
using System.Linq;
44
using System.Text;
5+
using System.Text.RegularExpressions;
56

67
namespace AutSoft.UnityResourceGenerator.Editor.Generation
78
{
89
public static class ResourceFileGenerator
910
{
11+
private static readonly Regex NormalizedLineEndings = new Regex(@"\r\n|\n\r|\n|\r", RegexOptions.Compiled, TimeSpan.FromSeconds(10));
12+
1013
public static string CreateResourceFile(ResourceContext context)
1114
{
1215
// ReSharper disable once MissingIndent
@@ -17,6 +20,8 @@ namespace {0}
1720
// ReSharper disable PartialTypeWithSinglePart
1821
// ReSharper disable InconsistentNaming
1922
// ReSharper disable IncorrectBlankLinesNearBraces
23+
#pragma warning disable IDE0079 // Remove unnecessary suppression
24+
#pragma warning disable RCS1036 // Remove redundant empty line.
2025
public static partial class {1}
2126
{";
2227

@@ -31,6 +36,8 @@ public static partial class {1}
3136
// ReSharper disable PartialTypeWithSinglePart
3237
// ReSharper disable InconsistentNaming
3338
// ReSharper disable IncorrectBlankLinesNearBraces
39+
#pragma warning disable IDE0079 // Remove unnecessary suppression
40+
#pragma warning disable RCS1036 // Remove redundant empty line.
3441
public static partial class {1}
3542
{";
3643

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

73+
fileContent = NormalizedLineEndings.Replace(fileContent, "\r\n");
74+
6675
return fileContent;
6776
}
6877
}

UnityResourceGenerator/Assets/AutSoft.UnityResourceGenerator/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "com.autsoft.unityresourcegenerator",
3-
"version": "0.4.1",
3+
"version": "0.5.0",
44
"displayName": "Unity Resource Generator",
55
"description": "Generate path strings for Resources.Load",
66
"license": "MIT",

0 commit comments

Comments
 (0)