{"id":862,"date":"2009-10-06T11:59:10","date_gmt":"2009-10-06T09:59:10","guid":{"rendered":"http:\/\/www.navision-blog.de\/2009\/10\/06\/fake-fsharp_make_version_0_10_released\/"},"modified":"2009-10-06T11:59:46","modified_gmt":"2009-10-06T09:59:46","slug":"fake-fsharp_make_version_0_10_released","status":"publish","type":"post","link":"http:\/\/www.navision-blog.de\/blog\/2009\/10\/06\/fake-fsharp_make_version_0_10_released\/","title":{"rendered":"&ldquo;FAKE &ndash; F# Make&rdquo; Version 0.10 released"},"content":{"rendered":"<p>I just released a new version of my Open Source Build Automation Framework <a href=\"http:\/\/code.google.com\/p\/fake\/\">\u201cFAKE \u2013 F# Make\u201d<\/a>. You can read more about FAKE on the <a href=\"http:\/\/code.google.com\/p\/fake\/\">project website<\/a> or in the <a href=\"http:\/\/www.navision-blog.de\/2009\/04\/01\/getting-started-with-fake-a-f-sharp-make-tool\/\">Getting started with &quot;FAKE &#8211; F# Make&quot;<\/a>-article.<\/p>\n<p>Although the new release contains many bugfixes, I only want to show the two major improvements here.<\/p>\n<h4>1. FAKE 0.10 uses FSI instead of FSC<\/h4>\n<p>From now on FAKE uses the \u201cF# Interactive\u201d (fsi.exe) instead of the F# Compiler (fsc.exe) to run the build scripts, which brings two major improvements.<\/p>\n<h5>No TempPath for compiled binaries needed<\/h5>\n<p>Due to the fact that FAKE scripts are no longer compiled at the beginning of the build process, we don\u2019t need a temporary folder for the created binaries. <\/p>\n<h5>Loading modules at runtime<\/h5>\n<p>The <font color=\"#0080ff\">#load<\/font> command in F# scripts allows us to load modules at runtime. Now we are able to put reusable Targets or TargetTemplates (see below) into external build script files.<\/p>\n<h4>2. TargetTemplates<\/h4>\n<p>TargetTemplates provide an easy way to reuse common Targets. Let\u2019s consider a (very) small sample:<\/p>\n<div style=\"font-family: courier new; background: white; color: black; font-size: 10pt\">\n<p style=\"margin: 0px\">Target <span style=\"color: maroon\">&quot;TraceHello&quot;<\/span> (<span style=\"color: blue\">fun<\/span> () <span style=\"color: blue\">-&gt;<\/span><\/p>\n<p style=\"margin: 0px\">&#160; trace <span style=\"color: maroon\">&quot;Hello World from FAKE&quot;<\/span><\/p>\n<p style=\"margin: 0px\">)<\/p>\n<\/p><\/div>\n<p>This Target \u201cTraceHello\u201d traces a \u201cHello World\u201d string into our build log. Now we want it to be slightly more generic and to trace a custom string. We can do this by using a TargetTemplate: <\/p>\n<div style=\"font-family: courier new; background: white; color: black; font-size: 10pt\">\n<p style=\"margin: 0px\"><span style=\"color: green\">\/\/\/ createTraceTarget: string -&gt; string -&gt; Target<\/span><\/p>\n<p style=\"margin: 0px\"><span style=\"color: blue\">let<\/span> createTraceTarget = TargetTemplate (<span style=\"color: blue\">fun<\/span> s <span style=\"color: blue\">-&gt;<\/span><\/p>\n<p style=\"margin: 0px\">&#160; trace s<\/p>\n<p style=\"margin: 0px\">)<\/p>\n<\/p><\/div>\n<p>Now we have a template (or a function which generates targets) that gets a string for the target name and a string for the trace text and generates&#160; a usable target:<\/p>\n<div style=\"font-family: courier new; background: white; color: black; font-size: 10pt\">\n<p style=\"margin: 0px\">createTraceTarget <span style=\"color: maroon\">&quot;TraceHello&quot;<\/span> <span style=\"color: maroon\">&quot;Hello World from FAKE&quot;<\/span><\/p>\n<p style=\"margin: 0px\">createTraceTarget <span style=\"color: maroon\">&quot;Trace2&quot;<\/span> <span style=\"color: maroon\">&quot;Trace another text&quot;<\/span><\/p>\n<\/p><\/div>\n<p>Of course the TargetTemplate function is generic and can be used with any tuple as parameter:<\/p>\n<div style=\"font-family: courier new; background: white; color: black; font-size: 10pt\">\n<p style=\"margin: 0px\"><span style=\"color: green\">\/\/\/ createTraceTarget: string -&gt; string*int -&gt; Target<\/span><\/p>\n<p style=\"margin: 0px\"><span style=\"color: blue\">let<\/span> createTraceTarget = TargetTemplate (<span style=\"color: blue\">fun<\/span> (s,d) <span style=\"color: blue\">-&gt;<\/span><\/p>\n<p style=\"margin: 0px\">&#160; trace s<\/p>\n<p style=\"margin: 0px\">&#160; trace &lt;| sprintf <span style=\"color: maroon\">&quot;my int: %d&quot;<\/span> d<\/p>\n<p style=\"margin: 0px\">)<\/p>\n<p style=\"margin: 0px\">&#160;<\/p>\n<p style=\"margin: 0px\">createTraceTarget <span style=\"color: maroon\">&quot;TraceHello&quot;<\/span> (<span style=\"color: maroon\">&quot;Hello World from FAKE&quot;<\/span>,2)<\/p>\n<p style=\"margin: 0px\">createTraceTarget <span style=\"color: maroon\">&quot;Trace2&quot;<\/span> (<span style=\"color: maroon\">&quot;Trace another text&quot;<\/span>,42)<\/p>\n<\/p><\/div>\n","protected":false},"excerpt":{"rendered":"<p>I just released a new version of my Open Source Build Automation Framework \u201cFAKE \u2013 F# Make\u201d. You can read more about FAKE on the project website or in the Getting started with &quot;FAKE &#8211; F# Make&quot;-article. Although the new release contains many bugfixes, I only want to show the two major improvements here. 1. [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[448,546],"tags":[664,534,545,544],"_links":{"self":[{"href":"http:\/\/www.navision-blog.de\/blog\/wp-json\/wp\/v2\/posts\/862"}],"collection":[{"href":"http:\/\/www.navision-blog.de\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.navision-blog.de\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.navision-blog.de\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.navision-blog.de\/blog\/wp-json\/wp\/v2\/comments?post=862"}],"version-history":[{"count":1,"href":"http:\/\/www.navision-blog.de\/blog\/wp-json\/wp\/v2\/posts\/862\/revisions"}],"predecessor-version":[{"id":863,"href":"http:\/\/www.navision-blog.de\/blog\/wp-json\/wp\/v2\/posts\/862\/revisions\/863"}],"wp:attachment":[{"href":"http:\/\/www.navision-blog.de\/blog\/wp-json\/wp\/v2\/media?parent=862"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.navision-blog.de\/blog\/wp-json\/wp\/v2\/categories?post=862"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.navision-blog.de\/blog\/wp-json\/wp\/v2\/tags?post=862"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}