2020-12-21 11:50:46 -04:00
|
|
|
// Copyright Epic Games, Inc. All Rights Reserved.
|
|
|
|
|
|
|
|
|
|
using System;
|
|
|
|
|
|
2020-12-21 23:07:37 -04:00
|
|
|
namespace EpicGames.Core
|
2020-12-21 11:50:46 -04:00
|
|
|
{
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Attribute to indicate the name of a command line argument
|
|
|
|
|
/// </summary>
|
2022-01-06 09:05:06 -05:00
|
|
|
[AttributeUsage(AttributeTargets.Field | AttributeTargets.Property, AllowMultiple = true)]
|
2020-12-21 11:50:46 -04:00
|
|
|
public class CommandLineAttribute : Attribute
|
|
|
|
|
{
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Prefix for the option, with a leading '-' and trailing '=' character if a value is expected.
|
|
|
|
|
/// </summary>
|
2022-03-24 16:35:00 -04:00
|
|
|
public string? Prefix { get; set; }
|
2020-12-21 11:50:46 -04:00
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Specifies a fixed value for this argument. Specifying an alternate value is not permitted.
|
|
|
|
|
/// </summary>
|
2022-03-24 16:35:00 -04:00
|
|
|
public string? Value { get; set; } = null;
|
2020-12-21 11:50:46 -04:00
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Whether this argument is required
|
|
|
|
|
/// </summary>
|
2022-03-24 16:35:00 -04:00
|
|
|
public bool Required { get; set; }
|
2020-12-21 11:50:46 -04:00
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// For collection types, specifies the separator character between multiple arguments
|
|
|
|
|
/// </summary>
|
2022-03-24 16:35:00 -04:00
|
|
|
public char ListSeparator { get; set; } = '\0';
|
2020-12-21 11:50:46 -04:00
|
|
|
|
UnrealBuildTool:
Add a -Help option that prints descriptions of global options.
(Tool mode options are not available - support for those may be added in a future CL)
Example output:
Global options:
-Help : Display this help.
-Verbose : Increase output verbosity
-VeryVerbose : Increase output verbosity more
-Log : Specify a log file location instead of the default Engine/Programs/UnrealBuildTool/Log.txt
-Timestamps : Include timestamps in the log
-FromMsBuild : Format messages for msbuild
-Progress : Write progress messages in a format that can be parsed by other programs
-NoMutex : Allow more than one instance of the program to run at once
-WaitMutex : Wait for another instance to finish and then start, rather than aborting immediately
-RemoteIni : Remote tool ini directory
-Mode= : Select tool mode. One of the following (default tool mode is "Build"):
AggregateParsedTimingInfo, Build, Clean, Deploy, Execute, GenerateClangDatabase, GenerateProjectFiles,
IOSPostBuildSync, JsonExport, ParseMsvcTimingInfo, PVSGather, QueryTargets, SetupPlatforms,
ValidatePlatforms, WriteDocumentation, WriteMetadata
-Clean : Clean build products. Equivalent to -Mode=Clean
-ProjectFiles : Generate project files based on IDE preference. Equivalent to -Mode=GenerateProjectFiles
-ProjectFileFormat= : Generate project files in specified format. May be used multiple times.
-Makefile : Generate Linux Makefile
-CMakefile : Generate project files for CMake
-QMakefile : Generate project files for QMake
-KDevelopfile : Generate project files for KDevelop
-CodeliteFiles : Generate project files for Codelite
-XCodeProjectFiles : Generate project files for XCode
-EddieProjectFiles : Generate project files for Eddie
-VSCode : Generate project files for Visual Studio Code
-VSMac : Generate project files for Visual Studio Mac
-CLion : Generate project files for CLion
-Rider : Generate project files for Rider
#jira none
[CL 17018675 by jonathan adamczewski in ue5-main branch]
2021-08-02 14:45:39 -04:00
|
|
|
/// <summary>
|
|
|
|
|
/// Description of the operation.
|
|
|
|
|
/// </summary>
|
2022-03-24 16:35:00 -04:00
|
|
|
public string? Description { get; set; }
|
UnrealBuildTool:
Add a -Help option that prints descriptions of global options.
(Tool mode options are not available - support for those may be added in a future CL)
Example output:
Global options:
-Help : Display this help.
-Verbose : Increase output verbosity
-VeryVerbose : Increase output verbosity more
-Log : Specify a log file location instead of the default Engine/Programs/UnrealBuildTool/Log.txt
-Timestamps : Include timestamps in the log
-FromMsBuild : Format messages for msbuild
-Progress : Write progress messages in a format that can be parsed by other programs
-NoMutex : Allow more than one instance of the program to run at once
-WaitMutex : Wait for another instance to finish and then start, rather than aborting immediately
-RemoteIni : Remote tool ini directory
-Mode= : Select tool mode. One of the following (default tool mode is "Build"):
AggregateParsedTimingInfo, Build, Clean, Deploy, Execute, GenerateClangDatabase, GenerateProjectFiles,
IOSPostBuildSync, JsonExport, ParseMsvcTimingInfo, PVSGather, QueryTargets, SetupPlatforms,
ValidatePlatforms, WriteDocumentation, WriteMetadata
-Clean : Clean build products. Equivalent to -Mode=Clean
-ProjectFiles : Generate project files based on IDE preference. Equivalent to -Mode=GenerateProjectFiles
-ProjectFileFormat= : Generate project files in specified format. May be used multiple times.
-Makefile : Generate Linux Makefile
-CMakefile : Generate project files for CMake
-QMakefile : Generate project files for QMake
-KDevelopfile : Generate project files for KDevelop
-CodeliteFiles : Generate project files for Codelite
-XCodeProjectFiles : Generate project files for XCode
-EddieProjectFiles : Generate project files for Eddie
-VSCode : Generate project files for Visual Studio Code
-VSMac : Generate project files for Visual Studio Mac
-CLion : Generate project files for CLion
-Rider : Generate project files for Rider
#jira none
[CL 17018675 by jonathan adamczewski in ue5-main branch]
2021-08-02 14:45:39 -04:00
|
|
|
|
2020-12-21 11:50:46 -04:00
|
|
|
/// <summary>
|
|
|
|
|
/// Constructor
|
|
|
|
|
/// </summary>
|
2022-03-24 16:35:00 -04:00
|
|
|
/// <param name="prefix">Prefix for this argument</param>
|
|
|
|
|
public CommandLineAttribute(string? prefix = null)
|
2020-12-21 11:50:46 -04:00
|
|
|
{
|
2022-03-24 16:35:00 -04:00
|
|
|
Prefix = prefix;
|
2020-12-21 11:50:46 -04:00
|
|
|
|
2022-03-24 16:35:00 -04:00
|
|
|
if(prefix != null)
|
2020-12-21 11:50:46 -04:00
|
|
|
{
|
2022-03-24 16:35:00 -04:00
|
|
|
if(!prefix.StartsWith("-"))
|
2020-12-21 11:50:46 -04:00
|
|
|
{
|
|
|
|
|
throw new Exception("Command-line arguments must begin with a '-' character");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|