简体   繁体   English

Mono / C#的文档和构建系统

[英]Documentation and Build system for Mono/C#

I'm starting out on a new project and a team member has decided to use C# as the implementation language. 我正在开始一个新项目,团队成员决定使用C#作为实现语言。 I don't have a lot of experience in C#, but a brief reading shows that it's very capable of being a complete cross-platform vm. 我在C#方面没有太多经验,但简短的阅读表明它非常有能力成为一个完整的跨平台虚拟机。 Beyond the language, I've been having trouble selecting tools and workflows for managing the code as the project grows. 除了语言之外,随着项目的发展,我一直无法选择用于管理代码的工具和工作流程。 It should be fairly small (<10K lines) but I would like to have the ability to generate documentation as the project grows, manage any external dependencies that we decide to use, and automate builds and testing. 它应该相当小(<10K行)但我希望能够在项目增长时生成文档,管理我们决定使用的任何外部依赖项,并自动化构建和测试。 I am wondering what tools are commonly used or considered best practices for this language. 我想知道什么工具是常用的或被认为是这种语言的最佳实践。

I am mainly concerned with how would a build system potentially work on *nix as well as windows? 我主要关注构建系统如何在* nix和windows上运行? Are there C# specific tools or is Make more common? 是否有C#特定工具或更常见? In addition, I'd like to use a dvcs, but it doesn't look like Visual Studio and MonoDevelop support the same ones. 另外,我想使用dvcs,但它看起来不像Visual Studio和MonoDevelop支持相同的。 What's the common vcs of choice for C#? C#的常见vcs选择是什么? For testing sort of Unit testing is available for C#/Mono? 对于测试类型单元测试可用于C#/ Mono? Finally, I know that there are good doc generators, but with the question of the build system, I would really like to have that just be a single step in the build similar to how testing is a step. 最后,我知道有很好的文档生成器,但是对于构建系统的问题,我真的希望这只是构建中的一个步骤,类似于测试是一个步骤。 Normally I'd automate with Hudson, but I am wondering if there is something more specific to the platform. 通常我会使用Hudson自动化,但我想知道是否有更具体的平台。

Overall, I'd love to see a solution that provides a decent workflow on both windows and *nix without a heavy admin burden. 总的来说,我希望看到一个解决方案,在Windows和* nix上提供一个不错的工作流程,而不会带来沉重的管理负担。 I am pretty sure this is the holy grail of project management, so anything that puts me on that path is awesome. 我很确定这是项目管理的圣杯,所以任何能让我走上这条路的人都很棒。

In a project I work on, we use Visual Studio 2010, MonoDevelop/XBuild, Git, and monodoc. 在我工作的项目中,我们使用Visual Studio 2010,MonoDevelop / XBuild,Git和monodoc。 Project files created by Visual Studio 2010 can easily be read by MonoDevelop and XBuild. MonoDevelop和XBuild可以轻松读取Visual Studio 2010创建的项目文件。 Also, Git is an excellent VCS for distributed development (I especially like its branching). 此外,Git是一个用于分布式开发的优秀VCS(我特别喜欢它的分支)。 Monodoc, with some tweaking of command line parameters, can generate documentation from XML comments in code. Monodoc可以通过调整命令行参数来生成代码中XML注释的文档。

You can use any dvcs you'd like with it. 您可以使用任何您喜欢的dvcs。 MonoDevelop (at least in the trunk, not sure if it has been released yet) as Git support built in. There are some plugins for Visual Studio that give you Git too. MonoDevelop(至少在主干中,不确定它是否已经发布)作为内置的Git支持。有一些Visual Studio插件也可以为你提供Git。

Either way though, you don't need your source control to be integrated within the IDE, infact I prefer it not to be and use Git from TortoiseGit if I'm in windows, or from the command line on OS X (although I'm looking at Gitti for the OS X side). 无论哪种方式,你都不需要将你的源代码控制集成到IDE中,事实上我更喜欢它并不是如果我在Windows中,或者从OS X上的命令行使用TortoiseGit中的Git(尽管我'我在OS X方面看Gitti)。

