Skip to content

Commit ae5bc9a

Browse files
committed
Improve mpu --reference option.
This commit adds short option for --reference because it is effectively required option. In addition, ./MsgPack.dll is included in default now because this assembly is always required.
1 parent 8238ed9 commit ae5bc9a

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

src/mpu/Program.cs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020

2121
using System;
2222
using System.Collections.Generic;
23+
using System.IO;
2324
using System.Linq;
2425
using System.Reflection;
2526
using System.Runtime.InteropServices;
@@ -131,7 +132,7 @@ private static int Execute( IEnumerable<string> args )
131132
value => configuration.CodeIndentString = value
132133
},
133134
{
134-
"references=", "[serializer, optional] Specify reference assemblies' file pathes (delimited by comma) to compile serialization target type source codes.",
135+
"r|references=", "[serializer, optional] Specify reference assemblies' file pathes (delimited by comma) to compile serialization target type source codes. './MsgPack.dll' will be added automatically when it exists.",
135136
value => referenceAssemblies.AddRange( value.Split( new []{','}, StringSplitOptions.RemoveEmptyEntries).Select( token => token.Trim() ))
136137
},
137138
{
@@ -164,6 +165,10 @@ private static int Execute( IEnumerable<string> args )
164165
case Action.GenerateSerializers:
165166
{
166167
configuration.OutputDirectory = outputDirectoryPath;
168+
if ( File.Exists( "./MsgPack.dll" ) )
169+
{
170+
referenceAssemblies.Add( "./MsgPack.dll" );
171+
}
167172

168173
GenerateSerializers(
169174
sourceFilePathes,

0 commit comments

Comments
 (0)