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.

71 lines
1.9 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
statusBefore = utility.captureCommandOutput( "git submodule status" )
print( statusBefore )
4 years ago
4 years ago
utility.runCommand( "git submodule update --init --remote --recursive" )
utility.runCommand( "git submodule foreach --recursive 'git fetch --tags'" )
4 years ago
if config.productCheckout:
os.chdir( config.productRepoPath )
utility.runCommand( "git checkout " + config.productCheckout )
os.chdir( config.toplevelPath )
4 years ago
statusAfter = utility.captureCommandOutput( "git submodule status" )
4 years ago
print( statusAfter )
4 years ago
if statusBefore != statusAfter:
4 years ago
utility.printHeading( "Updating product version..." )
4 years ago
config.updateProductVersion()
4 years ago
4 years ago
utility.printSuccess( "Git submodules are now up to date." )
4 years ago
def configureEnvironment():
4 years ago
4 years ago
utility.printHeading( "Configuring environment..." )
4 years ago
4 years ago
for name, value in config.propertyList().items():
4 years ago
4 years ago
if value:
print( "\tSetting: ${" + utility.style.bold + name + utility.style.none + "}" )
os.environ[ name ] = value
else:
print( "\tUnused: " + utility.style.error + name + utility.style.none )
4 years ago
4 years ago
utility.printSuccess( "Build environment variables are now set." )
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",
4 years ago
"Windows" : "Scripts\\Build\\BuildWindows.cmd",
4 years ago
}
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
utility.printSuccess( "Build completed successfully." )
4 years ago
configureSubmodules()
4 years ago
# configureEnvironment()
# buildProducts()