def cmake_report(projects: str, step: Step, _: Report):
    global build_dir
    cmake_result, build_dir, cmake_artifacts = run_cmake.run(
        projects, os.getcwd())
    for file in cmake_artifacts:
        if os.path.exists(file):
            shutil.copy2(file, artifacts_dir)
    step.set_status_from_exit_code(cmake_result)
Ejemplo n.º 2
0
def cmake_report(report: Report) -> CheckResult:
    global build_dir
    cmake_result, build_dir, cmake_artifacts = run_cmake.run(
        'detect', os.getcwd())
    for file in cmake_artifacts:
        if os.path.exists(file):
            shutil.copy2(file, artifacts_dir)
    return add_shell_result(report, 'cmake', cmake_result)
Ejemplo n.º 3
0
arguments = sys.argv[1:]

officialTarget = ''
officialTargetFile = scriptPath + '/build/target'
if os.path.isfile(officialTargetFile):
    with open(officialTargetFile, 'r') as f:
        for line in f:
            officialTarget = line.strip()

if officialTarget != '':
    officialApiIdFile = scriptPath + '/../../DesktopPrivate/custom_api_id.h'
    if not os.path.isfile(officialApiIdFile):
        print("[ERROR] DesktopPrivate/custom_api_id.h not found.")
        finish(1)
    with open(officialApiIdFile, 'r') as f:
        for line in f:
            apiIdMatch = re.search(r'ApiId\s+=\s+(\d+)', line)
            apiHashMatch = re.search(r'ApiHash\s+=\s+"([a-fA-F\d]+)"', line)
            if apiIdMatch:
                arguments.append('-DTDESKTOP_API_ID=' + apiIdMatch.group(1))
            elif apiHashMatch:
                arguments.append('-DTDESKTOP_API_HASH=' +
                                 apiHashMatch.group(1))
    finish(run_cmake.run(scriptName, arguments))
elif 'linux' in sys.platform:
    debugCode = run_cmake.run(scriptName, arguments, "Debug")
    finish(debugCode if debugCode else run_cmake.
           run(scriptName, arguments, "Release"))
else:
    finish(run_cmake.run(scriptName, arguments))
Ejemplo n.º 4
0
def error(message):
    print('[ERROR] ' + message)
    finish(1)

if sys.platform == 'win32' and not 'COMSPEC' in os.environ:
    error('COMSPEC environment variable is not set.')

executePath = os.getcwd()
scriptPath = os.path.dirname(os.path.realpath(__file__))
scriptName = os.path.basename(scriptPath)

arguments = sys.argv[1:]

officialTarget = ''
officialTargetFile = scriptPath + '/build/target'
if os.path.isfile(officialTargetFile):
    with open(officialTargetFile, 'r') as f:
        for line in f:
            officialTarget = line.strip()

if officialTarget != '':
    arguments.append('-DDESKTOP_APP_UPDATER_PUBLIC_KEY_LOC=SourceFiles/core')
    arguments.append('-DDESKTOP_APP_UPDATER_PRIVATE_NAME=wallet')
    finish(run_cmake.run(scriptName, arguments))
elif 'linux' in sys.platform:
    debugCode = run_cmake.run(scriptName, arguments, "Debug")
    finish(debugCode if debugCode else run_cmake.run(scriptName, arguments, "Release"))
else:
    finish(run_cmake.run(scriptName, arguments))
Ejemplo n.º 5
0
officialTarget = ''
officialTargetFile = scriptPath + '/build/target'
if os.path.isfile(officialTargetFile):
    with open(officialTargetFile, 'r') as f:
        for line in f:
            officialTarget = line.strip()

arch = ''
if officialTarget in ['win', 'uwp']:
    arch = 'x86'
elif officialTarget in ['win64', 'uwp64']:
    arch = 'x64'

if officialTarget != '':
    officialApiIdFile = scriptPath + '/../../DesktopPrivate/custom_api_id.h'
    if not os.path.isfile(officialApiIdFile):
        print("[ERROR] DesktopPrivate/custom_api_id.h not found.")
        finish(1)
    with open(officialApiIdFile, 'r') as f:
        for line in f:
            apiIdMatch = re.search(r'ApiId\s+=\s+(\d+)', line)
            apiHashMatch = re.search(r'ApiHash\s+=\s+"([a-fA-F\d]+)"', line)
            if apiIdMatch:
                arguments.append('-DTDESKTOP_API_ID=' + apiIdMatch.group(1))
            elif apiHashMatch:
                arguments.append('-DTDESKTOP_API_HASH=' +
                                 apiHashMatch.group(1))
    if arch != '':
        arguments.append(arch)
finish(run_cmake.run(scriptName, arguments))