Fix Android install script issue:

1. FileNotFoundError:

``` bash
Traceback (most recent call last):
  File "install-all.py", line 11, in <module>
    if subprocess.call("python build-all.py -deploy %s" % BUILD_ARGUMENTS) != 0:
  File "/Users/piasy/anaconda3/lib/python3.6/subprocess.py", line 267, in call
    with Popen(*popenargs, **kwargs) as p:
  File "/Users/piasy/anaconda3/lib/python3.6/subprocess.py", line 707, in __init__
    restore_signals, start_new_session)
  File "/Users/piasy/anaconda3/lib/python3.6/subprocess.py", line 1326, in _execute_child
    raise child_exception_type(errno_num, err_msg)
FileNotFoundError: [Errno 2] No such file or directory: 'python build-all.py -deploy '
```

2. KeyError:

``` bash
Traceback (most recent call last):
  File "build.py", line 46, in <module>
    if "additional" in EXAMPLE_JSON["assets"]:
KeyError: 'assets'
```
This commit is contained in:
Piasy 2017-06-26 14:04:31 +08:00
parent 3d3cf9f31c
commit 7e2787413b
3 changed files with 4 additions and 5 deletions

View file

@ -71,7 +71,7 @@ print("Building all examples...")
for example in EXAMPLES:
print(COLOR_GREEN + "Building %s (%d/%d)" % (example, CURR_INDEX, len(EXAMPLES)) + COLOR_END)
if subprocess.call("python build.py %s %s" % (example, BUILD_ARGUMENTS)) != 0:
if subprocess.call(("python build.py %s %s" % (example, BUILD_ARGUMENTS)).split(' ')) != 0:
print("Error during build process for %s" % example)
sys.exit(-1)
CURR_INDEX += 1

View file

@ -29,7 +29,7 @@ if not os.path.isfile(os.path.join(PROJECT_FOLDER, "build.xml")):
ANDROID_CMD = "android"
if os.name == 'nt':
ANDROID_CMD += ".bat"
if subprocess.call("%s update project -p ./%s -t %s" % (ANDROID_CMD, PROJECT_FOLDER, SDK_VERSION)) != 0:
if subprocess.call(("%s update project -p ./%s -t %s" % (ANDROID_CMD, PROJECT_FOLDER, SDK_VERSION)).split(' ')) != 0:
print("Error: Project update failed!")
sys.exit(-1)
@ -43,7 +43,7 @@ SHADER_DIR = EXAMPLE_JSON["directories"]["shaders"]
# Additional
ADDITIONAL_DIRS = []
ADDITIONAL_FILES = []
if "additional" in EXAMPLE_JSON["assets"]:
if "assets" in EXAMPLE_JSON and "additional" in EXAMPLE_JSON["assets"]:
ADDITIONAL = EXAMPLE_JSON["assets"]["additional"]
if "directories" in ADDITIONAL:
ADDITIONAL_DIRS = ADDITIONAL["directories"]

View file

@ -8,7 +8,6 @@ if answer:
for arg in sys.argv[1:]:
if arg == "-validation":
BUILD_ARGUMENTS += "-validation"
if subprocess.call("python build-all.py -deploy %s" % BUILD_ARGUMENTS) != 0:
if subprocess.call(("python build-all.py -deploy %s" % BUILD_ARGUMENTS).split(' ')) != 0:
print("Error: Not all examples may have been installed!")
sys.exit(-1)