forked from YoutaVen/Vulkan
-
Notifications
You must be signed in to change notification settings - Fork 1
/
create_build_all_android.py
82 lines (54 loc) · 1.77 KB
/
create_build_all_android.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
import os
import subprocess
import sys
import threading
####################
#
# Functions
#
####################
class BuildThread (threading.Thread):
def __init__(self, buildDirectory, buildOption):
threading.Thread.__init__(self)
self.buildDirectory = buildDirectory
self.buildOption = buildOption
def run(self):
print("Processing '%s' ..." % (self.buildDirectory))
directory = os.getcwd() + "/" + self.buildDirectory + "/Android/jni"
subprocess.call("ndk-build -C %s -j" % (directory), shell=True)
print("Finished '%s'." % (self.buildDirectory))
####################
#
# Main
#
####################
print("Creating and building all Android projects")
#
currentValidate = ""
for x in range(1, len(sys.argv)):
if sys.argv[x] == 'validate':
currentValidate = " validate"
option = currentValidate
#
allBuildThreads = []
allVKTS = os.listdir()
for package in allVKTS:
if package.startswith("VKTS_PKG"):
currentBuildThread = BuildThread(package, "")
allBuildThreads.append(currentBuildThread)
currentBuildThread.start()
for currentBuildThread in allBuildThreads:
currentBuildThread.join()
#
allExamples = os.listdir()
for example in allExamples:
if example.startswith("VKTS_Example") or example.startswith("VKTS_Test"):
print("Processing '%s' ..." % (example))
os.chdir(example)
os.chdir("Android")
subprocess.call("create_project.py", shell=True)
subprocess.call("build_project.py %s" % (option), shell=True)
os.chdir("../..")
print("Finished '%s'." % (example))
allExamples = os.listdir()
print("Done.")