Updated android build files
This commit is contained in:
parent
6895fd7fd7
commit
444d06e9ab
3 changed files with 37 additions and 22 deletions
|
|
@ -15,6 +15,7 @@
|
|||
android:label="Triangle"
|
||||
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="vulkanTriangle" />
|
||||
<intent-filter>
|
||||
|
|
|
|||
|
|
@ -1,22 +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"
|
||||
xcopy "..\..\data\shaders\triangle.vert.spv" "assets\shaders" /Y
|
||||
xcopy "..\..\data\shaders\triangle.frag.spv" "assets\shaders" /Y
|
||||
|
||||
mkdir "res\drawable"
|
||||
xcopy "..\..\android\images\icon.png" "res\drawable" /Y
|
||||
|
||||
call ant debug -Dout.final.file=vulkanTriangle.apk
|
||||
) ELSE (
|
||||
echo error : ndk-build failed with errors!
|
||||
cd..
|
||||
)
|
||||
36
android/triangle/build.py
Normal file
36
android/triangle/build.py
Normal file
|
|
@ -0,0 +1,36 @@
|
|||
import os
|
||||
import shutil
|
||||
import subprocess
|
||||
import sys
|
||||
import glob
|
||||
|
||||
APK_NAME = "vulkanTriangle"
|
||||
ASSETS_SHADERS = ["triangle.vert.spv", "triangle.frag.spv"]
|
||||
|
||||
if subprocess.call("ndk-build", shell=True) == 0:
|
||||
print("Build successful")
|
||||
|
||||
os.makedirs("./assets/shaders", exist_ok=True)
|
||||
os.makedirs("./assets/shaders/base", 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 ASSETS_SHADERS:
|
||||
shutil.copy("../../data/shaders/%s" % file, "./assets/shaders")
|
||||
|
||||
# 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