Skip to content

Commit d7e099d

Browse files
1.1.0
# [1.1.0](v1.0.1...v1.1.0) (2020-10-06) ### Bug Fixes * add apply/revert button in project settings provider ([3f86ab6](3f86ab6)) * ignore development asmdef for inspector ([e49c85e](e49c85e)) * modify csproj with each C# compiler settings ([602af0f](602af0f)) * namespace typo ([e57107b](e57107b)) * support csproj symbols ([0786ecd](0786ecd)) * typo ([9366513](9366513)) ### Features * add app to change assembly name ([ba38c8c](ba38c8c)) * add compiling options (deterministic and optimize) for CSharpCompilerSettings.dll ([701bb3b](701bb3b)) * add inspector header for asmdef to configure C# compiler settings ([e3a7117](e3a7117)) * add setting option to enable debug log for compiling ([1911a82](1911a82)) * add support for Microsoft.Net.Compilers.Toolset and similar packages ([3de5ec9](3de5ec9)) * configure the C# compiler for each *.asmdef file ([735e810](735e810)) * modify the scripting define symbols on compiling ([74b1669](74b1669)) * publish assembly as dll ([79b47b4](79b47b4)) * recompile on reload csc settings assemlby ([b4f79b0](b4f79b0)) * **dev:** add menu to recompile ([2fff7f9](2fff7f9)) * **Dev:** Automatically change asmdef and dll references for editor assembly ([9b2452a](9b2452a))
1 parent b494c20 commit d7e099d

22 files changed

+740
-32
lines changed

.exe/ChangeAssemblyName.exe

5.5 KB
Binary file not shown.

.exe/Mono.Cecil.dll

337 KB
Binary file not shown.

.exe/Unity.Cecil.dll

339 KB
Binary file not shown.

