83 lines
2.8 KiB
Markdown
83 lines
2.8 KiB
Markdown
|
* draw rect
|
||
|
* draw text
|
||
|
* draw image
|
||
|
* key event
|
||
|
|
||
|
## Build
|
||
|
|
||
|
### Linux
|
||
|
|
||
|
`...`
|
||
|
|
||
|
### Android
|
||
|
|
||
|
**Подготовка Android окружения**.
|
||
|
|
||
|
Необходимо выполнить следующие шаги:
|
||
|
|
||
|
1. Установка модуля `vab` для **V**
|
||
|
2. Установка **Android NDK**
|
||
|
3. Установка **android-tools**
|
||
|
4. Получение идентификатора устройства для деплоя
|
||
|
|
||
|
**Установка модуля `vab` для V**
|
||
|
|
||
|
```sh
|
||
|
v install vab
|
||
|
# Installed `vab` in ~/.vmodules/vab .
|
||
|
vab install "platforms;android-33" # Silent output... wait!
|
||
|
```
|
||
|
|
||
|
**Получение идентификатора устройства**
|
||
|
|
||
|
```sh
|
||
|
adb devices -l
|
||
|
```
|
||
|
|
||
|
https://developer.android.com/ndk
|
||
|
https://dl.google.com/android/repository/android-ndk-r26d-linux.zip
|
||
|
https://dl.google.com/android/repository/sdk-tools-linux-4333796.zip
|
||
|
|
||
|
Сборка `debug` пакета.
|
||
|
|
||
|
```sh
|
||
|
ANDROID_NDK_ROOT="/home/user/.android/android-ndk-r26d"
|
||
|
VAB_FLAGS="-v 3 --name 'V App' --api 33 --build-tools 29.0.0" ~/.vmodules/vab/vab .
|
||
|
|
||
|
~/.vmodules/vab/vab --device ca4fcde6 run /home/user/Develop/snipplets.dev/projects/V/Game/v_app.apk
|
||
|
```
|
||
|
|
||
|
Сборка `release` пакета:
|
||
|
|
||
|
```sh
|
||
|
# Генерация sign.keystore
|
||
|
|
||
|
keytool -genkey -v -keystore sign.keystore -alias alias_name -keyalg RSA -keysize 2048 -validity 10000
|
||
|
```
|
||
|
|
||
|
```sh
|
||
|
KEYSTORE_PASSWORD="Mix9BEAH" \
|
||
|
KEYSTORE_ALIAS_PASSWORD="Mix9BEAH" \
|
||
|
VAB_FLAGS="-v 3 --name 'V App' --api 33 --build-tools 29.0.0" \
|
||
|
~/.vmodules/vab/vab -prod --name "V App" --package-id "me.a2s.example" --icon ./assets/vlang.png --version-code 1 \
|
||
|
--keystore ./sign.keystore --keystore-alias "alias_name" .
|
||
|
```
|
||
|
|
||
|
### HTML (WASM)
|
||
|
|
||
|
Guide: https://github.com/vlang/v/tree/master/examples/2048#compiling-to-wasm
|
||
|
|
||
|
## OTHER
|
||
|
|
||
|
```sh
|
||
|
VCROSS_COMPILER_NAME=/home/user/.android/android-ndk-r26d/toolchains/llvm/prebuilt/linux-x86_64/bin/clang-17 /home/user/.local/bin/vlang/v -os android .
|
||
|
|
||
|
VCROSS_COMPILER_NAME=/home/user/.android/android-ndk-r26d/toolchains/llvm/prebuilt/linux-x86_64/bin/clang-17 /home/user/.local/bin/vlang/v -os android -nocache -cc clang .
|
||
|
|
||
|
ANDROID_SDK_ROOT="/home/user/.android/sdk/cmdline-tools/33" ANDROID_NDK_ROOT="/home/user/.android/android-ndk-r26d" ANDROID_PACKAGE_NAME="test app" ANDROID_PACKAGE_ID="me.a2s.example" VAB_FLAGS="-v 3 --name $ANDROID_PACKAGE_NAME --package-id $ANDROID_PACKAGE_ID --api 33 --build-tools 26.0.2" /home/user/.vmodules/vab/vab .
|
||
|
|
||
|
VCROSS_COMPILER_NAME=/home/user/.android/android-ndk-r26d/toolchains/llvm/prebuilt/linux-x86_64/bin/clang-17 /home/user/.local/bin/vlang/v -os android -nocache -cc clang -DSOKOL_GLES3 -dump-modules "/tmp/vab/v/v.modules" -dump-c-flags "/tmp/vab/v/v.cflags" .
|
||
|
|
||
|
VCROSS_COMPILER_NAME=/home/user/.android/android-ndk-r26d/toolchains/llvm/prebuilt/linux-x86_64/bin/aarch64-linux-android33-clang /home/user/.local/bin/vlang/v -os android android.v
|
||
|
```
|