Fix build scripts and add i18n docs
This commit is contained in:
+1
-1
@@ -17,7 +17,7 @@ if [ ! -d $ENVPATH ]; then
|
|||||||
python3 -m venv $ENVPATH
|
python3 -m venv $ENVPATH
|
||||||
fi
|
fi
|
||||||
source $ENVPATH/bin/activate
|
source $ENVPATH/bin/activate
|
||||||
pip3 install -r docs/requirements.txt
|
pip3 install -r requirements.txt -r docs/requirements.txt
|
||||||
python3 pkgutils.py build-assets
|
python3 pkgutils.py build-assets
|
||||||
deactivate
|
deactivate
|
||||||
|
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ if [ ! -d $ENVPATH ]; then
|
|||||||
python3 -m venv $ENVPATH
|
python3 -m venv $ENVPATH
|
||||||
fi
|
fi
|
||||||
source $ENVPATH/bin/activate
|
source $ENVPATH/bin/activate
|
||||||
pip3 install -r docs/requirements.txt
|
pip3 install -r requirements.txt -r docs/requirements.txt
|
||||||
python3 pkgutils.py build-assets
|
python3 pkgutils.py build-assets
|
||||||
deactivate
|
deactivate
|
||||||
|
|
||||||
|
|||||||
+6
-7
@@ -28,8 +28,6 @@ import zipfile
|
|||||||
|
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
|
|
||||||
from PyQt6.QtCore import QLocale
|
|
||||||
|
|
||||||
from utils.common import ROOT_DIR, writeFile
|
from utils.common import ROOT_DIR, writeFile
|
||||||
|
|
||||||
|
|
||||||
@@ -289,6 +287,8 @@ def updateDocsTranslationSources(args: argparse.Namespace) -> None:
|
|||||||
|
|
||||||
def buildDocsTranslationAssets(args: argparse.Namespace | None = None) -> None:
|
def buildDocsTranslationAssets(args: argparse.Namespace | None = None) -> None:
|
||||||
"""Build the documentation i18n PDF files."""
|
"""Build the documentation i18n PDF files."""
|
||||||
|
from PyQt6.QtCore import QLocale
|
||||||
|
|
||||||
print("")
|
print("")
|
||||||
print("Building Docs Manuals")
|
print("Building Docs Manuals")
|
||||||
print("=====================")
|
print("=====================")
|
||||||
@@ -299,7 +299,7 @@ def buildDocsTranslationAssets(args: argparse.Namespace | None = None) -> None:
|
|||||||
pdfFile = ROOT_DIR / "docs" / "build" / "latex" / "manual.pdf"
|
pdfFile = ROOT_DIR / "docs" / "build" / "latex" / "manual.pdf"
|
||||||
locsDir.mkdir(exist_ok=True)
|
locsDir.mkdir(exist_ok=True)
|
||||||
|
|
||||||
lang = args.lang
|
lang = args.lang if args else ["all"]
|
||||||
build = []
|
build = []
|
||||||
if lang == ["all"]:
|
if lang == ["all"]:
|
||||||
build = [i.stem for i in locsDir.iterdir() if i.is_dir()]
|
build = [i.stem for i in locsDir.iterdir() if i.is_dir()]
|
||||||
@@ -334,10 +334,8 @@ def cleanBuiltAssets(args: argparse.Namespace | None = None) -> None:
|
|||||||
print("=====================")
|
print("=====================")
|
||||||
print("")
|
print("")
|
||||||
|
|
||||||
assets = [
|
assets = [ROOT_DIR / "novelwriter" / "assets" / "sample.zip"]
|
||||||
ROOT_DIR / "novelwriter" / "assets" / "sample.zip",
|
assets.extend((ROOT_DIR / "novelwriter" / "assets").glob("manual*.pdf"))
|
||||||
ROOT_DIR / "novelwriter" / "assets" / "manual.pdf",
|
|
||||||
]
|
|
||||||
assets.extend((ROOT_DIR / "novelwriter" / "assets" / "i18n").glob("*.qm"))
|
assets.extend((ROOT_DIR / "novelwriter" / "assets" / "i18n").glob("*.qm"))
|
||||||
for asset in assets:
|
for asset in assets:
|
||||||
if asset.is_file():
|
if asset.is_file():
|
||||||
@@ -355,4 +353,5 @@ def buildAllAssets(args: argparse.Namespace) -> None:
|
|||||||
buildPdfManual()
|
buildPdfManual()
|
||||||
buildSampleZip()
|
buildSampleZip()
|
||||||
buildTranslationAssets()
|
buildTranslationAssets()
|
||||||
|
buildDocsTranslationAssets()
|
||||||
return
|
return
|
||||||
|
|||||||
@@ -157,7 +157,7 @@ def makeDebianPackage(
|
|||||||
|
|
||||||
def debian(args: argparse.Namespace) -> None:
|
def debian(args: argparse.Namespace) -> None:
|
||||||
"""Build a .deb package"""
|
"""Build a .deb package"""
|
||||||
if sys.platform == "linux":
|
if sys.platform != "linux":
|
||||||
print("ERROR: Command 'build-deb' can only be used on Linux")
|
print("ERROR: Command 'build-deb' can only be used on Linux")
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
signKey = SIGN_KEY if args.sign else None
|
signKey = SIGN_KEY if args.sign else None
|
||||||
@@ -167,7 +167,7 @@ def debian(args: argparse.Namespace) -> None:
|
|||||||
|
|
||||||
def launchpad(args: argparse.Namespace) -> None:
|
def launchpad(args: argparse.Namespace) -> None:
|
||||||
"""Wrapper for building Debian packages for Launchpad."""
|
"""Wrapper for building Debian packages for Launchpad."""
|
||||||
if sys.platform == "linux":
|
if sys.platform != "linux":
|
||||||
print("ERROR: Command 'build-ubuntu' can only be used on Linux")
|
print("ERROR: Command 'build-ubuntu' can only be used on Linux")
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user