CHANGELOG.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,30 @@
1+
# [1.1.0](https://github.com/mob-sakai/CSharpCompilerSettingsForUnity/compare/v1.0.1...v1.1.0) (2020-10-06)
2+
3+
4+
### Bug Fixes
5+
6+
* add apply/revert button in project settings provider ([3f86ab6](https://github.com/mob-sakai/CSharpCompilerSettingsForUnity/commit/3f86ab6eb4fe3a342def7413929e13175bc0b016))
7+
* ignore development asmdef for inspector ([e49c85e](https://github.com/mob-sakai/CSharpCompilerSettingsForUnity/commit/e49c85e36a08a5627ff340e8ee767014ec908704))
8+
* modify csproj with each C# compiler settings ([602af0f](https://github.com/mob-sakai/CSharpCompilerSettingsForUnity/commit/602af0fe8b157b26decc261d3eee1c07b06e28ce))
9+
* namespace typo ([e57107b](https://github.com/mob-sakai/CSharpCompilerSettingsForUnity/commit/e57107b5b2b37453d121f0fb49fde593b773a3ef))
10+
* support csproj symbols ([0786ecd](https://github.com/mob-sakai/CSharpCompilerSettingsForUnity/commit/0786ecdd009f96131dda00efaeaabfced41087f8))
11+
* typo ([9366513](https://github.com/mob-sakai/CSharpCompilerSettingsForUnity/commit/9366513dd68c340ca870d66284d778cf62d829f0))
12+
13+
14+
### Features
15+
16+
* add app to change assembly name ([ba38c8c](https://github.com/mob-sakai/CSharpCompilerSettingsForUnity/commit/ba38c8ceb625d6b972ef5b5552c9ad716b12249e))
17+
* add compiling options (deterministic and optimize) for CSharpCompilerSettings.dll ([701bb3b](https://github.com/mob-sakai/CSharpCompilerSettingsForUnity/commit/701bb3b73b19eb115588e76fb70bc48f9124ff41))
18+
* add inspector header for asmdef to configure C# compiler settings ([e3a7117](https://github.com/mob-sakai/CSharpCompilerSettingsForUnity/commit/e3a711711df1e964a9f18a336b4a001a6afcb015))
19+
* add setting option to enable debug log for compiling ([1911a82](https://github.com/mob-sakai/CSharpCompilerSettingsForUnity/commit/1911a82a8a7559987d902d4017436f86b944f528))
20+
* add support for Microsoft.Net.Compilers.Toolset and similar packages ([3de5ec9](https://github.com/mob-sakai/CSharpCompilerSettingsForUnity/commit/3de5ec94b002764d42af1b57d135fdaf7a484156))
21+
* configure the C# compiler for each *.asmdef file ([735e810](https://github.com/mob-sakai/CSharpCompilerSettingsForUnity/commit/735e810bc99d7659f0c1f9ccab2a004f20795f55))
22+
* modify the scripting define symbols on compiling ([74b1669](https://github.com/mob-sakai/CSharpCompilerSettingsForUnity/commit/74b1669c4f6d425665e0ad72bea8bdfd65c9e139))
23+
* publish assembly as dll ([79b47b4](https://github.com/mob-sakai/CSharpCompilerSettingsForUnity/commit/79b47b4abcc8d7c6a33df7fad82d09391ada77cb))
24+
* recompile on reload csc settings assemlby ([b4f79b0](https://github.com/mob-sakai/CSharpCompilerSettingsForUnity/commit/b4f79b02e5b09638deefa4c9ef516751a782ad08))
25+
* **dev:** add menu to recompile ([2fff7f9](https://github.com/mob-sakai/CSharpCompilerSettingsForUnity/commit/2fff7f9b6deb97395d3899af7ae0f704cf742d1b))
26+
* **Dev:** Automatically change asmdef and dll references for editor assembly ([9b2452a](https://github.com/mob-sakai/CSharpCompilerSettingsForUnity/commit/9b2452a7626e62a024f6a3ecb4a52995d4dc0e3b))
27+
128
## [1.0.1](https://github.com/mob-sakai/CSharpCompilerSettingsForUnity/compare/v1.0.0...v1.0.1) (2020-09-17)
229

330

Editor.meta

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Editor/AssemblyRenamer.cs

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
using System.Diagnostics;
2+
using System.IO;
3+
using UnityEditor;
4+
using UnityEngine;
5+
6+
namespace Coffee.CSharpCompilerSettings
7+
{
8+
internal class AssemblyRenamer
9+
{
10+
public static void Rename(string dll, string assemblyName)
11+
{
12+
const string exe = "Packages/CSharpCompilerSettings/.exe/ChangeAssemblyName.exe";
13+
const string cecilDll = "Packages/CSharpCompilerSettings/.exe/Unity.Cecil.dll";
14+
var contentsPath = EditorApplication.applicationContentsPath;
15+
var sep = Path.DirectorySeparatorChar;
16+
17+
// Create compilation process.
18+
var psi = new ProcessStartInfo
19+
{
20+
Arguments = string.Format("\"{0}\" {1}", dll, assemblyName),
21+
CreateNoWindow = true,
22+
UseShellExecute = false,
23+
RedirectStandardOutput = true,
24+
RedirectStandardError = true,
25+
};
26+
27+
if (!File.Exists(cecilDll))
28+
{
29+
File.Copy((contentsPath + "/Managed/Unity.Cecil.dll").Replace('/', sep), cecilDll.Replace('/', sep));
30+
}
31+
32+
if (Application.platform == RuntimePlatform.WindowsEditor)
33+
{
34+
psi.FileName = Path.GetFullPath(exe);
35+
}
36+
else
37+
{
38+
psi.FileName = Path.Combine(EditorApplication.applicationContentsPath, "MonoBleedingEdge/bin/mono");
39+
psi.Arguments = exe + " " + psi.Arguments;
40+
}
41+
42+
// Start compilation process.
43+
Core.LogDebug("Rename: Change assembly name\n command={0} {1}\n", psi.FileName, psi.Arguments);
44+
var p = Process.Start(psi);
45+
p.Exited += (_, __) =>
46+
{
47+
if (p.ExitCode == 0)
48+
Core.LogDebug("Rename: success.\n" + p.StandardOutput.ReadToEnd());
49+
else
50+
Core.LogException("Rename: failure.\n" + p.StandardError.ReadToEnd());
51+
};
52+
p.EnableRaisingEvents = true;
53+
54+
p.WaitForExit();
55+
}
56+
}
57+
}

Editor/AssemblyRenamer.cs.meta

Lines changed: 11 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Editor/AutoImporter.cs

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
using UnityEditor;
2+
3+
namespace Coffee.CSharpCompilerSettings
4+
{
5+
internal class AutoImporter: ScriptableSingleton<AutoImporter>
6+
{
7+
public string assetPath;
8+
9+
[InitializeOnLoadMethod]
10+
private static void InitializeOnLoad()
11+
{
12+
if(string.IsNullOrEmpty(instance.assetPath)) return;
13+
14+
AssetDatabase.ImportAsset(instance.assetPath);
15+
instance.assetPath = null;
16+
}
17+
18+
public static void ImportOnFinishedCompilation(string assetPath)
19+
{
20+
instance.assetPath = assetPath;
21+
}
22+
}
23+
}

Editor/AutoImporter.cs.meta

Lines changed: 11 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
"name": "CSharpCompilerSettings.Editor",
3+
"references": [],
4+
"optionalUnityReferences": [],
5+
"includePlatforms": [
6+
"Editor"
7+
],
8+
"excludePlatforms": [],
9+
"allowUnsafeCode": false,
10+
"overrideReferences": true,
11+
"precompiledReferences": [
12+
"CSharpCompilerSettings.dll"
13+
],
14+
"autoReferenced": false,
15+
"defineConstraints": []
16+
}

0 commit comments

Comments
 (0)