Bilibili-Evolved/builder/dotnet/ClientBuilder.cs
2020-03-29 11:05:08 +08:00

26 lines
733 B
C#

using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Text.RegularExpressions;
namespace BilibiliEvolved.Build
{
partial class ProjectBuilder
{
public ProjectBuilder BuildClient()
{
var source = File.ReadAllText("src/client/bilibili-evolved.js");
source = RegexReplacer.Replace(source, @"import (.*) from [""'](.*)[""']", match =>
{
var module = File.ReadAllText("src/client/" + match.Groups[2].Value.Replace("./", "") + ".js").Replace("export ", "");
return module;
});
// File.WriteAllText(SourcePath, source);
Source = source;
WriteSuccess("Client Build complete.");
return this;
}
}
}