10

I am working on a project that has a number of modules that I'd like to apply access control constraints to. I'd also like to have my project contain additional documentation on the type signatures of each function.

I know that I can accomplish both of these tasks very easily via F# signature files. However, my project is large and contains many files, and I need a convenient way of generating a signature file for each one. I have been successful in generating individual signature files via command line compilations using the --sig compiler option, but I am stuck on how to add compiler options to Visual Studio's build routine.

Is there a convenient way, either via VS compilation options, or via some command line script, for me to create an F# signature file for every *.fs file in my project directory?

Thanks.

4

1 回答 1

12

您可以通过在解决方案资源管理器中右键单击您的项目并单击“属性”来告诉 VS 在构建时将任意标志传递给编译器。在“构建”选项卡下填写“其他标志”。

指定--sig:<Some path>(支持 msbuild 样式$(Variable)设置)将为您的库自动生成一个组合.fsi

在此处输入图像描述

于 2014-06-17T21:55:32.480 回答