Android build files
This commit is contained in:
parent
ecb688e8c7
commit
dd559fdb2f
9 changed files with 144 additions and 85 deletions
|
|
@ -15,6 +15,7 @@
|
|||
android:label="Cubemap Texture"
|
||||
android:theme="@android:style/Theme.NoTitleBar.Fullscreen"
|
||||
android:launchMode="singleTask"
|
||||
android:screenOrientation="landscape"
|
||||
android:configChanges="orientation|screenSize|keyboardHidden">
|
||||
<meta-data android:name="android.app.lib_name" android:value="vulkanTexturecubemap" />
|
||||
<intent-filter>
|
||||
|
|
|
|||
|
|
@ -1,29 +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\cubemap"
|
||||
xcopy "..\..\data\shaders\cubemap\*.spv" "assets\shaders\cubemap" /Y
|
||||
|
||||
mkdir "assets\textures"
|
||||
xcopy "..\..\data\textures\cubemap_yokohama.ktx" "assets\textures" /Y
|
||||
|
||||
mkdir "assets\models"
|
||||
xcopy "..\..\data\models\sphere.obj" "assets\models" /Y
|
||||
xcopy "..\..\data\models\teapot.dae" "assets\models" /Y
|
||||
xcopy "..\..\data\models\torusknot.obj" "assets\models" /Y
|
||||
xcopy "..\..\data\models\cube.obj" "assets\models" /Y
|
||||
|
||||
mkdir "res\drawable"
|
||||
xcopy "..\..\android\images\icon.png" "res\drawable" /Y
|
||||
|
||||
call ant debug -Dout.final.file=vulkanTexturecubemap.apk
|
||||
) ELSE (
|
||||
echo error : ndk-build failed with errors!
|
||||
cd..
|
||||
)
|
||||
47
android/texturecubemap/build.py
Normal file
47
android/texturecubemap/build.py
Normal file
|
|
@ -0,0 +1,47 @@
|
|||
import os
|
||||
import shutil
|
||||
import subprocess
|
||||
import sys
|
||||
import glob
|
||||
|
||||
APK_NAME = "vulkanTexturecubemap"
|
||||
SHADER_DIR = "cubemap"
|
||||
ASSETS_MODELS = ["sphere.obj", "teapot.dae", "torusknot.obj", "cube.obj"]
|
||||
ASSETS_TEXTURES = ["cubemap_yokohama_bc3_unorm.ktx", "cubemap_yokohama_etc2_unorm.ktx", "cubemap_yokohama_astc_8x8_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!")
|
||||
|
|
@ -15,6 +15,7 @@
|
|||
android:label="Texture mip map generation"
|
||||
android:theme="@android:style/Theme.NoTitleBar.Fullscreen"
|
||||
android:launchMode="singleTask"
|
||||
android:screenOrientation="landscape"
|
||||
android:configChanges="orientation|screenSize|keyboardHidden">
|
||||
<meta-data android:name="android.app.lib_name" android:value="vulkanTexturemipmapgen" />
|
||||
<intent-filter>
|
||||
|
|
|
|||
|
|
@ -1,25 +0,0 @@
|
|||
cd jni
|
||||
call ndk-build
|
||||
if %ERRORLEVEL% EQU 0 (
|
||||
cd..
|
||||
|
||||
mkdir "assets\shaders\base"
|
||||
xcopy "..\..\data\shaders\base\*.spv" "assets\shaders\base" /Y
|
||||
|
||||
mkdir "assets\shaders\texturemipmapgen"
|
||||
xcopy "..\..\data\shaders\texturemipmapgen\*.spv" "assets\shaders\texturemipmapgen" /Y
|
||||
|
||||
mkdir "assets\textures"
|
||||
xcopy "..\..\data\textures\metalplate_nomips_rgba.ktx" "assets\textures" /Y
|
||||
|
||||
mkdir "assets\models"
|
||||
xcopy "..\..\data\models\tunnel_cylinder.dae" "assets\models" /Y
|
||||
|
||||
mkdir "res\drawable"
|
||||
xcopy "..\..\android\images\icon.png" "res\drawable" /Y
|
||||
|
||||
call ant debug -Dout.final.file=vulkanTexturemipmapgen.apk
|
||||
) ELSE (
|
||||
echo error : ndk-build failed with errors!
|
||||
cd..
|
||||
)
|
||||
47
android/texturemipmapgen/build.py
Normal file
47
android/texturemipmapgen/build.py
Normal file
|
|
@ -0,0 +1,47 @@
|
|||
import os
|
||||
import shutil
|
||||
import subprocess
|
||||
import sys
|
||||
import glob
|
||||
|
||||
APK_NAME = "vulkanTexturemipmapgen"
|
||||
SHADER_DIR = "texturemipmapgen"
|
||||
ASSETS_MODELS = ["tunnel_cylinder.dae"]
|
||||
ASSETS_TEXTURES = ["metalplate_nomips_rgba.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!")
|
||||
|
|
@ -15,7 +15,7 @@
|
|||
android:label="Demo Scene"
|
||||
android:theme="@android:style/Theme.NoTitleBar.Fullscreen"
|
||||
android:launchMode="singleTask"
|
||||
android:screenOrientation="landscape"
|
||||
android:screenOrientation="landscape"
|
||||
android:configChanges="orientation|screenSize|keyboardHidden">
|
||||
<meta-data android:name="android.app.lib_name" android:value="vulkanVulkanscene" />
|
||||
<intent-filter>
|
||||
|
|
|
|||
|
|
@ -1,30 +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\vulkanscene"
|
||||
xcopy "..\..\data\shaders\vulkanscene\*.spv" "assets\shaders\vulkanscene" /Y
|
||||
|
||||
mkdir "assets\textures"
|
||||
xcopy "..\..\data\textures\cubemap_vulkan.ktx" "assets\textures" /Y
|
||||
|
||||
mkdir "assets\models"
|
||||
xcopy "..\..\data\models\vulkanscenelogos.dae" "assets\models" /Y
|
||||
xcopy "..\..\data\models\vulkanscenebackground.dae" "assets\models" /Y
|
||||
xcopy "..\..\data\models\vulkanscenemodels.dae" "assets\models" /Y
|
||||
xcopy "..\..\data\models\cube.obj" "assets\models" /Y
|
||||
|
||||
mkdir "res\drawable"
|
||||
xcopy "..\..\android\images\icon.png" "res\drawable" /Y
|
||||
|
||||
call ant debug -Dout.final.file=vulkanVulkanscene.apk
|
||||
) ELSE (
|
||||
echo error : ndk-build failed with errors!
|
||||
cd..
|
||||
)
|
||||
47
android/vulkanscene/build.py
Normal file
47
android/vulkanscene/build.py
Normal file
|
|
@ -0,0 +1,47 @@
|
|||
import os
|
||||
import shutil
|
||||
import subprocess
|
||||
import sys
|
||||
import glob
|
||||
|
||||
APK_NAME = "vulkanVulkanscene"
|
||||
SHADER_DIR = "vulkanscene"
|
||||
ASSETS_MODELS = ["vulkanscenelogos.dae", "vulkanscenebackground.dae", "vulkanscenemodels.dae", "cube.obj"]
|
||||
ASSETS_TEXTURES = ["cubemap_vulkan.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!")
|
||||
Loading…
Add table
Add a link
Reference in a new issue