mirror of
https://github.com/kiwix/kiwix-apple-custom.git
synced 2025-09-22 11:51:04 -04:00
Merge pull request #5 from kiwix/feature/1-DWDS-assets
Feature/1 dwds assets
This commit is contained in:
commit
2f6a307aba
@ -2,7 +2,6 @@
|
||||
|
||||
// Configuration settings file format documentation can be found at:
|
||||
// https://help.apple.com/xcode/#/dev745c5c974
|
||||
CUSTOM_ZIM_FILE = dwds_de_dictionary_nopic_2023-11-20
|
||||
SETTINGS_DEFAULT_EXTERNAL_LINK_TO = alwaysLoad
|
||||
SETTINGS_SHOW_EXTERNAL_LINK_OPTION = false
|
||||
APP_STORE_ID = id6473090365
|
||||
|
@ -1,5 +1,6 @@
|
||||
{
|
||||
"app_name": "DWDS",
|
||||
"zim_url": "https://{{DWDS_HTTP_BASIC_ACCESS_AUTHENTICATION}}@www.dwds.de/kiwix/f/dwds_de_dictionary_nopic_2023-11-20.zim",
|
||||
"zim_url": "https://www.dwds.de/kiwix/f/dwds_de_dictionary_nopic_2023-11-20.zim",
|
||||
"zim_auth": "DWDS_HTTP_BASIC_ACCESS_AUTHENTICATION",
|
||||
"enforced_lang": "de"
|
||||
}
|
||||
|
42
buid_project.zsh
Normal file
42
buid_project.zsh
Normal file
@ -0,0 +1,42 @@
|
||||
#!/bin/zsh
|
||||
|
||||
# dependencies
|
||||
lib_kiwix_framework="libkiwix_xcframework-13.0.0-1"
|
||||
|
||||
# move the custom files under the same folder as the kiwix repo
|
||||
mv custom/ apple/Support/
|
||||
cd apple
|
||||
|
||||
#download custom zim files as per info_local.json files
|
||||
brew install jq
|
||||
|
||||
# for info in `mdfind -onlyin . -name info.json`
|
||||
for info in `mdfind -onlyin . -name info_local.json`
|
||||
do
|
||||
parent_dir=${info%/*}
|
||||
brand_name=${parent_dir##*/}
|
||||
echo "brand_name: " $brand_name
|
||||
|
||||
url=`jq .zim_url -r $info`
|
||||
auth=`jq .zim_auth -r $info`
|
||||
|
||||
parent_url=${url%/*}
|
||||
file_name=${url:${#parent_url} + 1} # + 1 to remove the trailing slash
|
||||
|
||||
auth_value=`print -rl -- ${(P)auth}` # get the credentials from environment var named by .zim_auth in the json
|
||||
curl -O -L $url -u "$auth_value" $parent_dir/$file_name
|
||||
echo "CUSTOM_ZIM_FILE = "${file_name%.zim} > apple/$brand_name/$brand_name.xcconfig
|
||||
done
|
||||
|
||||
# download libkiwix xcframework
|
||||
lib_kiwix_url="http://download.kiwix.org/release/libkiwix/"$lib_kiwix_framework".tar.gz"
|
||||
curl -O -L $lib_kiwix_url
|
||||
tar xzf $lib_kiwix_framework".tar.gz"
|
||||
rm $lib_kiwix_framework".tar.gz"
|
||||
mv libkiwix_xcframework*/lib/*.* .
|
||||
|
||||
ls -la
|
||||
|
||||
# install xcodegen and run it
|
||||
brew install xcodegen
|
||||
xcodegen
|
Loading…
x
Reference in New Issue
Block a user