Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
GH2099: Also matches RFC-02 with a few changes. #2650
This pull request is what started RFC-02. At the time I was not able to submit a pull request for the changes.
Differences from RFC-02
I have been using several versions of Cake with this applied and have had no issues.
@mholo65 posted this in the RFC Comments
For the way this is implemented I feel just caching the compilation is enough. I need all of the lines of the script in order to do the hash for determining if anything has changed. The tools and addins are still being found like usual. The main changes were made in RoslynScriptSession and in there it just determines if it needs to compile the script or run the cached DLL.
Results from a very simple cake script that exists of one task and all it does it print out "Hello".
Note: Test are an average of 6 runs with tools and nugget packages already installed.
Next simple test that shows even more saving and uses a version of Cake.Recipe. The test consists of 3 simple tasks but two of the tasks uses the RequireTool call tools.cake. I made a change to the RequiresTool call to use a unique name for each script instead of a GUID so this script could be cached also.
Real world example is a project that I am currently working on.
Below is the Verbose output from the two different basic tests no cache and cached.
Differences from RFC-02 1) The cache argument was removed. A new section was added to the cake.config file [Cache] with 2 possible properties Enabled and Path. Enabled defaults to false and Path defaults cache under the tools folder. 2) I originally used a time stamp to determine if the cache was valid or not. I have changed this to use a hash like pull request 2584 used. I did change it to use SHA1CryptoServiceProvider instead of MD5 since MD5 is not FIPS compliant.