mirror of
https://github.com/ClassiCube/MCGalaxy.git
synced 2025-09-24 05:03:34 -04:00
Add //dotnetref comment so you can add dotnet build specific assembly references when compiling plugins in the dotnet build
This commit is contained in:
parent
e9a94fda48
commit
03ba36f694
@ -65,12 +65,16 @@ namespace MCGalaxy.Eco
|
||||
}
|
||||
|
||||
public static void UpdateMoney(string name, int money) {
|
||||
PlayerDB.Update(name, PlayerData.ColumnMoney, money.ToString());
|
||||
PlayerDB.Update(name, PlayerData.ColumnMoney,
|
||||
NumberUtils.StringifyInt(money));
|
||||
}
|
||||
|
||||
|
||||
public struct EcoStats {
|
||||
public string Player, Purchase, Payment, Salary, Fine; public int TotalSpent, __unused;
|
||||
public struct EcoStats
|
||||
{
|
||||
public string Player;
|
||||
public string Purchase, Payment, Salary, Fine;
|
||||
public int TotalSpent, __unused;
|
||||
}
|
||||
|
||||
public static void UpdateStats(EcoStats stats) {
|
||||
|
@ -156,6 +156,10 @@ namespace MCGalaxy.Modules.Compiling
|
||||
} else if (line.CaselessStarts(plgPrefix)) {
|
||||
path = Path.Combine(IScripting.PLUGINS_DLL_DIR, GetDLL(line));
|
||||
referenced.Add(Path.GetFullPath(path));
|
||||
#if NETSTANDARD
|
||||
} else if (line.CaselessStarts(commentPrefix + "dotnetref")) {
|
||||
referenced.Add(GetDLL(line));
|
||||
#endif
|
||||
} else {
|
||||
continue;
|
||||
}
|
||||
|
@ -98,6 +98,10 @@ namespace MCGalaxy.Modules.Compiling
|
||||
static Regex outputRegWithFileAndLine;
|
||||
static Regex outputRegSimple;
|
||||
|
||||
public static List<string> PrepareInput(string[] srcPaths) {
|
||||
return ICompiler.ProcessInput(srcPaths, "//");
|
||||
}
|
||||
|
||||
public static ICompilerErrors Compile(string[] srcPaths, string dstPath, List<string> referenced) {
|
||||
string args = GetCommandLineArguments(srcPaths, dstPath, referenced);
|
||||
string netPath = GetBinaryFile("MCG_DOTNET_PATH", "'dotnet' executable - e.g. /home/test/.dotnet/dotnet");
|
||||
|
@ -43,7 +43,7 @@ namespace MCGalaxy.Modules.Compiling
|
||||
}
|
||||
#else
|
||||
protected override ICompilerErrors DoCompile(string[] srcPaths, string dstPath) {
|
||||
List<string> referenced = ProcessInput(srcPaths, "//");
|
||||
List<string> referenced = RoslynCSharpCompiler.PrepareInput(srcPaths);
|
||||
return RoslynCSharpCompiler.Compile(srcPaths, dstPath, referenced);
|
||||
}
|
||||
#endif
|
||||
|
Loading…
x
Reference in New Issue
Block a user