mirror of
https://github.com/beefytech/Beef.git
synced 2025-06-11 04:52:21 +02:00
Added -generate option
This commit is contained in:
parent
3e0a507cf7
commit
aa0277485f
2 changed files with 25 additions and 6 deletions
|
@ -15,6 +15,7 @@ namespace BeefBuild
|
||||||
public bool mIsTest;
|
public bool mIsTest;
|
||||||
public bool mTestIncludeIgnored;
|
public bool mTestIncludeIgnored;
|
||||||
public bool mDidRun;
|
public bool mDidRun;
|
||||||
|
public bool mWantsGenerate = false;
|
||||||
|
|
||||||
/*void Test()
|
/*void Test()
|
||||||
{
|
{
|
||||||
|
@ -101,12 +102,26 @@ namespace BeefBuild
|
||||||
|
|
||||||
WorkspaceLoaded();
|
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)
|
public override bool HandleCommandLineParam(String key, String value)
|
||||||
|
@ -121,6 +136,9 @@ namespace BeefBuild
|
||||||
case "-new":
|
case "-new":
|
||||||
mVerb = .New;
|
mVerb = .New;
|
||||||
return true;
|
return true;
|
||||||
|
case "-generate":
|
||||||
|
mWantsGenerate = true;
|
||||||
|
return true;
|
||||||
case "-run":
|
case "-run":
|
||||||
if (mVerbosity == .Default)
|
if (mVerbosity == .Default)
|
||||||
mVerbosity = .Minimal;
|
mVerbosity = .Minimal;
|
||||||
|
@ -268,7 +286,7 @@ namespace BeefBuild
|
||||||
|
|
||||||
if ((!IsCompiling) && (!AreTestsRunning()))
|
if ((!IsCompiling) && (!AreTestsRunning()))
|
||||||
{
|
{
|
||||||
if ((mVerb == .Run) && (!mDidRun))
|
if ((mVerb == .Run) && (!mDidRun) && (!mFailed))
|
||||||
{
|
{
|
||||||
let curPath = scope String();
|
let curPath = scope String();
|
||||||
Directory.GetCurrentDirectory(curPath);
|
Directory.GetCurrentDirectory(curPath);
|
||||||
|
|
|
@ -17,12 +17,13 @@ namespace BeefBuild
|
||||||
BeefBuild [args]
|
BeefBuild [args]
|
||||||
If no arguments are specified, a build will occur using current working directory as the workspace.
|
If no arguments are specified, a build will occur using current working directory as the workspace.
|
||||||
-config=<config> Sets the config (defaults to Debug)
|
-config=<config> Sets the config (defaults to Debug)
|
||||||
|
-generate Generates startup code for an empty project
|
||||||
-new Creates a new workspace and project
|
-new Creates a new workspace and project
|
||||||
-platform=<platform> Sets the platform (defaults to system platform)
|
-platform=<platform> Sets the platform (defaults to system platform)
|
||||||
-run Compile and run the startup project in the workspace
|
-run Compile and run the startup project in the workspace
|
||||||
-test=<path> Executes test script
|
-test=<path> Executes test script
|
||||||
-verbosity=<verbosity> Set verbosity level to: quiet/minimal/normal/detailed/diagnostic
|
-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)
|
-workspace=<path> Sets workspace path (defaults to current working directory)
|
||||||
""");
|
""");
|
||||||
return 0;
|
return 0;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue