拆分配置,修复windows pake打包
This commit is contained in:
18
script/build.bat
vendored
18
script/build.bat
vendored
@@ -31,8 +31,14 @@ set old_title=WeRead
|
||||
set old_zh_name=微信阅读
|
||||
set old_url=https://weread.qq.com/
|
||||
|
||||
:: set init name, we will recovery code to init when build finish.
|
||||
set init_name=%old_name%
|
||||
set init_title=%old_title%
|
||||
set init_zh_name=%old_zh_name%
|
||||
set init_url=%old_url%
|
||||
|
||||
:: for windows, we need replace package name to title
|
||||
.\script\sd.exe "\"productName\": \"weread\"" "\"productName\": \"WeRead\"" src-tauri\tauri.conf.json
|
||||
:: .\script\sd.exe "\"productName\": \"weread\"" "\"productName\": \"WeRead\"" src-tauri\tauri.conf.json
|
||||
|
||||
for /f "skip=1 tokens=1-4 delims=," %%i in (app.csv) do (
|
||||
setlocal enabledelayedexpansion
|
||||
@@ -47,10 +53,10 @@ for /f "skip=1 tokens=1-4 delims=," %%i in (app.csv) do (
|
||||
.\script\sd.exe !old_url! !url! src-tauri\tauri.conf.json
|
||||
::replace pacakge name
|
||||
.\script\sd.exe !old_title! !title! src-tauri\tauri.conf.json
|
||||
.\script\sd.exe !old_name! !name! src-tauri\tauri.conf.json
|
||||
.\script\sd.exe !old_name! !name! src-tauri\tauri.windows.conf.json
|
||||
echo update ico with 32x32 pictue
|
||||
.\script\sd.exe !old_name! !name! src-tauri\src\main.rs
|
||||
::copy src-tauri\png\!name!_32.ico src-tauri\icons\icon.ico
|
||||
|
||||
echo.
|
||||
::update package info
|
||||
set old_zh_name=!name_zh!
|
||||
@@ -86,3 +92,9 @@ for /f "skip=1 tokens=1-4 delims=," %%i in (app.csv) do (
|
||||
:: for windows, we need replace package name to lower again
|
||||
:: .\script\sd.exe "\"productName\": \"WeRead\"" "\"productName\": \"weread\"" src-tauri\tauri.conf.json
|
||||
echo "output dir is output\windows"
|
||||
|
||||
::recovery code
|
||||
.\script\sd.exe %url% %init_url% src-tauri\tauri.conf.json
|
||||
.\script\sd.exe %title% %init_title% src-tauri\tauri.conf.json
|
||||
.\script\sd.exe %name% %init_name% src-tauri\tauri.windows.conf.json
|
||||
.\script\sd.exe %name% %init_name% src-tauri\src\main.rs
|
||||
|
||||
21
script/build.sh
vendored
21
script/build.sh
vendored
@@ -34,6 +34,13 @@ old_zh_name="微信阅读"
|
||||
old_url="https://weread.qq.com/"
|
||||
package_prefix="com-tw93"
|
||||
|
||||
|
||||
# set init name, we will recovery code to init when build finish.
|
||||
export init_name=${old_name}
|
||||
export init_title=${old_title}
|
||||
export init_zh_name=${old_zh_name}
|
||||
export init_url=${old_url}
|
||||
|
||||
if [[ "$OSTYPE" =~ ^linux ]]; then
|
||||
echo "==============="
|
||||
echo "Build for Linux"
|
||||
@@ -73,6 +80,7 @@ do
|
||||
|
||||
# for apple, need replace title
|
||||
if [[ "$OSTYPE" =~ ^darwin ]]; then
|
||||
$sd "${old_name}" "${package_name}" src-tauri/tauri.macos.conf.json
|
||||
$sd "${old_title}" "${package_title}" src-tauri/tauri.conf.json
|
||||
fi
|
||||
|
||||
@@ -80,6 +88,7 @@ do
|
||||
# cp "src-tauri/png/${package_name}_32.ico" "src-tauri/icons/icon.ico"
|
||||
|
||||
if [[ "$OSTYPE" =~ ^linux ]]; then
|
||||
$sd "${old_name}" "${package_name}" src-tauri/tauri.linux.conf.json
|
||||
echo "update desktop"
|
||||
old_desktop="src-tauri/assets/${package_prefix}-${old_name}.desktop"
|
||||
new_desktop="src-tauri/assets/${package_prefix}-${package_name}.desktop"
|
||||
@@ -115,12 +124,20 @@ done
|
||||
|
||||
echo "build all package success!"
|
||||
if [[ "$OSTYPE" =~ ^linux ]]; then
|
||||
$sd "\"productName\": \"com-tw93-weread\"" "\"productName\": \"WeRead\"" src-tauri/tauri.conf.json
|
||||
# recovery linux code
|
||||
$sd "\"productName\": \"com-tw93-weread\"" "\"productName\": \"WeRead\"" src-tauri/tauri.conf.json
|
||||
$sd "${package_name}" "${init_name}" src-tauri/tauri.linux.conf.json
|
||||
echo "result file in output/linux"
|
||||
fi
|
||||
|
||||
if [[ "$OSTYPE" =~ ^darwin ]]; then
|
||||
# replace again
|
||||
# recovery macos code
|
||||
$sd "\"productName\": \"weread\"" "\"productName\": \"WeRead\"" src-tauri/tauri.conf.json
|
||||
$sd "${package_name}" "${init_name}" src-tauri/tauri.macos.conf.json
|
||||
echo "result file in output/macos"
|
||||
fi
|
||||
|
||||
# recovery code
|
||||
$sd "${url}" "${init_url}" src-tauri/tauri.conf.json
|
||||
$sd ${package_name}" "${init_name}" src-tauri/tauri.conf.json
|
||||
$sd ${package_name}" "${init_name}" src-tauri/src/main.rs
|
||||
Reference in New Issue
Block a user