Android build files and manifests [skip ci]

This commit is contained in:
saschawillems 2017-03-14 20:50:37 +01:00
parent 5443c01f07
commit 8048cd69fd
15 changed files with 161 additions and 75 deletions

View file

@ -15,6 +15,7 @@
android:label="Occlusion query" android:label="Occlusion query"
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="vulkanOcclusionquery" /> <meta-data android:name="android.app.lib_name" android:value="vulkanOcclusionquery" />
<intent-filter> <intent-filter>

View file

@ -1,26 +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\occlusionquery"
xcopy "..\..\data\shaders\occlusionquery\*.spv" "assets\shaders\occlusionquery" /Y
mkdir "assets\models"
xcopy "..\..\data\models\plane_z.3ds" "assets\models" /Y
xcopy "..\..\data\models\teapot.3ds" "assets\models" /Y
xcopy "..\..\data\models\sphere.3ds" "assets\models" /Y
mkdir "res\drawable"
xcopy "..\..\android\images\icon.png" "res\drawable" /Y
call ant debug -Dout.final.file=vulkanOcclusionquery.apk
) ELSE (
echo error : ndk-build failed with errors!
cd..
)

View file

@ -0,0 +1,48 @@
import os
import shutil
import subprocess
import sys
import glob
sys.path.append('../base/')
import base
APK_NAME = "vulkanOcclusionquery"
APP_TITLE = "Occlusion queries"
SHADER_DIR = "occlusionquery"
ASSETS_MODELS = ["plane_z.3ds", "teapot.3ds", "sphere.3ds"]
if subprocess.call("ndk-build", shell=True) == 0:
print("Build successful")
# Assets
os.makedirs("./assets/shaders", exist_ok=True)
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:
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!")

View file

@ -15,6 +15,7 @@
android:label="Offscreen" android:label="Offscreen"
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="vulkanOffscreen" /> <meta-data android:name="android.app.lib_name" android:value="vulkanOffscreen" />
<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\offscreen"
xcopy "..\..\data\shaders\offscreen\*.spv" "assets\shaders\offscreen" /Y
mkdir "assets\textures"
xcopy "..\..\data\textures\darkmetal_bc3.ktx" "assets\textures" /Y
mkdir "assets\models"
xcopy "..\..\data\models\plane.obj" "assets\models" /Y
xcopy "..\..\data\models\chinesedragon.dae" "assets\models" /Y
mkdir "res\drawable"
xcopy "..\..\android\images\icon.png" "res\drawable" /Y
call ant debug -Dout.final.file=vulkanOffscreen.apk
) ELSE (
echo error : ndk-build failed with errors!
cd..
)

View file

@ -0,0 +1,53 @@
import os
import shutil
import subprocess
import sys
import glob
APK_NAME = "vulkanOffscreen"
SHADER_DIR = "offscreen"
ASSETS_MODELS = ["plane.obj", "chinesedragon.dae"]
ASSETS_TEXTURES = ["darkmetal_bc3_unorm.ktx", "stonefloor01_color_bc3_unorm.ktx", "darkmetal_astc_8x8_unorm.ktx", "darkmetal_etc2_unorm.ktx"]
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)
# Textures and models
if not os.path.exists("./assets/textures"):
os.makedirs("./assets/textures")
for file in ASSETS_TEXTURES:
shutil.copy("../../data/textures/%s" % file, "./assets/textures")
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!")

View file

@ -15,6 +15,7 @@
android:label="Physical based rendering" android:label="Physical based rendering"
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="vulkanPBRBasic" /> <meta-data android:name="android.app.lib_name" android:value="vulkanPBRBasic" />
<intent-filter> <intent-filter>

View file

@ -15,6 +15,7 @@
android:label="PBR Image based lighting" android:label="PBR Image based lighting"
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="vulkanPBRBIBL" /> <meta-data android:name="android.app.lib_name" android:value="vulkanPBRBIBL" />
<intent-filter> <intent-filter>

View file

@ -15,6 +15,7 @@
android:label="Raytracing" android:label="Raytracing"
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="vulkanRaytracing" /> <meta-data android:name="android.app.lib_name" android:value="vulkanRaytracing" />
<intent-filter> <intent-filter>

View file

@ -1,21 +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\raytracing"
xcopy "..\..\data\shaders\raytracing\*.spv" "assets\shaders\raytracing" /Y
mkdir "res\drawable"
xcopy "..\..\android\images\icon.png" "res\drawable" /Y
call ant debug -Dout.final.file=vulkanRaytracing.apk
) ELSE (
echo error : ndk-build failed with errors!
cd..
)

View file

@ -0,0 +1,51 @@
import os
import shutil
import subprocess
import sys
import glob
APK_NAME = "vulkanRaytracing"
SHADER_DIR = "raytracing"
if subprocess.call("ndk-build", shell=True) == 0:
print("Build successful")
# Copy validation layers
if len(sys.argv) > 1:
if sys.argv[1] == "-validation":
print("copying validation layers")
for file in glob.glob("../layers/armeabi-v7a/*.so"):
print(file)
shutil.copy(file, "./libs/armeabi-v7a")
# Assets
os.makedirs("./assets/shaders/base", exist_ok=True)
os.makedirs("./assets/shaders/%s" % SHADER_DIR, exist_ok=True)
os.makedirs("./res/drawable", exist_ok=True)
# 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)
# 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!")

View file

@ -15,6 +15,7 @@
android:label="Scene rendering" android:label="Scene rendering"
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="vulkanScenerendering" /> <meta-data android:name="android.app.lib_name" android:value="vulkanScenerendering" />
<intent-filter> <intent-filter>

View file

@ -15,6 +15,7 @@
android:label="Shadow mapping" android:label="Shadow mapping"
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="vulkanShadowmapping" /> <meta-data android:name="android.app.lib_name" android:value="vulkanShadowmapping" />
<intent-filter> <intent-filter>

View file

@ -15,6 +15,7 @@
android:label="SSAO" android:label="SSAO"
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="vulkanSSAO" /> <meta-data android:name="android.app.lib_name" android:value="vulkanSSAO" />
<intent-filter> <intent-filter>

View file

@ -15,6 +15,7 @@
android:label="Demo Scene" android:label="Demo Scene"
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="vulkanVulkanscene" /> <meta-data android:name="android.app.lib_name" android:value="vulkanVulkanscene" />
<intent-filter> <intent-filter>