(self, dir=os.getcwd(), configuration='Shipping', extraArgs=[])
Packages a build of the Unreal project in the specified directory, using common packaging options
Packages a build of the Unreal project in the specified directory, using common packaging options
Packages a build of the Unreal project in the specified directory using common packaging options
def packageProject(self, dir=os.getcwd(), configuration='Shipping', extraArgs=[]):
		"""
		Packages a build of the Unreal project in the specified directory, using common packaging options
		"""
		
		# Verify that the specified build configuration is valid
		if configuration not in self.validBuildConfigurations():
			raise UnrealManagerException('invalid build configuration "' + configuration + '"')
		
		# Strip out the `-NoCompileEditor` flag if the user has specified it, since the Development version
		# of the Editor modules for the project are needed in order to run the commandlet that cooks content
		extraArgs = Utility.stripArgs(extraArgs, ['-nocompileeditor'])
		
		# Prevent the user from specifying multiple `-platform=` or `-targetplatform=` arguments,
		# and use the current host platform if no platform argument was explicitly specified
		platformArgs = Utility.findArgs(extraArgs, ['-platform=', '-targetplatform='])
		platform = Utility.getArgValue(platformArgs[0]) if len(platformArgs) > 0 else self.getPlatformIdentifier()
		extraArgs = Utility.stripArgs(extraArgs, platformArgs) + ['-platform={}'.format(platform)]
		
		# If we are building a dedicated server then ensure the server platform is set correctly
		serverArg = Utility.findArgs(extraArgs, ['-server'])
		serverPlatformArg = Utility.findArgs(extraArgs, ['-serverplatform=', '-servertargetplatform='])
		if len(serverArg) > 0 and len(serverPlatformArg) == 0:
			extraArgs.append('-serverplatform={}'.format(platform))
		
		# If we are packaging a Shipping build, do not include debug symbols
		if configuration == 'Shipping':
			extraArgs.append('-nodebuginfo')
		
		# Define the usage of pak files, default value is pak files for all platforms except HTML5
		pakArg = Utility.findArgs(extraArgs, ['-pak', '-package'])
		if len(pakArg) == 0:
			pakArg = '-package' if platform.upper() == 'HTML5' else '-pak'
		else:
			pakArg = ''
		
		# Include the `-allmaps` flag if we are building a client target and haven't specified a list of maps
		buildingClient = (len(Utility.findArgs(extraArgs, ['-noclient'])) == 0)
		specifiedMaps = (len(Utility.findArgs(extraArgs, ['-MapsToCook', '-MapIniSectionsToCook'])) > 0)
		if buildingClient == True and specifiedMaps == False:
			extraArgs.append('-allmaps')
		
		# Automatically set the archive directory if the user has not explicitly specified one
		if (len(Utility.findArgs(extraArgs, ['-archivedirectory='])) == 0):
			extraArgs.extend(['-archivedirectory=' + os.path.join(os.path.abspath(dir), 'dist')])
		
		# Invoke UAT to package the build
		self.runUAT([
			'BuildCookRun'
			] + extraArgs + [
			'-utf8output',
			'-clientconfig=' + configuration,
			'-serverconfig=' + configuration,
			'-project=' + self.getProjectDescriptor(dir),
			'-noP4',
			'-cook',
			'-build',
			'-stage',
			'-prereqs',
			pakArg,
			'-archive'
		])
def packageProject ( self , dir = os . getcwd ( ) , configuration = 'Shipping' , extraArgs = [ ] ) : # Verify that the specified build configuration is valid if configuration not in self . validBuildConfigurations ( ) : raise UnrealManagerException ( 'invalid build configuration "' + configuration + '"' ) # Strip out the `-NoCompileEditor` flag if the user has specified it, since the Development version # of the Editor modules for the project are needed in order to run the commandlet that cooks content extraArgs = Utility . stripArgs ( extraArgs , [ '-nocompileeditor' ] ) # Prevent the user from specifying multiple `-platform=` or `-targetplatform=` arguments, # and use the current host platform if no platform argument was explicitly specified platformArgs = Utility . findArgs ( extraArgs , [ '-platform=' , '-targetplatform=' ] ) platform = Utility . getArgValue ( platformArgs [ 0 ] ) if len ( platformArgs ) > 0 else self . getPlatformIdentifier ( ) extraArgs = Utility . stripArgs ( extraArgs , platformArgs ) + [ '-platform={}' . format ( platform ) ] # If we are building a dedicated server then ensure the server platform is set correctly serverArg = Utility . findArgs ( extraArgs , [ '-server' ] ) serverPlatformArg = Utility . findArgs ( extraArgs , [ '-serverplatform=' , '-servertargetplatform=' ] ) if len ( serverArg ) > 0 and len ( serverPlatformArg ) == 0 : extraArgs . append ( '-serverplatform={}' . format ( platform ) ) # If we are packaging a Shipping build, do not include debug symbols if configuration == 'Shipping' : extraArgs . append ( '-nodebuginfo' ) # Define the usage of pak files, default value is pak files for all platforms except HTML5 pakArg = Utility . findArgs ( extraArgs , [ '-pak' , '-package' ] ) if len ( pakArg ) == 0 : pakArg = '-package' if platform . upper ( ) == 'HTML5' else '-pak' else : pakArg = '' # Include the `-allmaps` flag if we are building a client target and haven't specified a list of maps buildingClient = ( len ( Utility . findArgs ( extraArgs , [ '-noclient' ] ) ) == 0 ) specifiedMaps = ( len ( Utility . findArgs ( extraArgs , [ '-MapsToCook' , '-MapIniSectionsToCook' ] ) ) > 0 ) if buildingClient == True and specifiedMaps == False : extraArgs . append ( '-allmaps' ) # Automatically set the archive directory if the user has not explicitly specified one if ( len ( Utility . findArgs ( extraArgs , [ '-archivedirectory=' ] ) ) == 0 ) : extraArgs . extend ( [ '-archivedirectory=' + os . path . join ( os . path . abspath ( dir ) , 'dist' ) ] ) # Invoke UAT to package the build self . runUAT ( [ 'BuildCookRun' ] + extraArgs + [ '-utf8output' , '-clientconfig=' + configuration , '-serverconfig=' + configuration , '-project=' + self . getProjectDescriptor ( dir ) , '-noP4' , '-cook' , '-build' , '-stage' , '-prereqs' , pakArg , '-archive' ] )