For build, I would suggest TeamCity, since it supports up to three remote agents allowing you to build on Windows/Linux/Mac with the free version. 对于构建,我建议TeamCity,因为它支持最多三个远程代理,允许您使用免费版本在Windows / Linux / Mac上构建。

For build I'd use NAnt, although xbuild under mono works with solution files so that might be easier rather than maintaining two build scripts. 对于构建我会使用NAnt,虽然单声道下的xbuild可以使用解决方案文件,因此可能更容易,而不是维护两个构建脚本。 I like NAnt for CI simply because I find it easier to break apart into build, test, cover, package, deploy etc. 我喜欢NA的CI,因为我发现它更容易分解为构建,测试,封面,打包,部署等。

I've found that the combination of MonoDevelop, Git, TeamCity and NAnt gives you a few nice cross-platform development setup. 我发现MonoDevelop,Git,TeamCity和NAnt的组合为您提供了一些很好的跨平台开发设置。

I suggest you try to use one IDE mainly. 我建议你尝试主要使用一个IDE。 Most Mono IDEs support Visual Studio formats I guess. 我想大多数Mono IDE都支持Visual Studio格式。 At least SharpDeveblop does. 至少是SharpDeveblop。

http://mono-tools.com seems the correct way to develop for .NET and Mono only in Windows (not free). http://mono-tools.com似乎只是在Windows(非免费)中为.NET和Mono开发的正确方法。 I think this is the best option if I ever take developing for mono seriously ina commercial environment, but not 1005 sure. 我认为这是最好的选择,如果我在商业环境中认真开发单声道,但不是1005肯定。

http://sharpdevelop.com looks promising too, but still fells like the poor man option. http://sharpdevelop.com看起来也很有希望,但仍然像穷人选择一样倒下。

http://monodevelop.com/ is the way to go for developing for Mono in Linux. http://monodevelop.com/是在Linux中开发Mono的方法。

For DVCS you can always use Tortoise stuff and be IDE independent. 对于DVCS,您可以随时使用Tortoise并且与IDE无关。 git works great in Linux and TortoiseGit on Windows is very nice. git在Linux上运行得很好,而Windows上的TortoiseGit非常好用。 However, it terms of fame, SVN (not DVCS of course) is still dominant, especially it's client can connect to TFS via bridge. 然而,它的名气,SVN(当然不是DVCS)仍占主导地位,特别是它的客户端可以通过网桥连接到TFS。 Mercurial and Git are starting to take place in C# community though. Mercurial和Git开始在C#社区中发生。

CruiseControl.Net is a pretty good build / continuous integration system. CruiseControl.Net是一个非常好的构建/持续集成系统。 It can integrate a load of applications into the build process; 它可以将大量应用程序集成到构建过程中; we use NAnt for builds, NUnit unit tests and FXCop for code analysis. 我们使用NAnt进行构建,使用NUnit单元测试和FXCop进行代码分析。

Cake (C# Make) is an open source build automation system with a C# based domain specific language that can do things like compiling code, copy files/folders, running unit tests, compress files and build NuGet packages. Cake (C#Make)是一个开源构建自动化系统,具有基于C#的特定于域的语言,可以执行诸如编译代码,复制文件/文件夹,运行单元测试,压缩文件和构建NuGet包之类的操作。 It has tons of other built-in functionality and can easily be extended with custom code. 它具有大量其他内置功能,可以使用自定义代码轻松扩展。 It's available for Windows, Linux and OS X and can be used with several continuous integration systems such as AppVeyor, TeamCity, TFS, VSTS or Jenkins. 它适用于Windows,Linux和OS X,可与几个持续集成系统一起使用,如AppVeyor,TeamCity,TFS,VSTS或Jenkins。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM