Removed old python build scripts, replaced with json example definition files
This commit is contained in:
parent
3064aef33c
commit
b5a733b502
10 changed files with 72 additions and 225 deletions
|
|
@ -1,48 +0,0 @@
|
|||
import os
|
||||
import shutil
|
||||
import subprocess
|
||||
import sys
|
||||
import glob
|
||||
|
||||
APK_NAME = "vulkanPipelines"
|
||||
SHADER_DIR = "pipelines"
|
||||
ASSETS_MODELS = ["treasure_smooth.dae"]
|
||||
|
||||
if subprocess.call("ndk-build", shell=True) == 0:
|
||||
print("Build successful")
|
||||
|
||||
# Assets
|
||||
if not os.path.exists("./assets"):
|
||||
os.makedirs("./assets")
|
||||
|
||||
# Shaders
|
||||
# Base
|
||||
if not os.path.exists("./assets/shaders/base"):
|
||||
os.makedirs("./assets/shaders/base")
|
||||
for file in glob.glob("../../data/shaders/base/*.spv"):
|
||||
shutil.copy(file, "./assets/shaders/base")
|
||||
# Sample
|
||||
if not os.path.exists("./assets/shaders/%s" % SHADER_DIR):
|
||||
os.makedirs("./assets/shaders/%s" % SHADER_DIR)
|
||||
for file in glob.glob("../../data/shaders/%s/*.spv" %SHADER_DIR):
|
||||
shutil.copy(file, "./assets/shaders/%s" % SHADER_DIR)
|
||||
# Models
|
||||
if not os.path.exists("./assets/models"):
|
||||
os.makedirs("./assets/models")
|
||||
for file in ASSETS_MODELS:
|
||||
shutil.copy("../../data/models/%s" % file, "./assets/models")
|
||||
|
||||
# Icon
|
||||
if not os.path.exists("./res/drawable"):
|
||||
os.makedirs("./res/drawable")
|
||||
shutil.copy("../../android/images/icon.png", "./res/drawable")
|
||||
|
||||
if subprocess.call("ant debug -Dout.final.file=%s.apk" % APK_NAME, shell=True) == 0:
|
||||
if len(sys.argv) > 1:
|
||||
if sys.argv[1] == "-deploy":
|
||||
if subprocess.call("adb install -r %s.apk" % APK_NAME, shell=True) != 0:
|
||||
print("Could not deploy to device!")
|
||||
else:
|
||||
print("Error during build process!")
|
||||
else:
|
||||
print("Error building project!")
|
||||
11
android/pipelines/example.json
Normal file
11
android/pipelines/example.json
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
{
|
||||
"apkname": "vulkanPipelines",
|
||||
"directories": {
|
||||
"shaders": "pipelines"
|
||||
},
|
||||
"assets": {
|
||||
"models": [
|
||||
"treasure_smooth.dae"
|
||||
]
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue