A Biml Script to run other Biml scripts

gravatar

David

This is a Biml script to execute other Biml scripts that match a file pattern.

published 10.20.13

last updated 10.20.13


Share

                            


<#
/*============================================================================= 
Description:     
Run all Validation Biml Scripts.  This is used to have a single place to run
all of our standard checks.
    
===============================================================================
History:
20130726    david.darden    Initial Version 
=============================================================================*/
#>

<#@ template language="C#" #>
<#@ import namespace="System.IO" #>
<#@ annotation annotationtype="Description" tag="Summary" text="VERIFY REQUIRED.  Runs all Validations (Biml Scripts prefixed with 'Val_')." #>

<#
string edw3Trunk = Environment.GetEnvironmentVariable("BFG_BI_EDW3_TRUNK");
string bimlScriptsDirectory = Path.Combine(edw3Trunk, "Framework", "BimlScripts");

foreach (var file in Directory.GetFiles(bimlScriptsDirectory, "Val_*"))
{
	// Skip it if the file is this script (causes infinite recursion)
	if(file.ToLowerInvariant().Contains("val_p_project_previewallvalidationscripts.biml")) { continue; }
	
	WriteLine("<!--\nExecuting '{0}'\n{1}\n-->", file,  string.Empty.PadRight(80, '='));
	var result = CallBimlScript(file);
	WriteLine("{0}\n\n", result.Trim());
}
#>
<Biml></Biml>
                        

We have a number of "Validation" Biml Scripts that we use at development time to check a project. These include validations of things such as naming standards, correct use of variables and expressions, verifying documentation annotations exists, etc. This is a script that executes all of the validations at once to make it easier for developers. This script is meant to run in Preview mode so the output is available for developers to review. This assumes a standard naming convention.

This only works in Mist 3.3+. You will, of course, need to adjust to your own path and naming conventions.

You are not authorized to comment. A verification email has been sent to your email address. Please verify your account.

Comments

There are no comments yet.