Skip to content

Commit cc648de

Browse files
committed
refactor
1 parent 3924f1a commit cc648de

16 files changed

+193
-223
lines changed

Plugins/CSharpCompilerSettings/Core.cs

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ namespace Coffee.CSharpCompilerSettings
1515
[InitializeOnLoad]
1616
internal static class Core
1717
{
18-
public static bool IsGlobal { get; private set; }
18+
private static bool IsGlobal { get; }
1919

2020
public static void DirtyScriptsIfNeeded()
2121
{
@@ -266,13 +266,12 @@ public static void OnAssemblyCompilationStarted(string name)
266266
}
267267
}
268268

269-
public static void Initialize()
269+
static Core()
270270
{
271-
IsGlobal = new[]
272-
{
273-
"CSharpCompilerSettings",
274-
"CSharpCompilerSettings_",
275-
}.Contains(typeof(Core).Assembly.GetName().Name);
271+
var coreAssemblyName = typeof(Core).Assembly.GetName().Name;
272+
if (coreAssemblyName == "CSharpCompilerSettings_") return;
273+
274+
IsGlobal = coreAssemblyName == "CSharpCompilerSettings";
276275

277276
// Setup logger.
278277
if (IsGlobal)
@@ -332,10 +331,5 @@ public static void Initialize()
332331
if (2021 <= major || (major == 2020 && 2 <= minor))
333332
DirtyScriptsIfNeeded();
334333
}
335-
336-
static Core()
337-
{
338-
Initialize();
339-
}
340334
}
341335
}

Plugins/CSharpCompilerSettings/CscSettingsAsset.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,10 +77,10 @@ public override string ToString()
7777
[Serializable]
7878
public struct AssemblyFilter
7979
{
80-
[Tooltip("Include predefined assemblies (e.g. Assembly-CSharp.dll)")] [SerializeField]
80+
[Tooltip("Include predefined assemblies (Assembly-CSharp-firstpass.dll, Assembly-CSharp-Editor-firstpass.dll, Assembly-CSharp.dll and Assembly-CSharp-Editor.dll)")] [SerializeField]
8181
private bool m_PredefinedAssemblies;
8282

83-
[Tooltip("Include assemblies filter. Prefix '!' to exclude (e.g. 'Assets/;!Packages/')")] [SerializeField]
83+
[Tooltip("Assemblies filter. Prefix '!' to exclude. (e.g. 'Assets/', '!Packages/')")] [SerializeField]
8484
private string[] m_IncludedAssemblies;
8585

8686
public AssemblyFilter(bool predefinedAssemblies, string[] includedAssemblies)

Plugins/CSharpCompilerSettings/Dev/CSharpCompilerSettings.Editor.asmdef.dev~

Lines changed: 0 additions & 16 deletions
This file was deleted.

Plugins/CSharpCompilerSettings/Dev/CSharpCompilerSettings.Editor.asmdef~

Lines changed: 0 additions & 16 deletions
This file was deleted.

Plugins/CSharpCompilerSettings/Dev/Menus.cs

Lines changed: 0 additions & 64 deletions
This file was deleted.

Plugins/CSharpCompilerSettings/Dev/Menus.cs.meta

Lines changed: 0 additions & 11 deletions
This file was deleted.

Plugins/CSharpCompilerSettings/Dev/Recompiler.cs

Lines changed: 0 additions & 100 deletions
This file was deleted.
File renamed without changes.
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
/target:library
2+
/nowarn:0169
3+
/langversion:latest
4+
/out:"${DLL_PATH}"
5+
/nostdlib
6+
/deterministic
7+
/optimize+
8+
9+
/r:"${APP_CONTENTS}/Managed/UnityEditor.dll"
10+
/r:"${APP_CONTENTS}/MonoBleedingEdge/lib/mono/2.0-api/mscorlib.dll"
11+
/r:"${APP_CONTENTS}/MonoBleedingEdge/lib/mono/2.0-api/System.dll"
12+
/r:"${APP_CONTENTS}/MonoBleedingEdge/lib/mono/2.0-api/System.Core.dll"
13+
14+
"${PLUGIN_SOURCE}/ExternalCSharpCompiler.cs"

Plugins/Recompiler/ExternalCSharpCompiler.rsp.meta

Lines changed: 7 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"name": "CSharpCompilerSettings.Dev",
2+
"name": "CSharpCompilerSettings.Recompiler",
33
"references": [],
44
"optionalUnityReferences": [],
55
"includePlatforms": [
@@ -10,5 +10,7 @@
1010
"overrideReferences": false,
1111
"precompiledReferences": [],
1212
"autoReferenced": false,
13-
"defineConstraints": []
13+
"defineConstraints": [
14+
"CSC_SETTINGS_DEVELOP"
15+
]
1416
}

0 commit comments

Comments
 (0)