-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbuild_artifact.py
executable file
·111 lines (95 loc) · 2.82 KB
/
build_artifact.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
#! /usr/bin/python3
from jonchki import cli_args
from jonchki import jonchkihere
import os
import subprocess
import sys
tPlatform = cli_args.parse()
print('Building for %s' % tPlatform['platform_id'])
# --------------------------------------------------------------------------
# -
# - Configuration
# -
# Get the project folder. This is the folder of this script.
strCfg_projectFolder = os.path.dirname(os.path.realpath(__file__))
# This is the Jonchki version to use.
strCfg_jonchkiVersion = '0.0.11.1'
# Look in this folder for Jonchki archives before downloading them.
strCfg_jonchkiLocalArchives = os.path.join(
strCfg_projectFolder,
'jonchki',
'local_archives'
)
# The target folder for the jonchki installation. A subfolder named
# "jonchki-VERSION" will be created there. "VERSION" will be replaced with
# the version number from strCfg_jonchkiVersion.
strCfg_jonchkiInstallationFolder = os.path.join(
strCfg_projectFolder,
'targets'
)
strCfg_jonchkiSystemConfiguration = os.path.join(
strCfg_projectFolder,
'jonchki',
'jonchkisys.cfg'
)
strCfg_jonchkiProjectConfiguration = os.path.join(
strCfg_projectFolder,
'jonchki',
'jonchkicfg.xml'
)
strCfg_jonchkiFinalizer = os.path.join(
strCfg_projectFolder,
'finalizer.lua'
)
strCfg_jonchkiDependencyLog = os.path.join(
strCfg_projectFolder,
'dependency-log.xml'
)
# -
# --------------------------------------------------------------------------
# Install jonchki.
strJonchki = jonchkihere.install(
strCfg_jonchkiVersion,
strCfg_jonchkiInstallationFolder,
LOCAL_ARCHIVES=strCfg_jonchkiLocalArchives
)
sys.stdout.flush()
sys.stderr.flush()
# Create the command line options for the selected platform.
astrJonchkiPlatform = cli_args.to_jonchki_args(tPlatform)
# Get the working folder for the test variant.
strWorkingFolder = os.path.join(
strCfg_projectFolder,
'targets',
tPlatform['platform_id']
)
# Create the working folder if it does not exist yet.
if os.path.exists(strWorkingFolder) is not True:
os.makedirs(strWorkingFolder)
astrArguments = [strJonchki]
astrArguments.append('install-dependencies')
astrArguments.extend(['-v', 'debug'])
astrArguments.extend(['--project-root', strCfg_projectFolder])
astrArguments.extend([
'--logfile',
os.path.join(strWorkingFolder, 'jonchki.log')
])
astrArguments.extend(['--syscfg', strCfg_jonchkiSystemConfiguration])
astrArguments.extend(['--prjcfg', strCfg_jonchkiProjectConfiguration])
astrArguments.extend([
'--dependency-log',
os.path.join(
strCfg_projectFolder,
'dependency-log.xml'
)
])
astrArguments.extend([
'--prepare',
os.path.join(
strCfg_projectFolder,
'prepare.lua'
)
])
astrArguments.extend(astrJonchkiPlatform)
astrArguments.append('fdltool.xml')
subprocess.check_call(astrArguments, cwd=strWorkingFolder)