This commit is contained in:
austinried
2023-04-28 09:24:51 +09:00
parent 35b037f66c
commit f0f812e66a
402 changed files with 34368 additions and 62769 deletions

17
scripts/arb-delete-key.js Normal file
View File

@@ -0,0 +1,17 @@
const path = require('path')
const fs = require('fs')
const process = require('process')
const key = process.argv[2]
const arbDir = path.join(__dirname, '../lib/l10n')
const arbFiles = fs.readdirSync(arbDir)
for (const file of arbFiles) {
const json = JSON.parse(fs.readFileSync(path.join(arbDir, file), { encoding: 'utf8' }))
delete json[key]
delete json[`@${key}`]
fs.writeFileSync(path.join(arbDir, file), JSON.stringify(json, null, 4))
}

37
scripts/arb-rename-key.js Normal file
View File

@@ -0,0 +1,37 @@
const path = require('path')
const fs = require('fs')
const process = require('process')
const from = process.argv[2]
const to = process.argv[3]
const arbDir = path.join(__dirname, '../lib/l10n')
const arbFiles = fs.readdirSync(arbDir)
for (const file of arbFiles) {
const json = JSON.parse(fs.readFileSync(path.join(arbDir, file), { encoding: 'utf8' }))
json[to] = json[from]
json[`@${to}`] = json[`@${from}`]
delete json[from]
delete json[`@${from}`]
fs.writeFileSync(path.join(arbDir, file), JSON.stringify(sortObj(json), null, 4))
}
function sortObj(obj) {
return Object.keys(obj)
.sort((a, b) => moveSymbol(a).localeCompare(moveSymbol(b)))
.reduce(function (result, key) {
result[key] = obj[key]
return result
}, {})
}
function moveSymbol(str) {
if (str.startsWith('@')) {
return `${str.substring(1)}@`
}
return str
}

View File

@@ -1,25 +0,0 @@
#!/bin/bash
set -e
dir=$(dirname "$(readlink -f "$0")")
root=$(realpath "$dir/..")
assets="$root/android/app/src/main/assets"
for filename in "$assets"/licenses/*.txt; do
[ -e "$filename" ] || continue
moreLicenses="$moreLicenses"'<hr/><pre style="white-space: pre-wrap;">
'$(cat "$filename")'
</pre>
'
done
echo "$moreLicenses" > "$assets/moreLicenses"
awk '
/<\/body>/ {
system ( "cat \"'"$assets/moreLicenses"'\"" )
}
{ print }
' "$assets/licenses.html" > "$assets/output.html"
mv "$assets/output.html" "$assets/licenses.html"
rm "$assets/moreLicenses"

View File

@@ -1,34 +0,0 @@
#!/bin/bash
set -e
dir=$(dirname "$(readlink -f "$0")")
root=$(realpath "$dir/..")
FFMPEG_EXT_PATH="$root/submodules/ExoPlayer/extensions/ffmpeg/src/main/jni"
HOST_PLATFORM="linux-x86_64"
ENABLED_DECODERS=(alac)
ndkLocalPath="$root/ndk/android-ndk-r21e"
ndkDownloadZip="$root/ndk/ndk.zip"
if [ -z "$NDK_PATH" ] && [ ! -e "$ndkLocalPath" ]; then
mkdir -p "$root/ndk"
echo "downloading android-ndk-r21e-linux-x86_64.zip to $ndkDownloadZip..."
wget -nv https://dl.google.com/android/repository/android-ndk-r21e-linux-x86_64.zip -O "$ndkDownloadZip"
echo "done!"
echo "extracting $ndkDownloadZip..."
unzip -q -d "$root/ndk" "$ndkDownloadZip"
echo "done!"
rm "$ndkDownloadZip"
fi
if [ -z "$NDK_PATH" ] && [ -e "$ndkLocalPath" ]; then
NDK_PATH="$root/ndk/android-ndk-r21e"
fi
cd "${FFMPEG_EXT_PATH}"
./build_ffmpeg.sh "${FFMPEG_EXT_PATH}" "${NDK_PATH}" "${HOST_PLATFORM}" "${ENABLED_DECODERS[@]}"
"${NDK_PATH}/ndk-build" APP_ABI="armeabi-v7a arm64-v8a x86 x86_64" -j4