Streamlined Android build process and install/uninstall batch files (#97)

This commit is contained in:
saschawillems 2016-03-26 11:49:37 +01:00
parent dcb161bcae
commit 1288672fd9
20 changed files with 125 additions and 44 deletions

View file

@ -7,12 +7,12 @@ Since Vulkan is not yet part of the Android OS (like OpenGL ES) the library and
## Device support ## Device support
- **To run these examples you need a device with an Android image that suports Vulkan** - **To run these examples you need a device with an Android image that suports Vulkan**
- Builds currently only support arm-v7, x86 may follow at a later point - Builds currently only support arm-v7, x86 may follow at a later point
- Android TV leanback launcher is supported, examples will show up on the launcher - Android TV leanback launcher is supported, so the examples will show up on the launcher
- Basic gamepad support is available too (zoom and rotate) - Basic gamepad support is available too (zoom and rotate)
## Imporant note ## Imporant note
I'm currently in the process of replacing the old (separate) Android examples, integrating Android support into the main line of examples. This is a work-in-progress, so the examples that are already converted may contain errors. Most notably they won't free the Vulkan resources for now. The Android part of the Vulkan example base is not yet finished, and while the examples run fine they might encounter some problems as most of the resources are not yet correctly released when closing the app.
## Building ## Building
@ -22,22 +22,55 @@ I'm currently in the process of replacing the old (separate) Android examples, i
### Building the Examples ### Building the Examples
Builds are started using the provided batch file for each example. ### Complete set
**Please note that building (and deploying) all examples may take a while**
#### Build only #### Build only
Call the corresponding .bat, call e.g. :
``` ```
build-triangle.bat build-all
``` ```
This will build the apk and move it to the "bin" folder This will build all apks and puts them into the **bin** folder.
#### Deploy #### Build and deploy
If you want to deploy to an attached Android device right after the build is done :
``` ```
build-triangle.bat -deploy install-all
``` ```
This will build all apks and deploys them to the currently attached android device.
### Single examples
These are for building and/or deploying a single example.
#### Build only
Call build(.bat) with the name of the example to build, e.g. :
```
build triangle
```
This will build the apk for the triangle example and puts it into the **bin** folder.
#### Build and deploy
```
build triangle -deploy
```
This will build the apk for the triangle example and deploys it to the currently attached android device.
## Removing
A batch file for removing all installed examples is provided in case you installed all of them and don't want to remove them by hand (which is especially tedious on Android TV).
```
uninstall-all
```
This will remove any installed Android example from this repository from the attached device.

View file

@ -1,17 +1,27 @@
call build-bloom.bat %1 call _build geometryshader %1
call build-computeparticles.bat %1 call _build computeparticles %1
call build-computeshader.bat %1 call _build computeshader %1
call build-deferred.bat %1 call _build parallaxmapping %1
call build-displacement.bat %1 call _build bloom %1
rem call build-distancefieldfonts.bat call _build gears %1
call build-mesh.bat %1 call _build texturecubemap %1
call build-offscreen.bat %1 call _build instancing %1
call build-particlefire.bat %1 call _build deferred %1
call build-shadowmapping.bat %1 call _build particlefire %1
call build-shadowmappingomni.bat %1 call _build occlusionquery %1
call build-sphericalenvmapping.bat %1 call _build texture %1
call build-texture.bat %1 call _build tessellation %1
call build-texturearray.bat %1 call _build mesh %1
call build-texturecubemap.bat %1 call _build texturearray %1
call build-triangle.bat %1 call _build pipelines %1
call build-vulkanscene.bat %1 call _build triangle %1
call _build skeletalanimation %1
call _build distancefieldfonts %1
call _build vulkanscene %1
call _build offscreen %1
call _build shadowmapping %1
call _build pushconstants %1
call _build shadowmappingomni %1
call _build sphericalenvmapping %1
call _build radialblur %1
call _build displacement %1

View file

@ -1 +0,0 @@
_build bloom %1

View file

@ -1 +0,0 @@
_build computeparticles %1

View file

@ -1 +0,0 @@
_build computeshader %1

View file

@ -1 +0,0 @@
_build deferred %1

View file

@ -1 +0,0 @@
_build displacement %1

View file

@ -1 +0,0 @@
_build mesh %1

View file

@ -1 +0,0 @@
_build offscreen %1

View file

@ -1 +0,0 @@
_build particlefire %1

View file

@ -1 +0,0 @@
_build shadowmapping %1

View file

@ -1 +0,0 @@
_build shadowmappingomni %1

View file

@ -1 +0,0 @@
_build sphericalenvmapping %1

View file

@ -1 +0,0 @@
_build texture %1

View file

@ -1 +0,0 @@
_build texturearray %1

View file

@ -1 +0,0 @@
_build texturecubemap %1

View file

@ -1 +0,0 @@
_build triangle %1

View file

@ -1 +0,0 @@
_build vulkanscene %1

14
android/install-all.bat Normal file
View file

@ -0,0 +1,14 @@
@echo off
SET /P ANSWER=Install all vulkan examples on attached device (Y/N)?
if /i {%ANSWER%}=={y} (goto :install)
if /i {%ANSWER%}=={yes} (goto :install)
goto :exit
:install
call build-all.bat -deploy
goto finish
:exit
echo Cancelled
:finish

40
android/uninstall-all.bat Normal file
View file

@ -0,0 +1,40 @@
@echo off
SET /P ANSWER=Uninstall all vulkan examples from attached device (Y/N)?
if /i {%ANSWER%}=={y} (goto :uninstall)
if /i {%ANSWER%}=={yes} (goto :uninstall)
goto :exit
:uninstall
adb uninstall de.saschawillems.vulkanGeometryshader
adb uninstall de.saschawillems.vulkanComputeparticles
adb uninstall de.saschawillems.vulkanComputeshader
adb uninstall de.saschawillems.vulkanParallaxmapping
adb uninstall de.saschawillems.vulkanBloom
adb uninstall de.saschawillems.vulkanGears
adb uninstall de.saschawillems.vulkanTexturecubemap
adb uninstall de.saschawillems.vulkanInstancing
adb uninstall de.saschawillems.vulkanDeferred
adb uninstall de.saschawillems.vulkanParticlefire
adb uninstall de.saschawillems.vulkanOcclusionquery
adb uninstall de.saschawillems.vulkanTexture
adb uninstall de.saschawillems.vulkanTessellation
adb uninstall de.saschawillems.vulkanMesh
adb uninstall de.saschawillems.vulkanTexturearray
adb uninstall de.saschawillems.vulkanPipelines
adb uninstall de.saschawillems.vulkanTriangle
adb uninstall de.saschawillems.vulkanSkeletalanimation
adb uninstall de.saschawillems.vulkanDistancefieldfonts
adb uninstall de.saschawillems.vulkanVulkanscene
adb uninstall de.saschawillems.vulkanOffscreen
adb uninstall de.saschawillems.vulkanShadowmapping
adb uninstall de.saschawillems.vulkanPushconstants
adb uninstall de.saschawillems.vulkanShadowmappingomni
adb uninstall de.saschawillems.vulkanSphericalenvmapping
adb uninstall de.saschawillems.vulkanRadialblur
adb uninstall de.saschawillems.vulkanDisplacement
goto finish
:exit
echo Cancelled
:finish