forked from qt-creator/qt-creator
Build/deploy: Move copying translations to deploy.py
Moving things away from deployqtHelper_mac.sh Change-Id: I0c37d111cdfb88c1ef2452d03ca2bcc542600521 Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
This commit is contained in:
@@ -210,14 +210,14 @@ def add_qt_conf(target_path, qt_prefix_path):
|
|||||||
f.write('Qml2Imports=qml\n')
|
f.write('Qml2Imports=qml\n')
|
||||||
f.close()
|
f.close()
|
||||||
|
|
||||||
def copy_translations(install_dir, qt_tr_dir):
|
def deploy_translations(qtc_binary_path, qt_install):
|
||||||
translations = glob(os.path.join(qt_tr_dir, '*.qm'))
|
print("Copying translations...")
|
||||||
tr_dir = os.path.join(install_dir, 'share', 'qtcreator', 'translations')
|
translations = glob(os.path.join(qt_install.translations, '*.qm'))
|
||||||
|
destdir = (os.path.join(qtc_binary_path, 'Contents', 'Resources', 'translations') if common.is_mac_platform()
|
||||||
print("copying translations...")
|
else os.path.join(qtc_binary_path, '..', 'share', 'qtcreator', 'translations'))
|
||||||
for translation in translations:
|
for translation in translations:
|
||||||
print(translation, '->', tr_dir)
|
print(translation, '->', destdir)
|
||||||
shutil.copy(translation, tr_dir)
|
shutil.copy(translation, destdir)
|
||||||
|
|
||||||
def copyPreservingLinks(source, destination):
|
def copyPreservingLinks(source, destination):
|
||||||
if os.path.islink(source):
|
if os.path.islink(source):
|
||||||
@@ -386,6 +386,7 @@ def main():
|
|||||||
deploy_qtdiag(qtcreator_binary_path, qt_install)
|
deploy_qtdiag(qtcreator_binary_path, qt_install)
|
||||||
deploy_plugins(qtcreator_binary_path, qt_install)
|
deploy_plugins(qtcreator_binary_path, qt_install)
|
||||||
deploy_imports(qtcreator_binary_path, qt_install)
|
deploy_imports(qtcreator_binary_path, qt_install)
|
||||||
|
deploy_translations(qtcreator_binary_path, qt_install)
|
||||||
|
|
||||||
if common.is_mac_platform():
|
if common.is_mac_platform():
|
||||||
deploy_mac(args)
|
deploy_mac(args)
|
||||||
@@ -401,7 +402,7 @@ def main():
|
|||||||
copy_qt_libs(qt_deploy_prefix, qt_install.bin, qt_install.bin)
|
copy_qt_libs(qt_deploy_prefix, qt_install.bin, qt_install.bin)
|
||||||
else:
|
else:
|
||||||
copy_qt_libs(qt_deploy_prefix, qt_install.bin, qt_install.lib)
|
copy_qt_libs(qt_deploy_prefix, qt_install.bin, qt_install.lib)
|
||||||
copy_translations(install_dir, qt_install.translations)
|
|
||||||
if args.llvm_path:
|
if args.llvm_path:
|
||||||
deploy_clang(install_dir, args.llvm_path, chrpath_bin)
|
deploy_clang(install_dir, args.llvm_path, chrpath_bin)
|
||||||
|
|
||||||
|
|||||||
@@ -10,7 +10,6 @@ app_path="$1"
|
|||||||
resource_path="$app_path/Contents/Resources"
|
resource_path="$app_path/Contents/Resources"
|
||||||
libexec_path="$app_path/Contents/Resources/libexec"
|
libexec_path="$app_path/Contents/Resources/libexec"
|
||||||
bin_src="$2"
|
bin_src="$2"
|
||||||
translation_src="$3"
|
|
||||||
|
|
||||||
echo "Deploying Qt"
|
echo "Deploying Qt"
|
||||||
|
|
||||||
@@ -32,13 +31,6 @@ if [ ! -f "$libexec_path/ios/qt.conf" ]; then
|
|||||||
cp -f "$(dirname "${BASH_SOURCE[0]}")/../dist/installer/mac/ios_qt.conf" "$libexec_path/ios/qt.conf" || exit 1
|
cp -f "$(dirname "${BASH_SOURCE[0]}")/../dist/installer/mac/ios_qt.conf" "$libexec_path/ios/qt.conf" || exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# copy Qt translations
|
|
||||||
# check for known existing translation to avoid copying multiple times
|
|
||||||
if [ ! -f "$resource_path/translations/qt_de.qm" ]; then
|
|
||||||
echo "- Copying Qt translations"
|
|
||||||
cp "$translation_src"/*.qm "$resource_path/translations/" || exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
# copy clang if needed
|
# copy clang if needed
|
||||||
if [ $LLVM_INSTALL_DIR ]; then
|
if [ $LLVM_INSTALL_DIR ]; then
|
||||||
if [ "$LLVM_INSTALL_DIR"/bin/clangd -nt "$libexec_path"/clang/bin/clangd ]; then
|
if [ "$LLVM_INSTALL_DIR"/bin/clangd -nt "$libexec_path"/clang/bin/clangd ]; then
|
||||||
|
|||||||
Reference in New Issue
Block a user