Android build files [skip ci]

This commit is contained in:
saschawillems 2017-03-17 20:00:03 +01:00
parent 9084d28407
commit 7b2dceebab
6 changed files with 91 additions and 52 deletions

View file

@ -15,6 +15,7 @@
android:label="Push Constants" android:label="Push Constants"
android:theme="@android:style/Theme.NoTitleBar.Fullscreen" android:theme="@android:style/Theme.NoTitleBar.Fullscreen"
android:launchMode="singleTask" android:launchMode="singleTask"
android:screenOrientation="landscape"
android:configChanges="orientation|screenSize|keyboardHidden"> android:configChanges="orientation|screenSize|keyboardHidden">
<meta-data android:name="android.app.lib_name" android:value="vulkanPushconstants" /> <meta-data android:name="android.app.lib_name" android:value="vulkanPushconstants" />
<intent-filter> <intent-filter>

View file

@ -1,24 +0,0 @@
cd jni
call ndk-build
if %ERRORLEVEL% EQU 0 (
echo ndk-build has failed, build cancelled
cd..
mkdir "assets\shaders\base"
xcopy "..\..\data\shaders\base\*.spv" "assets\shaders\base" /Y
mkdir "assets\shaders\pushconstants"
xcopy "..\..\data\shaders\pushconstants\*.spv" "assets\shaders\pushconstants" /Y
mkdir "assets\models"
xcopy "..\..\data\models\samplescene.dae" "assets\models" /Y
mkdir "res\drawable"
xcopy "..\..\android\images\icon.png" "res\drawable" /Y
call ant debug -Dout.final.file=vulkanPushconstants.apk
) ELSE (
echo error : ndk-build failed with errors!
cd..
)

View file

@ -0,0 +1,42 @@
import os
import shutil
import subprocess
import sys
import glob
APK_NAME = "vulkanPushconstants"
SHADER_DIR = "pushconstants"
ASSETS_MODELS = ["samplescene.dae"]
if subprocess.call("ndk-build", shell=True) == 0:
print("Build successful")
# Assets
os.makedirs("./assets/shaders/base", exist_ok=True)
os.makedirs("./assets/shaders/%s" % SHADER_DIR, exist_ok=True)
os.makedirs("./assets/models", exist_ok=True)
os.makedirs("./res/drawable", exist_ok=True)
# Shaders
# Base
for file in glob.glob("../../data/shaders/base/*.spv"):
shutil.copy(file, "./assets/shaders/base")
# Sample
for file in glob.glob("../../data/shaders/%s/*.spv" %SHADER_DIR):
shutil.copy(file, "./assets/shaders/%s" % SHADER_DIR)
# Models
for file in ASSETS_MODELS:
shutil.copy("../../data/models/%s" % file, "./assets/models")
# Icon
shutil.copy("../../android/images/icon.png", "./res/drawable")
if subprocess.call("ant debug -Dout.final.file=%s.apk" % APK_NAME, shell=True) == 0:
for arg in sys.argv[1:]:
if arg == "-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!")

View file

@ -15,6 +15,7 @@
android:label="Text overlay" android:label="Text overlay"
android:theme="@android:style/Theme.NoTitleBar.Fullscreen" android:theme="@android:style/Theme.NoTitleBar.Fullscreen"
android:launchMode="singleTask" android:launchMode="singleTask"
android:screenOrientation="landscape"
android:configChanges="orientation|screenSize|keyboardHidden"> android:configChanges="orientation|screenSize|keyboardHidden">
<meta-data android:name="android.app.lib_name" android:value="vulkanTextoverlay" /> <meta-data android:name="android.app.lib_name" android:value="vulkanTextoverlay" />
<intent-filter> <intent-filter>

View file

@ -1,28 +0,0 @@
cd jni
call ndk-build
if %ERRORLEVEL% EQU 0 (
echo ndk-build has failed, build cancelled
cd..
mkdir "assets\shaders\base"
xcopy "..\..\data\shaders\base\*.spv" "assets\shaders\base" /Y
mkdir "assets\shaders\textoverlay"
xcopy "..\..\data\shaders\textoverlay\*.spv" "assets\shaders\textoverlay" /Y
mkdir "assets\models"
xcopy "..\..\data\models\cube.dae" "assets\models" /Y
mkdir "assets\textures"
xcopy "..\..\data\textures\skysphere_bc3.ktx" "assets\textures" /Y
xcopy "..\..\data\textures\round_window_bc3.ktx" "assets\textures" /Y
mkdir "res\drawable"
xcopy "..\..\android\images\icon.png" "res\drawable" /Y
call ant debug -Dout.final.file=vulkanTextoverlay.apk
) ELSE (
echo error : ndk-build failed with errors!
cd..
)

View file

@ -0,0 +1,47 @@
import os
import shutil
import subprocess
import sys
import glob
APK_NAME = "vulkanTextoverlay"
SHADER_DIR = "textoverlay"
ASSETS_MODELS = ["cube.dae"]
ASSETS_TEXTURES = ["skysphere_bc3_unorm.ktx", "round_window_bc3_unorm.ktx", "skysphere_astc_8x8_unorm.ktx", "round_window_astc_8x8_unorm.ktx", "skysphere_etc2_unorm.ktx", "round_window_etc2_unorm.ktx"]
if subprocess.call("ndk-build", shell=True) == 0:
print("Build successful")
# Assets
os.makedirs("./assets/shaders/base", exist_ok=True)
os.makedirs("./assets/shaders/%s" % SHADER_DIR, exist_ok=True)
os.makedirs("./assets/textures", exist_ok=True)
os.makedirs("./assets/models", exist_ok=True)
os.makedirs("./res/drawable", exist_ok=True)
# Shaders
# Base
for file in glob.glob("../../data/shaders/base/*.spv"):
shutil.copy(file, "./assets/shaders/base")
# Sample
for file in glob.glob("../../data/shaders/%s/*.spv" %SHADER_DIR):
shutil.copy(file, "./assets/shaders/%s" % SHADER_DIR)
# Textures
for file in ASSETS_TEXTURES:
shutil.copy("../../data/textures/%s" % file, "./assets/textures")
# Models
for file in ASSETS_MODELS:
shutil.copy("../../data/models/%s" % file, "./assets/models")
# Icon
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!")