You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

58 lines
1.3 KiB

#!/usr/bin/env python3
4 years ago
import os, platform, sys
assert sys.version_info >= ( 3, 8 )
4 years ago
from Detail.Config import config
import Detail.Utility as utility
4 years ago
def configureSubmodules():
4 years ago
utility.printHeading( "Updating Git submodules..." )
4 years ago
4 years ago
os.chdir( config.toplevelPath )
4 years ago
4 years ago
status = utility.captureCommandOutput( "git submodule status" )
print( status )
4 years ago
utility.runCommand( "git submodule update --init --remote --recursive" )
4 years ago
4 years ago
if status != utility.captureCommandOutput( "git submodule status" ):
config.updateProductVersion()
4 years ago
4 years ago
def configureEnvironment():
4 years ago
4 years ago
utility.printHeading( "Configuring environment..." )
4 years ago
4 years ago
variables = config.variableList()
4 years ago
4 years ago
variables[ "isConfigured" ] = "1"
4 years ago
4 years ago
for name, value in variables.items():
4 years ago
4 years ago
print( "\tSetting ${" + utility.style.bold + name + utility.style.none + "}" )
4 years ago
4 years ago
os.environ[ name ] = value
4 years ago
4 years ago
def buildProducts():
4 years ago
4 years ago
utility.printHeading( "Building products..." )
4 years ago
4 years ago
scripts = {
"Darwin" : "Scripts/Build/BuildDarwin.sh",
"Linux" : "Scripts/Build/BuildLinux.sh",
"Windows" : "Scripts/Build/BuildWindows.cmd",
}
4 years ago
4 years ago
scriptPath = utility.joinPath( config.toplevelPath, scripts[ platform.system() ] )
4 years ago
4 years ago
utility.runCommand( '"' + scriptPath + '"' )
4 years ago
4 years ago
configureSubmodules()
4 years ago
4 years ago
configureEnvironment()
4 years ago
# buildProducts()