1
Vote

Cannot specify DefaultJavaScriptMinifier in config file

description

Hello,

it would be nice to be able to specify the DefaultJavaScriptMinifier in a config file.
For example to have the following in a .chirp.config file:
<Settings>
<Setting key="GoogleClosureJavaPath" value="C:\Program Files (x86)\Java\jre7\bin\javaw.exe" />
<Setting key="GoogleClosureOffline" value="true" />
<Setting key="DefaultJavaScriptMinifier" value="gctSimple"></Setting>
</Settings>

However the Settings class can not currently read the DefaultJavaScriptMinifier property.
There is an easy fix to this:
In private void SetSettings(IEnumerable<KeyValuePair<string, string>> settings) add
            else if (prop.PropertyType == typeof(Xml.MinifyType))
            {
                Xml.MinifyType t = Xml.MinifyType.Unspecified;
                if (Enum.TryParse(kvp.Value, true, out t)) {
                    prop.SetValue(this, t, null);
                }
            }
in the bottom of the foreach loop.

Could you please consider including this in Chirpy?

Thanks,
/Bjarke

comments