diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml new file mode 100644 index 000000000..573ed2041 --- /dev/null +++ b/.github/workflows/ci.yaml @@ -0,0 +1,32 @@ +name: Build + +on: + push: + pull_request: + branches: [main] + +jobs: + build: + runs-on: windows-latest + steps: + - uses: actions/checkout@v3 + with: + submodules: 'true' + - name: Use Node.js 21.x + uses: actions/setup-node@v4 + with: + node-version: 21.x + - name: Use Install NSIS + uses: repolevedavaj/install-nsis@v1.0.1 + with: + nsis-version: 3.08 + - name: Run build.bat + run: | + .\build.bat + - name: Build the installer + run: | + cmd /C "C:\Program Files (x86)\NSIS\Bin\makensis.exe" ".\installer\installer.nsi" + - uses: actions/upload-artifact@v4 + with: + name: Installer + path: installer/*.exe diff --git a/.gitignore b/.gitignore new file mode 100644 index 000000000..22ddd352b --- /dev/null +++ b/.gitignore @@ -0,0 +1,5 @@ +.vs +build +build64 +node/input_methods/McBopomofo +installer/*.exe \ No newline at end of file diff --git a/.gitmodules b/.gitmodules index ff4ab1e33..afa419fd9 100644 --- a/.gitmodules +++ b/.gitmodules @@ -13,3 +13,6 @@ [submodule "libchewing"] path = libchewing url = https://github.com/chewing/libchewing.git +[submodule "McBopomofoWeb"] + path = McBopomofoWeb + url = git@github.com:openvanilla/McBopomofoWeb.git diff --git a/McBopomofoWeb b/McBopomofoWeb new file mode 160000 index 000000000..3b0819a6f --- /dev/null +++ b/McBopomofoWeb @@ -0,0 +1 @@ +Subproject commit 3b0819a6ff00cbf978892d9651d9a9cee9fb2c72 diff --git a/build.bat b/build.bat index e2a26f7fb..663830def 100644 --- a/build.bat +++ b/build.bat @@ -1,5 +1,16 @@ -cmake . -Bbuild -G"Visual Studio 14 2015" +cmake . -Bbuild -G "Visual Studio 17 2022" -A Win32 cmake --build build --config Release -cmake . -Bbuild64 -G"Visual Studio 14 2015 Win64" +cmake . -Bbuild64 -G "Visual Studio 17 2022" -A x64 cmake --build build64 --config Release --target PIMETextService + +echo "Start building McBopomofo" +cd McBopomofoWeb +cmd /C npm install +cmd /C npm run build:pime +cd .. + +echo "Copy McBopomofo to node\input_methods\McBopomofo" +cmd /C rd /s /q node\input_methods\McBopomofo +cmd /C mkdir node\input_methods\McBopomofo +cmd /C xcopy /s /q /y /f McBopomofoWeb\output\pime node\input_methods\McBopomofo\. diff --git a/installer/installer.nsi b/installer/installer.nsi index b74086604..7a654d657 100644 --- a/installer/installer.nsi +++ b/installer/installer.nsi @@ -506,6 +506,13 @@ SectionGroupEnd SectionGroup /e $(NODE_SECTION_GROUP) node_section_group SectionGroup /e $(NODE_CHT_SECTION_GROUP) node_cht_section_group + Section $(MCBOPOMOFO) McBopomofo + SectionIn 2 + SetOutPath "$INSTDIR\node\input_methods\McBopomofo" + File /r "..\node\input_methods\McBopomofo\*.*" + StrCpy $INST_NODE "True" + SectionEnd + Section $(EMOJIME) emojime SectionIn 2 SetOutPath "$INSTDIR\node\input_methods\emojime" @@ -648,6 +655,7 @@ SectionEnd !insertmacro MUI_DESCRIPTION_TEXT ${chephonetic} $(chephonetic_DESC) !insertmacro MUI_DESCRIPTION_TEXT ${cheez} $(cheez_DESC) !insertmacro MUI_DESCRIPTION_TEXT ${rime} $(rime_DESC) + !insertmacro MUI_DESCRIPTION_TEXT ${mcbopomofo} $(mcbopomofo_DESC) !insertmacro MUI_DESCRIPTION_TEXT ${emojime} $(emojime_DESC) !insertmacro MUI_DESCRIPTION_TEXT ${cheeng} $(cheeng_DESC) !insertmacro MUI_DESCRIPTION_TEXT ${braille_chewing} $(braille_chewing_DESC) diff --git a/installer/locale/English.nsh b/installer/locale/English.nsh index 6e156c48b..2e40837d3 100644 --- a/installer/locale/English.nsh +++ b/installer/locale/English.nsh @@ -37,6 +37,7 @@ !insertmacro LANG_STRING CHEPHONETIC "Phonetic" !insertmacro LANG_STRING CHEEZ "EZ Input" !insertmacro LANG_STRING RIME "Rime" +!insertmacro LANG_STRING MCBOPOMOFO "McBopomofo" !insertmacro LANG_STRING EMOJIME "emojime" !insertmacro LANG_STRING CHEENG "Eng-Num" !insertmacro LANG_STRING BRAILLE_CHEWING "Braille Chewing" @@ -61,6 +62,7 @@ !insertmacro LANG_STRING chephonetic_DESC "Install Phonetic input method module." !insertmacro LANG_STRING cheez_DESC "Install EZ Input method module." !insertmacro LANG_STRING rime_DESC "Install Rime input method engine, 内含拼音、注音、仓颉、五笔、粤拼、吴语等数种输入方案。" +!insertmacro LANG_STRING mcbopomofo_DESC "Install McBopomofo input method module." !insertmacro LANG_STRING emojime_DESC "Install emojime input method module." !insertmacro LANG_STRING cheeng_DESC "Install Eng-Num input method module." !insertmacro LANG_STRING braille_chewing_DESC "Install Braille Chewing input method module." diff --git a/installer/locale/SimpChinese.nsh b/installer/locale/SimpChinese.nsh index 120ae6db8..f8b526534 100644 --- a/installer/locale/SimpChinese.nsh +++ b/installer/locale/SimpChinese.nsh @@ -37,6 +37,7 @@ !insertmacro LANG_STRING CHEPHONETIC 注音 !insertmacro LANG_STRING CHEEZ 轻松 !insertmacro LANG_STRING RIME 中州韵 +!insertmacro LANG_STRING MCBOPOMOFO 小麦注音 !insertmacro LANG_STRING EMOJIME emojime !insertmacro LANG_STRING CHEENG 英数 !insertmacro LANG_STRING BRAILLE_CHEWING "盲文酷音" @@ -61,6 +62,7 @@ !insertmacro LANG_STRING chephonetic_DESC "安装注音输入法模块。" !insertmacro LANG_STRING cheez_DESC "安装轻松输入法模块。" !insertmacro LANG_STRING rime_DESC "安装中州韵输入法引擎,内含拼音、注音、仓颉、五笔、粤拼、吴语等数种输入方案。" +!insertmacro LANG_STRING mcbopomofo_DESC "安装小麦注音输入法模块。" !insertmacro LANG_STRING emojime_DESC "安装 emojime 输入法模块。" !insertmacro LANG_STRING cheeng_DESC "安装英数输入法模块。" !insertmacro LANG_STRING braille_chewing_DESC "安装盲文酷音输入法模块。" diff --git a/installer/locale/TradChinese.nsh b/installer/locale/TradChinese.nsh index 0a9cb773a..e53e7c43a 100644 --- a/installer/locale/TradChinese.nsh +++ b/installer/locale/TradChinese.nsh @@ -37,6 +37,7 @@ !insertmacro LANG_STRING CHEPHONETIC 注音 !insertmacro LANG_STRING CHEEZ 輕鬆 !insertmacro LANG_STRING RIME 中州韻 +!insertmacro LANG_STRING MCBOPOMOFO 小麥注音 !insertmacro LANG_STRING EMOJIME emojime !insertmacro LANG_STRING CHEENG 英數 !insertmacro LANG_STRING BRAILLE_CHEWING "點字酷音" @@ -61,6 +62,7 @@ !insertmacro LANG_STRING chephonetic_DESC "安裝注音輸入法模組。" !insertmacro LANG_STRING cheez_DESC "安裝輕鬆輸入法模組。" !insertmacro LANG_STRING rime_DESC "安裝中州韻輸入法引擎,內含拼音、注音、倉頡、五筆、粵拼、吳語等數種輸入方案。" +!insertmacro LANG_STRING mcbopomofo_DESC "安裝小麥注音輸入法模組。" !insertmacro LANG_STRING emojime_DESC "安裝 emojime 輸入法模組。" !insertmacro LANG_STRING cheeng_DESC "安裝英數輸入法模組。" !insertmacro LANG_STRING braille_chewing_DESC "安裝點字酷音輸入法模組。"