This commit is contained in:
Bert van der Weerd 2021-06-08 15:40:10 +02:00
parent 312b272fd0
commit 1ef6478501
No known key found for this signature in database
GPG key ID: 4CFABB96ADE0F5B1

View file

@ -6,6 +6,7 @@
import optparse import optparse
import sys import sys
import os
parser = optparse.OptionParser() parser = optparse.OptionParser()
@ -16,6 +17,28 @@ parser.add_option('-t', '--distro', dest='distro', default='win')
options, remainder = parser.parse_args() options, remainder = parser.parse_args()
#print("[debug] ----------")
#print("[debug] --cross = ", options.cross_compile)
#print("[debug] --src = ", options.src)
#print("[debug] --distro = ", options.distro)
#print("[debug] ----------")
def enter_srcdir():
pass
def leave_srcdir():
pass
def exec(cmd):
# print command on stdout and sys.exit(1) on errors
pass
# Targets: # Targets:
@ -26,14 +49,22 @@ def execute_extract():
def execute_lw_do_patches(): def execute_lw_do_patches():
print("[debug] doing target -> lw_do_patches") print("[debug] doing target -> lw_do_patches")
def execute_build(): def execute_build():
print("[debug] doing target -> build") enter_srcdir()
cmd = "./mach build"
exec(cmd)
leave_srcdir()
def execute_lw_post_build(): def execute_lw_post_build():
print("[debug] doing target -> lw_post_build") print("[debug] doing target -> lw_post_build")
def execute_package(): def execute_package():
print("[debug] doing target -> package") enter_srcdir()
cmd = "./mach package"
exec(cmd)
leave_srcdir()
def execute_lw_artifacts(): def execute_lw_artifacts():
print("[debug] doing target -> lw_artifacts") print("[debug] doing target -> lw_artifacts")
# Main targets: # Main targets:
def execute_all(): def execute_all():
execute_fetch() execute_fetch()
@ -46,6 +77,10 @@ def execute_all():
def execute_clean(): def execute_clean():
print("[debug] doing target -> clean") print("[debug] doing target -> clean")
# Utilities: # Utilities:
def execute_git_subs(): def execute_git_subs():
print("[debug] doing target -> git_subs") print("[debug] doing target -> git_subs")
@ -81,12 +116,6 @@ if len(remainder)>0:
print("error: option --distro invalid value") print("error: option --distro invalid value")
sys.exit(1) sys.exit(1)
print("[debug] ----------")
print("[debug] --cross = ", options.cross_compile)
print("[debug] --src = ", options.src)
print("[debug] --distro = ", options.distro)
print("[debug] ----------")
for arg in remainder: for arg in remainder:
if arg == 'all': if arg == 'all':
execute_all() execute_all()