mirror of
https://github.com/beefytech/Beef.git
synced 2025-07-05 15:56:00 +02:00
Initial checkin
This commit is contained in:
parent
c74712dad9
commit
078564ac9e
3242 changed files with 1616395 additions and 0 deletions
92
BeefBuild/BeefProj.toml
Normal file
92
BeefBuild/BeefProj.toml
Normal file
|
@ -0,0 +1,92 @@
|
|||
FileVersion = 1
|
||||
Dependencies = {Beefy2D = "*", corlib = "*"}
|
||||
|
||||
[Project]
|
||||
Name = "BeefBuild"
|
||||
StartupObject = "BeefBuild.Program"
|
||||
|
||||
[Configs.Debug.Win32]
|
||||
TargetName = ""
|
||||
OtherLinkFlags = ""
|
||||
OptimizationLevel = "O0"
|
||||
|
||||
[Configs.Debug.Win64]
|
||||
TargetDirectory = "$(WorkspaceDir)/../IDE/dist"
|
||||
TargetName = "$(ProjectName)_d"
|
||||
OtherLinkFlags = "$(LinkFlags) Comdlg32.lib kernel32.lib user32.lib advapi32.lib shell32.lib IDEHelper64_d.lib BeefySysLib64_d.lib curl.lib git2.lib libssh2.lib Winhttp.lib Rpcrt4.lib Ole32.lib"
|
||||
CLibType = "Dynamic"
|
||||
BeefLibType = "DynamicDebug"
|
||||
DebugCommandArguments = "-workspace=."
|
||||
DebugWorkingDirectory = "$(WorkspaceDir)/../IDE/dist"
|
||||
EnvironmentVars = ["_NO_DEBUG_HEAP=1"]
|
||||
PreprocessorMacros = ["DEBUG", "CLI"]
|
||||
|
||||
[Configs.Debug.Linux64]
|
||||
TargetDirectory = "$(WorkspaceDir)/../IDE/dist"
|
||||
TargetName = "$(ProjectName)_d"
|
||||
OtherLinkFlags = "./libBeefRT_d.so ./libIDEHelper_d.so ./libBeefySysLib_d.so ../../extern/llvm_linux_8_0_0/lib/libLLVMCore.a ../../extern/llvm_linux_8_0_0/lib/libLLVMMC.a ../../extern/llvm_linux_8_0_0/lib/libLLVMMCParser.a ../../extern/llvm_linux_8_0_0/lib/libLLVMCodeGen.a ../../extern/llvm_linux_8_0_0/lib/libLLVMX86Disassembler.a ../../extern/llvm_linux_8_0_0/lib/libLLVMMCDisassembler.a ../../extern/llvm_linux_8_0_0/lib/libLLVMSupport.a ../../extern/llvm_linux_8_0_0/lib/libLLVMX86Info.a ../../extern/llvm_linux_8_0_0/lib/libLLVMX86Utils.a ../../extern/llvm_linux_8_0_0/lib/libLLVMX86AsmPrinter.a ../../extern/llvm_linux_8_0_0/lib/libLLVMX86Desc.a ../../extern/llvm_linux_8_0_0/lib/libLLVMObject.a ../../extern/llvm_linux_8_0_0/lib/libLLVMBitReader.a ../../extern/llvm_linux_8_0_0/lib/libLLVMAsmParser.a ../../extern/llvm_linux_8_0_0/lib/libLLVMTarget.a ../../extern/llvm_linux_8_0_0/lib/libLLVMX86CodeGen.a ../../extern/llvm_linux_8_0_0/lib/libLLVMScalarOpts.a ../../extern/llvm_linux_8_0_0/lib/libLLVMInstCombine.a ../../extern/llvm_linux_8_0_0/lib/libLLVMSelectionDAG.a ../../extern/llvm_linux_8_0_0/lib/libLLVMProfileData.a ../../extern/llvm_linux_8_0_0/lib/libLLVMTransformUtils.a ../../extern/llvm_linux_8_0_0/lib/libLLVMAnalysis.a ../../extern/llvm_linux_8_0_0/lib/libLLVMX86AsmParser.a ../../extern/llvm_linux_8_0_0/lib/libLLVMAsmPrinter.a ../../extern/llvm_linux_8_0_0/lib/libLLVMBitWriter.a ../../extern/llvm_linux_8_0_0/lib/libLLVMVectorize.a ../../extern/llvm_linux_8_0_0/lib/libLLVMipo.a ../../extern/llvm_linux_8_0_0/lib/libLLVMInstrumentation.a ../../extern/llvm_linux_8_0_0/lib/libLLVMDebugInfoDWARF.a ../../extern/llvm_linux_8_0_0/lib/libLLVMDebugInfoPDB.a ../../extern/llvm_linux_8_0_0/lib/libLLVMDebugInfoCodeView.a ../../extern/llvm_linux_8_0_0/lib/libLLVMGlobalISel.a ../../extern/llvm_linux_8_0_0/lib/libLLVMBinaryFormat.a ../../extern/llvm_linux_8_0_0/lib/libLLVMDemangle.a -ltinfo -Wl,-rpath -Wl,."
|
||||
CLibType = "Dynamic"
|
||||
DebugCommandArguments = "-proddir=..\\ -config=Debug -platform=Win64"
|
||||
DebugWorkingDirectory = "$(WorkspaceDir)/../IDE/dist"
|
||||
PreprocessorMacros = ["DEBUG", "CLI"]
|
||||
|
||||
[Configs.Release.Linux64]
|
||||
TargetDirectory = "$(WorkspaceDir)/../IDE/dist"
|
||||
OtherLinkFlags = "./libBeefRT.so ./libIDEHelper.so ./libBeefySysLib.so ../../extern/llvm_linux_rel_8_0_0/lib/libLLVMCore.a ../../extern/llvm_linux_rel_8_0_0/lib/libLLVMMC.a ../../extern/llvm_linux_rel_8_0_0/lib/libLLVMMCParser.a ../../extern/llvm_linux_rel_8_0_0/lib/libLLVMCodeGen.a ../../extern/llvm_linux_rel_8_0_0/lib/libLLVMX86Disassembler.a ../../extern/llvm_linux_rel_8_0_0/lib/libLLVMMCDisassembler.a ../../extern/llvm_linux_rel_8_0_0/lib/libLLVMSupport.a ../../extern/llvm_linux_rel_8_0_0/lib/libLLVMX86Info.a ../../extern/llvm_linux_rel_8_0_0/lib/libLLVMX86Utils.a ../../extern/llvm_linux_rel_8_0_0/lib/libLLVMX86AsmPrinter.a ../../extern/llvm_linux_rel_8_0_0/lib/libLLVMX86Desc.a ../../extern/llvm_linux_rel_8_0_0/lib/libLLVMObject.a ../../extern/llvm_linux_rel_8_0_0/lib/libLLVMBitReader.a ../../extern/llvm_linux_rel_8_0_0/lib/libLLVMAsmParser.a ../../extern/llvm_linux_rel_8_0_0/lib/libLLVMTarget.a ../../extern/llvm_linux_rel_8_0_0/lib/libLLVMX86CodeGen.a ../../extern/llvm_linux_rel_8_0_0/lib/libLLVMScalarOpts.a ../../extern/llvm_linux_rel_8_0_0/lib/libLLVMInstCombine.a ../../extern/llvm_linux_rel_8_0_0/lib/libLLVMSelectionDAG.a ../../extern/llvm_linux_rel_8_0_0/lib/libLLVMProfileData.a ../../extern/llvm_linux_rel_8_0_0/lib/libLLVMTransformUtils.a ../../extern/llvm_linux_rel_8_0_0/lib/libLLVMAnalysis.a ../../extern/llvm_linux_rel_8_0_0/lib/libLLVMX86AsmParser.a ../../extern/llvm_linux_rel_8_0_0/lib/libLLVMAsmPrinter.a ../../extern/llvm_linux_rel_8_0_0/lib/libLLVMBitWriter.a ../../extern/llvm_linux_rel_8_0_0/lib/libLLVMVectorize.a ../../extern/llvm_linux_rel_8_0_0/lib/libLLVMipo.a ../../extern/llvm_linux_rel_8_0_0/lib/libLLVMInstrumentation.a ../../extern/llvm_linux_rel_8_0_0/lib/libLLVMDebugInfoDWARF.a ../../extern/llvm_linux_rel_8_0_0/lib/libLLVMDebugInfoPDB.a ../../extern/llvm_linux_rel_8_0_0/lib/libLLVMDebugInfoCodeView.a ../../extern/llvm_linux_rel_8_0_0/lib/libLLVMGlobalISel.a ../../extern/llvm_linux_rel_8_0_0/lib/libLLVMBinaryFormat.a ../../extern/llvm_linux_rel_8_0_0/lib/libLLVMDemangle.a -ltinfo -Wl,-rpath -Wl,."
|
||||
CLibType = "Dynamic"
|
||||
DebugCommandArguments = "-proddir=..\\ -config=Debug -platform=Win64"
|
||||
DebugWorkingDirectory = "$(WorkspaceDir)/../IDE/dist"
|
||||
PreprocessorMacros = ["CLI"]
|
||||
|
||||
[Configs.Release.Win32]
|
||||
TargetName = ""
|
||||
OtherLinkFlags = ""
|
||||
OptimizationLevel = "O0"
|
||||
|
||||
[Configs.Release.Win64]
|
||||
TargetDirectory = "$(WorkspaceDir)/../IDE/dist"
|
||||
OtherLinkFlags = "$(LinkFlags) Comdlg32.lib kernel32.lib user32.lib advapi32.lib shell32.lib IDEHelper64.lib BeefySysLib64.lib"
|
||||
CLibType = "Dynamic"
|
||||
DebugCommandArguments = "-proddir=..\\..\\BeefPerf -config=Release"
|
||||
DebugWorkingDirectory = "$(ProjectDir)\\dist"
|
||||
EnvironmentVars = ["_NO_DEBUG_HEAP=1"]
|
||||
PreprocessorMacros = ["RELEASE", "CLI"]
|
||||
OptimizationLevel = "O0"
|
||||
|
||||
[Configs.Debug2.Win32]
|
||||
TargetName = ""
|
||||
OtherLinkFlags = ""
|
||||
OptimizationLevel = "O0"
|
||||
|
||||
[Configs.Debug2.Win64]
|
||||
TargetDirectory = "$(WorkspaceDir)/dist"
|
||||
TargetName = "$(ProjectName)_d2"
|
||||
OtherLinkFlags = "Comdlg32.lib kernel32.lib user32.lib advapi32.lib shell32.lib Beef042RT64_d.lib IDEHelper64_d.lib BeefySysLib64_d.lib"
|
||||
CLibType = "Dynamic"
|
||||
DebugCommandArguments = "-proddir=c:\\beef\\IDEHelper\\Tests -test"
|
||||
DebugWorkingDirectory = "c:\\beef\\IDE\\dist"
|
||||
EnvironmentVars = ["_NO_DEBUG_HEAP=1"]
|
||||
PreprocessorMacros = ["DEBUG", "CLI"]
|
||||
OptimizationLevel = "OgPlus"
|
||||
|
||||
[Configs.Test.Win32]
|
||||
OtherLinkFlags = "BeefRT32_d.lib"
|
||||
|
||||
[Configs.Test.Win64]
|
||||
OtherLinkFlags = "Beef042RT64_d.lib"
|
||||
|
||||
[Configs.Paranoid.Win32]
|
||||
CLibType = "Static"
|
||||
BeefLibType = "Static"
|
||||
|
||||
[Configs.Paranoid.Win64]
|
||||
CLibType = "Static"
|
||||
BeefLibType = "Static"
|
||||
|
||||
[ProjectFolder]
|
||||
|
||||
[[ProjectFolder.Items]]
|
||||
Type = "Folder"
|
||||
Path = "../IDE/src"
|
||||
Name = "ide"
|
||||
AutoInclude = true
|
92
BeefBuild/BeefSpace.toml
Normal file
92
BeefBuild/BeefSpace.toml
Normal file
|
@ -0,0 +1,92 @@
|
|||
FileVersion = 1
|
||||
Projects = {BeefBuild = {Path = "."}, corlib = {Path = "../IDE\\corlib"}, Beefy2D = {Path = "../BeefLibs/Beefy2D"}, IDEHelper = {Path = "../IDEHelper"}, Debugger64 = {Path = "../Debugger64"}, BeefySysLib = {Path = "../BeefySysLib"}}
|
||||
|
||||
[Workspace]
|
||||
StartupProject = "BeefBuild"
|
||||
|
||||
[Configs.Debug.Win32]
|
||||
Toolset = "GNU"
|
||||
BfOptimizationLevel = "O0"
|
||||
InitLocalVariables = true
|
||||
EmitObjectAccessCheck = false
|
||||
EnableCustodian = false
|
||||
EnableRealtimeLeakCheck = false
|
||||
AllocStackTraceDepth = 0
|
||||
ConfigSelections = {IDEHelper = {Enabled = false}}
|
||||
|
||||
[Configs.Debug.Win64]
|
||||
EnableSideStack = true
|
||||
ConfigSelections = {IDEHelper = {Enabled = false}, Debugger64 = {Enabled = false}, BeefySysLib = {Enabled = false}}
|
||||
|
||||
[Configs.Release.Win32]
|
||||
Toolset = "GNU"
|
||||
BfOptimizationLevel = "OgPlus"
|
||||
EmitDebugInfo = "No"
|
||||
AllocStackTraceDepth = 0
|
||||
ConfigSelections = {IDEHelper = {Enabled = false}}
|
||||
|
||||
[Configs.Release.Win64]
|
||||
|
||||
[Configs.Release.Win64z]
|
||||
EnableObjectDebugFlags = true
|
||||
EmitObjectAccessCheck = true
|
||||
EnableCustodian = true
|
||||
EnableRealtimeLeakCheck = true
|
||||
AllocStackTraceDepth = 0
|
||||
|
||||
[Configs.Debug-IDE.Win32]
|
||||
Toolset = "GNU"
|
||||
BfOptimizationLevel = "O0"
|
||||
EmitDebugInfo = "No"
|
||||
ArrayBoundsCheck = false
|
||||
EmitDynamicCastCheck = false
|
||||
EnableObjectDebugFlags = false
|
||||
EmitObjectAccessCheck = false
|
||||
EnableCustodian = false
|
||||
EnableRealtimeLeakCheck = false
|
||||
AllocStackTraceDepth = 0
|
||||
ConfigSelections = {corlib = {Config = "Debug"}, Beefy2D = {Config = "Debug"}, IDEHelper = {Config = "Debug"}, Debugger64 = {Config = "Debug"}, BeefySysLib = {Config = "Debug"}}
|
||||
|
||||
[Configs.Debug-IDE.Win64]
|
||||
Toolset = "GNU"
|
||||
BfOptimizationLevel = "O0"
|
||||
EmitDebugInfo = "No"
|
||||
ArrayBoundsCheck = false
|
||||
EmitDynamicCastCheck = false
|
||||
EnableObjectDebugFlags = false
|
||||
EmitObjectAccessCheck = false
|
||||
EnableCustodian = false
|
||||
EnableRealtimeLeakCheck = false
|
||||
ConfigSelections = {corlib = {Config = "Debug"}, Beefy2D = {Config = "Debug"}, IDEHelper = {Config = "Debug"}, Debugger64 = {Config = "Debug"}, BeefySysLib = {Config = "Debug"}}
|
||||
|
||||
[Configs.Debug2.Win32]
|
||||
Toolset = "GNU"
|
||||
BfOptimizationLevel = "O0"
|
||||
EmitDebugInfo = "No"
|
||||
ArrayBoundsCheck = false
|
||||
EmitDynamicCastCheck = false
|
||||
EnableObjectDebugFlags = false
|
||||
EmitObjectAccessCheck = false
|
||||
EnableCustodian = false
|
||||
EnableRealtimeLeakCheck = false
|
||||
AllocStackTraceDepth = 0
|
||||
ConfigSelections = {corlib = {Config = "Debug"}, Beefy2D = {Config = "Debug"}, IDEHelper = {Config = "Debug"}, Debugger64 = {Config = "Debug"}, BeefySysLib = {Config = "Debug"}}
|
||||
|
||||
[Configs.Debug2.Win64]
|
||||
PreprocessorMacros = ["NEWFONT"]
|
||||
IntermediateType = "ObjectAndIRCode"
|
||||
ConfigSelections = {corlib = {Config = "Debug"}, Beefy2D = {Config = "Debug"}, IDEHelper = {Config = "Debug"}, Debugger64 = {Config = "Debug"}, BeefySysLib = {Config = "Debug"}}
|
||||
|
||||
[Configs.Paranoid.Win32]
|
||||
Toolset = "GNU"
|
||||
COptimizationLevel = "O2"
|
||||
|
||||
[Configs.Paranoid.Win64]
|
||||
Toolset = "GNU"
|
||||
COptimizationLevel = "O2"
|
||||
|
||||
[Configs.Test.Win32]
|
||||
COptimizationLevel = "O2"
|
||||
|
||||
[Configs.Test.Win64]
|
||||
COptimizationLevel = "O2"
|
250
BeefBuild/src/BuildApp.bf
Normal file
250
BeefBuild/src/BuildApp.bf
Normal file
|
@ -0,0 +1,250 @@
|
|||
using IDE;
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Threading;
|
||||
using System.Diagnostics;
|
||||
using System.Collections.Generic;
|
||||
using IDE.Util;
|
||||
|
||||
namespace BeefBuild
|
||||
{
|
||||
class BuildApp : IDEApp
|
||||
{
|
||||
const int cProgressSize = 30;
|
||||
int mProgressIdx = 0;
|
||||
public bool mIsTest;
|
||||
public bool mIsFailTest;
|
||||
|
||||
/*void Test()
|
||||
{
|
||||
/*CURL.Easy easy = new CURL.Easy();
|
||||
easy.SetOpt(.URL, "http://raw.githubusercontent.com/alexcrichton/curl-rust/master/Cargo.toml");
|
||||
easy.SetOpt(.Verbose, true);
|
||||
easy.Perform();*/
|
||||
Transfer transfer = new Transfer();
|
||||
//transfer.Setup("https://curl.haxx.se/download/curl-7.57.0.zip");
|
||||
transfer.Setup("https://secure-appldnld.apple.com/itunes12/091-56359-20171213-EDF2198A-E039-11E7-9A9F-D21A1E4B8CED/iTunes64Setup.exe");
|
||||
transfer.PerformBackground();
|
||||
|
||||
while (transfer.IsRunning)
|
||||
{
|
||||
Thread.Sleep(100);
|
||||
Console.WriteLine("{0}/{1} @{2}Kps", transfer.BytesReceived, transfer.TotalBytes, transfer.BytesPerSecond / 1024);
|
||||
}
|
||||
|
||||
#unwarn
|
||||
let result = transfer.GetResult();
|
||||
}*/
|
||||
|
||||
public this()
|
||||
{
|
||||
//mConfigName.Clear();
|
||||
//mPlatformName.Clear();
|
||||
mVerbosity = .Normal;
|
||||
|
||||
//Test();
|
||||
}
|
||||
|
||||
public override void Init()
|
||||
{
|
||||
if (mConfigName.IsEmpty)
|
||||
{
|
||||
mConfigName.Set(mIsTest ? "Test" : "Debug");
|
||||
}
|
||||
|
||||
if (mPlatformName.IsEmpty)
|
||||
{
|
||||
mPlatformName.Set(sPlatform64Name);
|
||||
}
|
||||
|
||||
mMainThread = Thread.CurrentThread;
|
||||
|
||||
if (mConfigName.IsEmpty)
|
||||
Fail("Config not specified");
|
||||
if (mPlatformName.IsEmpty)
|
||||
Fail("Platform not specified");
|
||||
|
||||
base.Init();
|
||||
|
||||
mInitialized = true;
|
||||
CreateBfSystems();
|
||||
if (mWantsClean)
|
||||
{
|
||||
mBfBuildCompiler.ClearBuildCache();
|
||||
mWantsClean = false;
|
||||
}
|
||||
|
||||
if (mWorkspace.mDir == null)
|
||||
{
|
||||
mWorkspace.mDir = new String();
|
||||
Directory.GetCurrentDirectory(mWorkspace.mDir);
|
||||
}
|
||||
|
||||
if (mWorkspace.mDir != null)
|
||||
{
|
||||
mWorkspace.mName = new String();
|
||||
Path.GetFileName(mWorkspace.mDir, mWorkspace.mName);
|
||||
LoadWorkspace();
|
||||
}
|
||||
else
|
||||
Fail("Workspace not specified");
|
||||
|
||||
if (mFailed)
|
||||
return;
|
||||
|
||||
WorkspaceLoaded();
|
||||
|
||||
if (mIsTest)
|
||||
{
|
||||
RunTests(false);
|
||||
}
|
||||
else
|
||||
Compile(.Normal, null);
|
||||
}
|
||||
|
||||
public override bool HandleCommandLineParam(String key, String value)
|
||||
{
|
||||
if (value == null)
|
||||
{
|
||||
switch (key)
|
||||
{
|
||||
case "-test":
|
||||
mIsTest = true;
|
||||
return true;
|
||||
case "-testfail":
|
||||
mIsFailTest = true;
|
||||
return true;
|
||||
case "-clean":
|
||||
mWantsClean = true;
|
||||
return true;
|
||||
case "-noir":
|
||||
mConfig_NoIR = true;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if ((key == "-proddir") || (key == "-workspace"))
|
||||
{
|
||||
var relDir = scope String(value);
|
||||
if ((relDir.EndsWith("\\")) || relDir.EndsWith("\""))
|
||||
relDir.RemoveToEnd(relDir.Length - 1); //...
|
||||
IDEUtils.FixFilePath(relDir);
|
||||
|
||||
String fullDir = new String();
|
||||
Path.GetFullPath(relDir, fullDir);
|
||||
|
||||
mWorkspace.mDir = fullDir;
|
||||
return true;
|
||||
}
|
||||
|
||||
switch (key)
|
||||
{
|
||||
case "-config":
|
||||
mConfigName.Set(value);
|
||||
return true;
|
||||
case "-platform":
|
||||
mPlatformName.Set(value);
|
||||
return true;
|
||||
case "-verbosity":
|
||||
if (value == "quiet")
|
||||
mVerbosity = .Quiet;
|
||||
else if (value == "minimal")
|
||||
mVerbosity = .Minimal;
|
||||
else if (value == "normal")
|
||||
mVerbosity = .Normal;
|
||||
else if (value == "detailed")
|
||||
mVerbosity = .Detailed;
|
||||
//else if (value == "diagnostic")
|
||||
//mVerbosity = .Diagnostic;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
#if BF_PLATFORM_WINDOWS
|
||||
if (key == "-wait")
|
||||
{
|
||||
Windows.MessageBoxA((Windows.HWnd)0, "Wait2", "Wait", 0);
|
||||
return true;
|
||||
}
|
||||
#endif //BF_PLATFORM_WINDOWS
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
protected override void BeefCompileStarted()
|
||||
{
|
||||
base.BeefCompileStarted();
|
||||
|
||||
if (mVerbosity >= .Normal)
|
||||
{
|
||||
if (cProgressSize > 0)
|
||||
{
|
||||
String str = scope String();
|
||||
str.Append("[");
|
||||
str.Append(' ', cProgressSize);
|
||||
str.Append("]");
|
||||
str.Append('\b', cProgressSize + 1);
|
||||
Console.Write(str);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void WriteProgress(float pct)
|
||||
{
|
||||
if (mVerbosity >= .Normal)
|
||||
{
|
||||
int progressIdx = (int)Math.Round(pct * cProgressSize);
|
||||
while (progressIdx > mProgressIdx)
|
||||
{
|
||||
mProgressIdx++;
|
||||
Console.Write("*");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
protected override void BeefCompileDone()
|
||||
{
|
||||
base.BeefCompileDone();
|
||||
WriteProgress(1.0f);
|
||||
Console.WriteLine("");
|
||||
}
|
||||
|
||||
public override void LoadFailed()
|
||||
{
|
||||
mFailed = true;
|
||||
}
|
||||
|
||||
public override void TestFailed()
|
||||
{
|
||||
mFailed = true;
|
||||
}
|
||||
|
||||
protected override void CompileFailed()
|
||||
{
|
||||
base.CompileFailed();
|
||||
mFailed = true;
|
||||
}
|
||||
|
||||
protected override void CompileDone(bool succeeded)
|
||||
{
|
||||
if (!succeeded)
|
||||
mFailed = true;
|
||||
}
|
||||
|
||||
public override void Update(bool batchStart)
|
||||
{
|
||||
base.Update(batchStart);
|
||||
|
||||
if (mCompilingBeef)
|
||||
{
|
||||
WriteProgress(mBfBuildCompiler.GetCompletionPercentage());
|
||||
}
|
||||
|
||||
if ((!IsCompiling) && (!AreTestsRunning()))
|
||||
{
|
||||
Stop();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
147
BeefBuild/src/Program.bf
Normal file
147
BeefBuild/src/Program.bf
Normal file
|
@ -0,0 +1,147 @@
|
|||
using System;
|
||||
using IDE.Util;
|
||||
using System.Diagnostics;
|
||||
|
||||
namespace BeefBuild
|
||||
{
|
||||
class Program
|
||||
{
|
||||
static void TestZip()
|
||||
{
|
||||
String str = "Good morning Dr. Chandra. This is Hal. I am ready for my first lesson.Good morning Dr. Chandra. This is Hal. I am ready for my first lesson.Good morning Dr. Chandra. This is Hal. I am ready for my first lesson.Good morning Dr. Chandra. This is Hal. I am ready for my first lesson.Good morning Dr. Chandra. This is Hal. I am ready for my first lesson.Good morning Dr. Chandra. This is Hal. I am ready for my first lesson.Good morning Dr. Chandra. This is Hal. I am ready for my first lesson.";
|
||||
int src_len = str.Length;
|
||||
int uncomp_len = (uint32)src_len;
|
||||
int cmp_len = MiniZ.CompressBound(src_len);
|
||||
|
||||
var pCmp = new uint8[cmp_len]*;
|
||||
#unwarn
|
||||
var pUncomp = new uint8[src_len]*;
|
||||
|
||||
#unwarn
|
||||
//var cmp_status = MiniZ.compress(pCmp, ref cmp_len, (uint8*)(char8*)str, src_len);
|
||||
|
||||
var cmp_status = MiniZ.Compress(pCmp, ref cmp_len, (uint8*)(char8*)str, src_len, .BEST_COMPRESSION);
|
||||
|
||||
cmp_status = MiniZ.Uncompress(pUncomp, ref uncomp_len, pCmp, cmp_len);
|
||||
}
|
||||
|
||||
static void TestZip2()
|
||||
{
|
||||
MiniZ.ZipArchive zipArchive = default;
|
||||
|
||||
if (!MiniZ.ZipReaderInitFile(&zipArchive, "c:\\temp\\zip\\test.zip", default))
|
||||
return;
|
||||
|
||||
for (int32 i = 0; i < (int)MiniZ.ZipReaderGetNumFiles(&zipArchive); i++)
|
||||
{
|
||||
MiniZ.ZipArchiveFileStat file_stat;
|
||||
if (!MiniZ.ZipReaderFileStat(&zipArchive, i, &file_stat))
|
||||
{
|
||||
MiniZ.ZipReaderEnd(&zipArchive);
|
||||
return;
|
||||
}
|
||||
|
||||
//printf("Filename: \"%s\", Comment: \"%s\", Uncompressed size: %u, Compressed size: %u, Is Dir: %u\n", file_stat.m_filename, file_stat.m_comment,
|
||||
//(uint)file_stat.m_uncomp_size, (uint)file_stat.m_comp_size, mz_zip_reader_is_file_a_directory(&zipArchive, i));
|
||||
|
||||
/*if (!strcmp(file_stat.m_filename, "directory/"))
|
||||
{
|
||||
if (!mz_zip_reader_is_file_a_directory(&zipArchive, i))
|
||||
{
|
||||
printf("mz_zip_reader_is_file_a_directory() didn't return the expected results!\n");
|
||||
mz_zip_reader_end(&zipArchive);
|
||||
}
|
||||
}*/
|
||||
|
||||
var str = scope String();
|
||||
str.AppendF("c:\\temp\\file.{0}", i);
|
||||
MiniZ.ZipReaderExtractToFile(&zipArchive, i, str, default);
|
||||
}
|
||||
|
||||
// Close the archive, freeing any resources it was using
|
||||
MiniZ.ZipReaderEnd(&zipArchive);
|
||||
}
|
||||
|
||||
/*[StdCall]
|
||||
static int32 fetch_progress(Git.git_transfer_progress* stats, void* payload)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
[StdCall]
|
||||
static void checkout_progress(char8* path, int cur, int tot, void* payload)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
static void TestGit()
|
||||
{
|
||||
Git.git_libgit2_init();
|
||||
Git.git_repository* repo = null;
|
||||
|
||||
|
||||
Git.git_clone_options cloneOptions = default;
|
||||
cloneOptions.version = 1;
|
||||
cloneOptions.checkout_opts.version = 1;
|
||||
cloneOptions.checkout_opts.checkout_strategy = 1;
|
||||
//cloneOptions.checkout_opts.perfdata_cb = => checkout_progress;
|
||||
cloneOptions.checkout_opts.progress_cb = => checkout_progress;
|
||||
cloneOptions.fetch_opts.version = 1;
|
||||
cloneOptions.fetch_opts.callbacks.version = 1;
|
||||
cloneOptions.fetch_opts.update_fetchhead = 1;
|
||||
cloneOptions.fetch_opts.proxy_opts.version = 1;
|
||||
cloneOptions.fetch_opts.callbacks.transfer_progress = => fetch_progress;
|
||||
//cloneOptions.
|
||||
|
||||
var result = Git.git_clone(&repo, "https://github.com/ponylang/pony-stable.git", "c:/temp/pony-stable", &cloneOptions);
|
||||
Git.git_repository_free(repo);
|
||||
Git.git_libgit2_shutdown();
|
||||
}*/
|
||||
|
||||
public static int32 Main(String[] args)
|
||||
{
|
||||
//TestGit();
|
||||
|
||||
for (let arg in args)
|
||||
{
|
||||
if (arg != "-help")
|
||||
continue;
|
||||
Console.WriteLine(
|
||||
"""
|
||||
BeefBuild [args]
|
||||
If no arguments are specified, a build will occur using current working directory as the workspace.
|
||||
-config=<config> Sets the config (defaults to Debug)
|
||||
-minidump=<path> Opens windows minidup file
|
||||
-new Creates a new workspace and project
|
||||
-platform=<platform> Sets the platform (defaults to system platform)
|
||||
-test=<path> Executes test script
|
||||
-verbosity=<verbosity> Set verbosity level to: quiet/minimal/normal/detailed/diagnostics
|
||||
-workspace=<path> Sets workspace path (defaults to current working directory)
|
||||
""");
|
||||
return 0;
|
||||
}
|
||||
|
||||
//TestZip2();
|
||||
String commandLine = scope String();
|
||||
commandLine.Join(" ", params args);
|
||||
|
||||
BuildApp mApp = new BuildApp();
|
||||
mApp.ParseCommandLine(commandLine);
|
||||
if (mApp.mFailed)
|
||||
{
|
||||
Console.Error.WriteLine(" Run with \"-help\" for a list of command-line arguments");
|
||||
}
|
||||
else
|
||||
{
|
||||
mApp.Init();
|
||||
mApp.Run();
|
||||
}
|
||||
mApp.Shutdown();
|
||||
int32 result = mApp.mFailed ? 1 : 0;
|
||||
|
||||
delete mApp;
|
||||
|
||||
return result;
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue