1
0
Fork 0
mirror of https://github.com/beefytech/Beef.git synced 2025-06-10 12:32:20 +02:00

Added -generate option

This commit is contained in:
Brian Fiete 2020-01-12 09:20:35 -08:00
parent 3e0a507cf7
commit aa0277485f
2 changed files with 25 additions and 6 deletions

View file

@ -15,6 +15,7 @@ namespace BeefBuild
public bool mIsTest;
public bool mTestIncludeIgnored;
public bool mDidRun;
public bool mWantsGenerate = false;
/*void Test()
{
@ -101,12 +102,26 @@ namespace BeefBuild
WorkspaceLoaded();
if (mIsTest)
if (mWantsGenerate)
{
RunTests(mTestIncludeIgnored, false);
if (mWorkspace.mStartupProject != null)
{
if (mWorkspace.mStartupProject.IsEmpty)
AutoGenerateStartupCode(mWorkspace.mStartupProject);
else
OutputErrorLine("The project '{}' is not empty, but '-generate' was specified.", mWorkspace.mStartupProject.mProjectName);
}
}
if (!mFailed)
{
if (mIsTest)
{
RunTests(mTestIncludeIgnored, false);
}
else if (mVerb != .New)
Compile(.Normal, null);
}
else if (mVerb != .New)
Compile(.Normal, null);
}
public override bool HandleCommandLineParam(String key, String value)
@ -121,6 +136,9 @@ namespace BeefBuild
case "-new":
mVerb = .New;
return true;
case "-generate":
mWantsGenerate = true;
return true;
case "-run":
if (mVerbosity == .Default)
mVerbosity = .Minimal;
@ -268,7 +286,7 @@ namespace BeefBuild
if ((!IsCompiling) && (!AreTestsRunning()))
{
if ((mVerb == .Run) && (!mDidRun))
if ((mVerb == .Run) && (!mDidRun) && (!mFailed))
{
let curPath = scope String();
Directory.GetCurrentDirectory(curPath);

View file

@ -17,12 +17,13 @@ namespace BeefBuild
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)
-generate Generates startup code for an empty project
-new Creates a new workspace and project
-platform=<platform> Sets the platform (defaults to system platform)
-run Compile and run the startup project in the workspace
-test=<path> Executes test script
-verbosity=<verbosity> Set verbosity level to: quiet/minimal/normal/detailed/diagnostic
-version Get version
-version Get version
-workspace=<path> Sets workspace path (defaults to current working directory)
""");
return 0;