Skip to content
Snippets Groups Projects
Commit dbfe4cde authored by Ming Rui Zhang's avatar Ming Rui Zhang
Browse files

build: make-client.py clean up

Change-Id: Id225f4ec79b7e502941e11f68a3b8a241cbc472a
parent 374670af
No related branches found
No related tags found
No related merge requests found
...@@ -20,19 +20,18 @@ vs_where_path = os.path.join( ...@@ -20,19 +20,18 @@ vs_where_path = os.path.join(
host_is_64bit = (False, True)[platform.machine().endswith('64')] host_is_64bit = (False, True)[platform.machine().endswith('64')]
this_dir = os.path.dirname(os.path.realpath(__file__)) this_dir = os.path.dirname(os.path.realpath(__file__))
build_dir = this_dir + '\\build' build_dir = os.path.join(this_dir, 'build')
temp_path = os.environ['TEMP'] temp_path = os.environ['TEMP']
# project path # project path
jami_qt_project = build_dir + '\\jami-qt.vcxproj' jami_qt_project = os.path.join(build_dir, 'jami-qt.vcxproj')
unit_test_project = build_dir + '\\tests\\unittests.vcxproj' unit_test_project = os.path.join(build_dir, 'tests', 'unittests.vcxproj')
qml_test_project = build_dir + '\\tests\\qml_tests.vcxproj' qml_test_project = os.path.join(build_dir, 'tests', 'qml_tests.vcxproj')
# test executable command # test executable command
qml_test_exe = this_dir + '\\x64\\test\\qml_tests.exe -input ' + this_dir + '\\tests\\qml' qml_test_exe = os.path.join(this_dir, 'x64', 'test', 'qml_tests.exe -input ') + \
unit_test_exe = this_dir + '\\x64\\test\\unittests.exe' os.path.join(this_dir, 'tests', 'qml')
unit_test_exe = os.path.join(this_dir, 'x64', 'test', 'unittests.exe')
windows_font_dir = 'C:\\Windows\\Fonts'
class TestBuilding(Enum): class TestBuilding(Enum):
NoTests = 0 NoTests = 0
...@@ -182,7 +181,8 @@ def deps(arch, toolset, qtver): ...@@ -182,7 +181,8 @@ def deps(arch, toolset, qtver):
if (execute_cmd("git clone https://github.com/BlueDragon747/qrencode-win32.git", True)): if (execute_cmd("git clone https://github.com/BlueDragon747/qrencode-win32.git", True)):
print("Git clone failed when cloning from https://github.com/BlueDragon747/qrencode-win32.git") print("Git clone failed when cloning from https://github.com/BlueDragon747/qrencode-win32.git")
sys.exit(1) sys.exit(1)
if(execute_cmd("cd qrencode-win32 && git checkout d6495a2aa74d058d54ae0f1b9e9e545698de66ce && " + apply_cmd + ' ..\\qrencode-win32.patch', True)): if(execute_cmd("cd qrencode-win32 && git checkout d6495a2aa74d058d54ae0f1b9e9e545698de66ce && "
+ apply_cmd + os.path.join(' ..', 'qrencode-win32.patch'), True)):
print("qrencode-win32 set up error") print("qrencode-win32 set up error")
sys.exit(1) sys.exit(1)
...@@ -197,7 +197,8 @@ def deps(arch, toolset, qtver): ...@@ -197,7 +197,8 @@ def deps(arch, toolset, qtver):
msbuild_args = getMSBuildArgs(arch, 'Release-Lib', toolset) msbuild_args = getMSBuildArgs(arch, 'Release-Lib', toolset)
this_dir = os.path.dirname(os.path.realpath(__file__)) this_dir = os.path.dirname(os.path.realpath(__file__))
proj_path = this_dir + '\\qrencode-win32\\qrencode-win32\\vc8\\qrcodelib\\qrcodelib.vcxproj' proj_path = os.path.join(this_dir, 'qrencode-win32' ,'qrencode-win32',
'vc8', 'qrcodelib', 'qrcodelib.vcxproj')
build_project(msbuild, msbuild_args, proj_path, vs_env_vars) build_project(msbuild, msbuild_args, proj_path, vs_env_vars)
...@@ -211,14 +212,12 @@ def build(arch, toolset, sdk_version, config_str, project_path_under_current_pat ...@@ -211,14 +212,12 @@ def build(arch, toolset, sdk_version, config_str, project_path_under_current_pat
vs_env_vars = {} vs_env_vars = {}
vs_env_vars.update(getVSEnv()) vs_env_vars.update(getVSEnv())
qt_dir = 'C:\\Qt\\' + qtver qt_dir = os.path.join("C:\\", 'Qt', qtver)
cmake_gen = getCMakeGenerator(getLatestVSVersion()) cmake_gen = getCMakeGenerator(getLatestVSVersion())
qt_minor_version = getQtVersionNumber(qtver, QtVerison.Minor) msvc_folder = 'msvc2019_64'
msvc_folder = '\\msvc2017_64' if int(qt_minor_version) <= 14 else '\\msvc2019_64'
qt_cmake_dir = qt_dir + msvc_folder + '\\lib\\cmake\\'
cmake_prefix_path = qt_dir + msvc_folder
qt_cmake_dir = os.path.join(qt_dir, msvc_folder, 'lib', 'cmake')
cmake_prefix_path = os.path.join(qt_dir, msvc_folder)
cmake_options = [ cmake_options = [
'-DCMAKE_PREFIX_PATH=' + cmake_prefix_path, '-DCMAKE_PREFIX_PATH=' + cmake_prefix_path,
'-DQt5_DIR=' + qt_cmake_dir + 'Qt5', '-DQt5_DIR=' + qt_cmake_dir + 'Qt5',
...@@ -308,8 +307,8 @@ def run_tests(mute_jamid, output_to_files): ...@@ -308,8 +307,8 @@ def run_tests(mute_jamid, output_to_files):
test_exe_command_list[0] += ' -mutejamid' test_exe_command_list[0] += ' -mutejamid'
test_exe_command_list[1] += ' -mutejamid' test_exe_command_list[1] += ' -mutejamid'
if output_to_files: if output_to_files:
test_exe_command_list[0] += ' -o ' + this_dir + '\\x64\\test\\qml_tests.txt' test_exe_command_list[0] += ' -o ' + os.path.join(this_dir, 'x64', 'test', 'qml_tests.txt')
test_exe_command_list[1] += ' > ' + this_dir + '\\x64\\test\\unittests.txt' test_exe_command_list[1] += ' > ' + os.path.join(this_dir, 'x64', 'test', 'unittests.txt')
test_result_code = 0 test_result_code = 0
...@@ -317,9 +316,6 @@ def run_tests(mute_jamid, output_to_files): ...@@ -317,9 +316,6 @@ def run_tests(mute_jamid, output_to_files):
os.environ["QT_QPA_PLATFORM"] = 'offscreen' os.environ["QT_QPA_PLATFORM"] = 'offscreen'
os.environ["QT_QUICK_BACKEND"] = 'software' os.environ["QT_QUICK_BACKEND"] = 'software'
# provide font dir
os.environ["QT_QPA_FONTDIR"] = windows_font_dir
for test_exe_command in test_exe_command_list: for test_exe_command in test_exe_command_list:
if (execute_cmd(test_exe_command, True)): if (execute_cmd(test_exe_command, True)):
test_result_code = 1 test_result_code = 1
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment