Mac上のUnityで、BooやUnity Script(JavaScript)のコンパイラがどこにあるのか気になったので探してみた。
ちなみに、C#のコンパイラはUnityで、自作Assetをdllファイルにコンパイルするの最後のほうに書いてあるので参考まで。
Booコンパイラ
まずは、Boo。
/Applications/Unity/Unity.app/Contents/Frameworks/Mono/lib/mono/unity/booc.exe
にある。
拡張子が.exeになっているが間違いではない。
これは.NETの実行ファイルになっているので、monoを使えばMacでも実行できる。
とりあえず、ヘルプを見てみる。
$ mono /Applications/Unity/Unity.app/Contents/Frameworks/Mono/lib/mono/unity/booc.exe -help
のように実行すると、以下の結果が得られる。
Usage: booc [options] file1 ...
Options:
-c:CULTURE Sets the UI culture to be CULTURE
-checked[+|-] Turns on or off checked operations (default: +)
-debug[+|-] Generate debugging information (default: +)
-define:S1[,Sn] Defines symbols S1..Sn with optional values (=val) (-d:)
-delaysign Delays assembly signing
-ducky Turns on duck typing by default
-embedres:FILE[,ID] Embeds FILE with the optional ID
-keycontainer:NAME The key pair container used to strongname the assembly
-keyfile:FILE The strongname key file used to strongname the assembly
-lib:DIRS Adds the comma-separated DIRS to the assembly search path
-noconfig Does not load the standard configuration
-nologo Does not display the compiler logo
-nostdlib Does not reference any of the default libraries
-nowarn[:W1,Wn] Suppress all or a list of compiler warnings
-o:FILE Sets the output file name to FILE
-p:PIPELINE Sets the pipeline to PIPELINE
-pkg:P1[,Pn] References packages P1..Pn (on supported platforms)
-platform:ARCH Specifies target platform (anycpu, x86, x64 or itanium)
-reference:A1[,An] References assemblies (-r:)
-resource:FILE[,ID] Embeds FILE as a resource
-srcdir:DIR Adds DIR as a directory where sources can be found
-strict Turns on strict mode.
-target:TYPE Sets the target type (exe, library or winexe) (-t:)
-unsafe Allows to compile unsafe code.
-utf8 Source file(s) are in utf8 format
-v, -vv, -vvv Sets verbosity level from warnings to very detailed
-warn:W1[,Wn] Enables a list of optional warnings.
-warnaserror[:W1,Wn] Treats all or a list of warnings as errors
-wsa Enables white-space-agnostic build
これを見ると、booc.exeにファイル名を与えてやればコンパイル出来そうだ。(おそらく、-r:オプションにUnitiEngine.dllの場所を指定しなければいけないと思われるが…)
Unity Scriptコンパイラ
Uniti Script(JavaScript)のコンパイラは以下の場所。
(たぶん、これだと思うんだけど、実際にコンパイルしてないので自信は無い…。)
/Applications/Unity/Unity.app/Contents/Frameworks/Mono/lib/mono/unity/us.exe
こちらも、monoを使って実行してみる。
$ mono /Applications/Unity/Unity.app/Contents/Frameworks/Mono/lib/mono/unity/us.exe -help
実行結果が以下。
UnityScript command line tool - 0.1.0.0 (C) 2005 OverTheEdge
-b -base:class Base class for the script module
-debug[+-] Enable writing debug symbols.
-debug-compiler[+-] Displays internal compiler information
-d -define:define Defines a symbol
-disable-eval:disable-eval Disables eval builtin.
-ducky:ducky Option has been deprecated
-x -execute[+-] Execute resulting main method.
-expando[+-] Enable expando mode.
-help[+-] display this help and exit
-i -import:namespace Adds a 'import namespace' to the script module
-m -method:name Module's main method name
-nowarn:code Suppress the warning code
-o -out:file Specifies the output file name
-pragmas:set Enables a comma separated set of #pragma directives on every module
-p -print[+-] Print the resulting code (in boo). Do not generate an assembly.
-r -reference:assembly References the specified assembly
-resource:file Embed a managed resource file
-srcdir:srcdir Includes all *.js files from srcdir
-t -target:kind Specifies the target (kind is one of: exe, winexe, library)
-verbose[+-] Enable verbose mode.
-x-type-inference-rule-attribute:type Enables custom type inference rules to be specified through the attribute type
これはコンパイラであってるのかな…?
あとで試してみよう。