- Enable Developer Mode so that symlinks can be created without administrator privilege.
- Enable symlink support for
git
git config --global core.symlinks true
Android SDK Platform, Android SDK Build-Tools, Android NDK and cmake via SDK Manager in Android Studio:
1
|
https://github.com/fcitx5-android/fcitx5-android/blob/master/build-logic/convention/src/main/kotlin/Versions.kt
|
这个里面有对应的版本号
到 SDK Manager 下载对应版本号。
安装 MSYS2
安装路径不能修改,然后使用 UCRT64
执行以下内容:
1
2
3
|
pacman -S mingw-w64-ucrt-x86_64-extra-cmake-modules mingw-w64-ucrt-x86_64-gettext
pacman -S ld clang ninja
|
fetch all submodules:
1
|
git submodule update --init --recursive
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
|
@echo off
setlocal enabledelayedexpansion
rem 定义文件夹路径数组
set "folders[0]=D:\300_Personal\200_Projects\fcitx5-android\plugin\jyutping\src\main\cpp\libime-jyutping"
set "folders[1]=D:\300_Personal\200_Projects\fcitx5-android\lib\fcitx5\src\main\cpp\fcitx5"
set "folders[2]=D:\300_Personal\200_Projects\fcitx5-android\lib\fcitx5\src\main\cpp\prebuilt"
set "folders[3]=D:\300_Personal\200_Projects\fcitx5-android\lib\fcitx5-lua\src\main\cpp\fcitx5-lua"
set "folders[4]=D:\300_Personal\200_Projects\fcitx5-android\lib\libime\src\main\cpp\libime"
set "folders[5]=D:\300_Personal\200_Projects\fcitx5-android\lib\fcitx5-chinese-addons\src\main\cpp\fcitx5-chinese-addons"
set "folders[6]=D:\300_Personal\200_Projects\fcitx5-android\plugin\anthy\src\main\cpp\anthy-cmake"
set "folders[7]=D:\300_Personal\200_Projects\fcitx5-android\plugin\anthy\src\main\cpp\fcitx5-anthy"
set "folders[8]=D:\300_Personal\200_Projects\fcitx5-android\plugin\unikey\src\main\cpp\fcitx5-unikey"
set "folders[9]=D:\300_Personal\200_Projects\fcitx5-android\plugin\rime\src\main\cpp\fcitx5-rime"
set "folders[10]=D:\300_Personal\200_Projects\fcitx5-android\plugin\rime\src\main\cpp\rime-prelude"
set "folders[11]=D:\300_Personal\200_Projects\fcitx5-android\plugin\rime\src\main\cpp\rime-essay"
set "folders[12]=D:\300_Personal\200_Projects\fcitx5-android\plugin\rime\src\main\cpp\rime-luna-pinyin"
set "folders[13]=D:\300_Personal\200_Projects\fcitx5-android\plugin\rime\src\main\cpp\rime-stroke"
set "folders[14]=D:\300_Personal\200_Projects\fcitx5-android\plugin\hangul\src\main\cpp\fcitx5-hangul"
set "folders[15]=D:\300_Personal\200_Projects\fcitx5-android\plugin\chewing\src\main\cpp\fcitx5-chewing"
set "folders[16]=D:\300_Personal\200_Projects\fcitx5-android\plugin\sayura\src\main\cpp\fcitx5-sayura"
rem 遍历文件夹路径数组
for /l %%i in (0, 1, 16) do (
set "folder=!folders[%%i]!"
rem 检查文件夹是否为空
dir "!folder!\*" >nul 2>&1
rem 输出结果
if errorlevel 1 (
echo !folder! is Empty
) else (
echo %%i is Not Empty
)
)
endlocal
|
使用以上内容检测是否 fetch all submodules。
先 clean(不要用 Android Studio 菜单里的 Rebuild Project)
然后执行:
1
2
|
./gradlew :app:assembleDebug
./gradlew :assembleDebugPlugins
|
编译完成后可在 build 文件夹内找到 apk。