forked from MirrorNetworking/Mirror
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Mirror.Build.cs
50 lines (43 loc) · 2.09 KB
/
Mirror.Build.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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
using Flax.Build;
using Flax.Build.NativeCpp;
using System.Collections.Generic;
using System.IO;
using System.Linq;
public class Mirror : GameModule
{
/// <inheritdoc />
public override void Init()
{
base.Init();
// C#-only scripting
BuildNativeCode = false;
}
/// <inheritdoc />
public override void Setup(BuildOptions options)
{
base.Setup(options);
options.ScriptingAPI.IgnoreMissingDocumentationWarnings = true;
options.SourcePaths.Clear();
options.SourceFiles.AddRange(Directory.GetFiles(Path.Combine(FolderPath, "Assets", "Mirror"), "*.*", SearchOption.AllDirectories));
List<string> except = Directory.GetFiles(Path.Combine(FolderPath, "Assets", "Mirror", "Examples"), "*.*", SearchOption.AllDirectories).ToList();
options.SourceFiles = options.SourceFiles.Except(except).ToList();
List<string> except2 = Directory.GetFiles(Path.Combine(FolderPath, "Assets", "Mirror", "Editor"), "*.*", SearchOption.AllDirectories).ToList();
options.SourceFiles = options.SourceFiles.Except(except2).ToList();
List<string> except3 = Directory.GetFiles(Path.Combine(FolderPath, "Assets", "Mirror", "Unused"), "*.*", SearchOption.AllDirectories).ToList();
options.SourceFiles = options.SourceFiles.Except(except3).ToList();
List<string> except4 = Directory.GetFiles(Path.Combine(FolderPath, "Assets", "Mirror", "Cloud"), "*.*", SearchOption.AllDirectories).ToList();
options.SourceFiles = options.SourceFiles.Except(except4).ToList();
/*
string output = "";
foreach(string name in options.SourceFiles)
{
output += name.Replace("D:\\Enginy\\Flax\\FlaxTest\\Source\\Mirror", "") + " ";
}
Flax.Build.Log.Info(output);
*/
// Here you can modify the build options for your game module
// To reference another module use: options.PublicDependencies.Add("Audio");
// To add C++ define use: options.PublicDefinitions.Add("COMPILE_WITH_FLAX");
// To learn more see scripting documentation.
}
}