-
Notifications
You must be signed in to change notification settings - Fork 0
/
c#3-builder.cs
30 lines (26 loc) · 982 Bytes
/
c#3-builder.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
// c#3 builder by Daniel Steigerwald
// found here: http://mootools.lighthouseapp.com/projects/2706-mootools/tickets/288
using System;
using System.Collections.Generic;
using System.IO;
using System.Web.Script.Serialization;
public partial class _tests_MooBuild : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
using (StreamWriter sw = File.CreateText(Context.Server.MapPath(@"~\js\src\mootools\mootools.js")))
sw.Write(mooPart("core") + mooPart("more"));
}
string mooPart(string part)
{
string
subPath = Context.Server.MapPath(@"~\js\src\mootools\" + part + @"\source"),
scriptsJson = File.ReadAllText(subPath + @"\scripts.json"),
o = string.Empty;
var scripts = new JavaScriptSerializer().Deserialize<Dictionary<string, Dictionary<string, object>>>(scriptsJson);
foreach (var dir in scripts)
foreach (var file in dir.Value)
o += File.ReadAllText(subPath + @"\" + dir.Key + @"\" + file.Key + ".js");
return o;
}
}