Yesterday I released “FAKE – F# Make” version 1.33.0. This release has lots of small bug fixes and a couple of new features.
Important links:
Git helpers -Fake.Git.dll
Git is a distributed revision control system with an emphasis on speed. Git was initially designed and developed by Linus Torvalds for Linux kernel development. Every Git working directory is a full-fledged repository with complete history and full revision tracking capabilities, not dependent on network access or a central server.
In the last couple of months I worked on small helper library for controlling Git. This library is now released as part of “FAKE – F# Make”. You can find the source code at http://github.com/forki/FAKE/tree/master/src/app/Fake.Git/.
Features:
- Repository handling
- init, clone
- Submodules
- init, clone, information about submodules
- Branches
- checkout, create, delete, merge, rebase, tag, pull, push, reset, commit, …
- SHA1 calculation
Documentation generation with James Gregory’s docu tool
What’s a docu? A documentation generator for .Net that isn’t complicated, awkward, or difficult to use. Given an assembly and the XML that’s generated by Visual Studio, docu can produce an entire website of documentation with a single command.
Fake comes bundled with James Gregory’s documentations generator “docu”, which converts XML-Documentation comments into HTML files. All you need to do is downloading a template and calling the docu task inside your build script:
!+ (buildDir + "*.dll") |> Scan |> Docu (fun p -> {p with ToolPath = docuPath + "docu.exe" TemplatesPath = templatesSrcDir OutputPath = docsDir })
Since FAKE builds its own documentation with docu I started to add more (and hopefully better) XML doc comments. My plan is to describe more and more of the internal FAKE functions in the next releases. An updated HTML-document (generated via a docu task) can be found at http://www.navision-blog.de/fake/.
Side by side specification
For Test-driven development (TDD) it’s sometimes nice to have the specifications next to the implementation files since the specs are considered as documentation.
By using a tool like VSCommands it is possible to group the implementation with the specs (see also http://gist.github.com/457248).
This “side by side specification” makes TDD a lot easier but of course we don’t want to deploy the specification classes and the test data.
==> |
FAKE has a new feature which automatically removes all specification files and test framework references according to a given convention:
Target "BuildApp" (fun _ –> !+ @"src\app\**\*.csproj" |> Scan |> Seq.map ( RemoveTestsFromProject AllNUnitReferences // a default references convention AllSpecAndTestDataFiles // a default file convention ) |> MSBuildRelease buildDir "Build" |> Log "AppBuild-Output: " )
The conventions are simple functions and can be customized e.g.:
/// All Spec.cs or Spec.fs files and all files containing TestData let AllSpecAndTestDataFiles elementName (s:string) = s.EndsWith "Specs.cs" || s.EndsWith "Specs.fs" || (elementName = "Content" && s.Contains "TestData")
Miscellaneous
- SQL Server helpers are moved to Fake.SQL.dll
- Additional functions for attaching and detaching databases.
- FileHelper.CopyCached function was added
- Copies the files from a cache folder. If the files are not cached or the original files have a different write time the cache will be refreshed.
- EnvironmentHelper.environVarOrDefault added
- Retrieves the environment variable or a given default.
- Fixed Issue 3: toRelativePath calculates paths with ..\..\ if needed
- Added a build time report to the build output.
- XPathReplace and XMLPoke tasks added.
- Replaces text in an XML file at the location specified by an XPath expression.
- ILMerge task added
- Windows Installer XML (WiX) task added