procedural-3d-engine/android/build-all.py
Ciro Santilli 848310ffdb Allow Linux users to build Android even if Python 2 is their default Python
After this commit, users who have the `python` executable as Python 2 can do simply:

    cd android/
    ./build-all.py
    ./build.py

Previously, the following would fail:

    python3 build-all.py

since build-all.py did subcalls to `python build.py`.

Remove install-all.py as it is redundant with `build-all.py -deploy`,
instead of fixing it as well.

Introduce argparse since we are separating argument parsing out of
the `main()` function.

Tested in Ubuntu 16.04, behaviour should be unchanged for Windows.
2017-10-26 17:09:59 +01:00

84 lines
1.8 KiB
Python
Executable file

#!/usr/bin/env python3
import argparse
import subprocess
import sys
import build
EXAMPLES = [
"bloom",
"computecullandlod",
"computecloth",
"computeheadless",
"computenbody",
"computeparticles",
"computeshader",
"debugmarker",
"deferred",
"deferredmultisampling",
"deferredshadows",
"displacement",
"distancefieldfonts",
"dynamicuniformbuffer",
"gears",
"geometryshader",
"hdr",
"imgui",
"indirectdraw",
"instancing",
"mesh",
"multisampling",
"multithreading",
"occlusionquery",
"offscreen",
"parallaxmapping",
"particlefire",
"pbrbasic",
"pbribl",
"pipelines",
"pushconstants",
"radialblur",
"raytracing",
"renderheadless",
"ssao",
"scenerendering",
"shadowmapping",
"shadowmappingomni",
"skeletalanimation",
"specializationconstants",
"sphericalenvmapping",
"stencilbuffer",
"subpasses",
"terraintessellation",
"tessellation",
"textoverlay",
"texture",
"texture3d",
"texturearray",
"texturecubemap",
"texturemipmapgen",
"triangle",
"vulkanscene"
]
COLOR_GREEN = '\033[92m'
COLOR_END = '\033[0m'
CURR_INDEX = 0
parser = argparse.ArgumentParser()
parser.add_argument('-deploy', default=False, action='store_true', help="install examples on device")
parser.add_argument('-validation', default=False, action='store_true')
args = parser.parse_args()
print("Building all examples...")
for example in EXAMPLES:
print(COLOR_GREEN + "Building %s (%d/%d)" % (example, CURR_INDEX, len(EXAMPLES)) + COLOR_END)
if not build.main(example, args.deploy, args.validation):
print("Error during build process for %s" % example)
sys.exit(-1)
CURR_INDEX += 1
print("Successfully build %d examples" % CURR_INDEX)