This repository has been archived by the owner on Feb 22, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 7
/
packager.py
96 lines (76 loc) · 3.8 KB
/
packager.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
import configargparse
import configparser
import sys
import globals
import platform
import configuration
import action
import pathresolver
import platformregionhelper
import defineshelper
import functioncaller
import configurationoverride
import helpers
import host
parser = configargparse.ArgParser( ignore_unknown_config_file_keys=True )
parser.add( 'actions', action="store" )
parser.add( 'platform', action="store" )
parser.add( 'configuration', action="store", choices=[ "Development", "Debug", "Shipping" ] )
parser.add( '-c', '--config', required=True, is_config_file=True, help='config file path')
parser.add( '--stub', action="store_true", dest="stub" )
parser.add( "--ue_root_folder", action="store", dest="ue_root_folder", default="" )
parser.add( "--project_dir", action="store", dest="project_dir", default="" )
parser.add( "--project_name", action="store", dest="project_name", default="" )
parser.add( "--archive_directory_root", action="store", dest="archive_directory_root", default="" )
parser.add( "--region", action="store", dest="region", default="" )
parser.add( "--backup_version", action="store_true", dest="backup_version" )
parser.add( "--no_backup_version", action="store_true", dest="no_backup_version", help='Force disable backup. Useful if you enabled backup in the config.ini but want to disable it locally' )
parser.add( "--backup_directory_root", action="store", dest="backup_directory_root", default="" )
parser.add( "--version_number", action="store", dest="version_number", default="" )
parser.add( "--base_version_number", action="store", dest="base_version_number", default="" )
parser.add( "--dlc_name", action="store", dest="dlc_name", default="" )
parser.add( "--compile_automation_scripts", action="store_true", dest="compile_automation_scripts" )
parser.add( "--no_compile_game_editor", action="store_true", dest="no_compile_game_editor" )
parser.add( "--no_iterative_cooking", action="store_true", dest="no_iterative_cooking" )
parser.add( "--custom_folder", action="store", dest="custom_folder" )
parser.add( "--build_option", action="store", dest="build_option" )
parser.add( "--deploy", action="store_true", dest="deploy" )
parser.add( "--deploy_device", action="store", dest="deploy_device" )
args = parser.parse_args()
globals.STUB = args.stub
if globals.STUB:
print()
print( "******************" )
print( "***** STUB *****" )
print( "******************" )
print()
config = configparser.ConfigParser()
config.read( args.config )
host = host.HostFactory.CreateHost()
configuration_override = configurationoverride.ConfigurationOverride( args, config )
function_caller = functioncaller.FunctionCaller( args )
function_caller.CallCustomInitialize( args, config )
defines_helper = defineshelper.DefinesHelper( config, args )
if args.no_backup_version:
args.backup_version = False
helpers.PrintIsolatedMessage( "Force NO Backup" )
try:
platform_region_helper = platformregionhelper.PlatformRegionHelper( config, args )
path_resolver = pathresolver.PathResolver( args, host )
platform = platform.PlatformFactory.CreatePlatform( args.platform, platform_region_helper, host )
configuration = configuration.ConfigurationFactory.CreateConfiguration( args.configuration )
configuration.ValidateParameters( args )
action = action.Action( args.actions, platform, configuration, path_resolver, defines_helper, args, host )
action.ValidateParameters()
except Exception as e:
helpers.PrintErrorAndQuit( str( e ) )
exit_code = 0
try:
platform.PreExecute( args, path_resolver )
function_caller.CallCustomPreExecute( args, path_resolver )
exit_code = action.Execute()
platform.PostExecute( args, path_resolver )
function_caller.CallCustomPostExecute( args, path_resolver )
except Exception as e:
helpers.PrintError( str( e ) )
sys.exit( exit_code )