自动化的F#签名文件(.fsi)生成 [英] Automated F# Signature File (.fsi) Generation

查看:140
本文介绍了自动化的F#签名文件(.fsi)生成的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在一个项目中,该项目具有多个模块,希望将访问控制约束应用于该模块.我还希望我的项目包含有关每个函数的类型签名的其他文档.

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.

我知道我可以通过F#签名文件非常轻松地完成这两项任务.但是,我的项目很大,包含许多文件,并且我需要一种便捷的方法来为每个文件生成签名文件.我已经成功使用 --sig编译器通过命令行编译生成了单个签名文件选项,但是我对如何在Visual Studio的构建例程中添加编译器选项感到困惑.

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.

我是否可以通过VS编译选项或某些命令行脚本来为项目目录中的每个* .fs文件创建F#签名文件的便捷方法?

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?

谢谢.

推荐答案

通过在解决方案资源管理器中右键单击您的项目,然后单击属性",可以告诉VS在构建时将任意标志传递给编译器.在构建"标签下,填写其他标志".

You can tell VS to pass arbitrary flags to the compiler upon build by right clicking on your project in Solution Explorer and clicking "Properties." Under the "Build" tab fill in "Other flags".

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

Specifying --sig:<Some path> (with support for msbuild-style $(Variable) settings) will auto-generate a single combined .fsi for your library.

这篇关于自动化的F#签名文件(.fsi)生成的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