-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathScriptUtils.cs
More file actions
47 lines (40 loc) · 1.41 KB
/
ScriptUtils.cs
File metadata and controls
47 lines (40 loc) · 1.41 KB
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
using System;
using System.Collections.Generic;
using System.Text;
using System.IO;
namespace OnyxJS
{
class ScriptUtils
{
public static string[] BuildFilesList(String entry_point_file)
{
entry_point_file = Path.GetFullPath(entry_point_file);
string file_name = Path.GetFileName(entry_point_file);
List<string> files = new List<string>();
files.Add(entry_point_file);
string entry_path = entry_point_file.Substring(0, entry_point_file.Length - file_name.Length);
if (File.Exists(entry_path + "include.txt"))
{
TextReader tx = new StreamReader(entry_path + "include.txt");
String buff;
bool loop = true;
while (loop)
{
buff = tx.ReadLine();
if (buff == null)
{
loop = false;
continue;
}
if (buff.StartsWith("//")) continue;
if (!File.Exists(buff)) continue;
files.Add(Path.GetFullPath(buff));
}
}
//Directory.CreateDirectory(entry_path + "build");
Console.WriteLine("entry :" + entry_point_file);
Console.WriteLine("folder :" + entry_path);
return files.ToArray();
}
}
}