-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwindows_build.ps1
More file actions
30 lines (22 loc) · 859 Bytes
/
windows_build.ps1
File metadata and controls
30 lines (22 loc) · 859 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
$ErrorActionPreference = "Stop"
$ScriptDir = Split-Path -Parent $PSCommandPath
$ScriptDir = Resolve-Path $ScriptDir
$MorphGenPath = Join-Path $ScriptDir "morph_gen.py"
$MorphGenPath = Resolve-Path $MorphGenPath
$DICT_PATH = python -c "import pymorphy3_dicts_ru, os; print(os.path.join(pymorphy3_dicts_ru.__path__[0], 'data'))"
$DICT_PATH = $DICT_PATH.Trim()
$DictPath = Resolve-Path $DICT_PATH
$OutDir = Join-Path $ScriptDir "build"
$OutFile = "morph_gen.exe"
if (-not (Test-Path $OutDir)) {
New-Item -ItemType Directory -Path $OutDir | Out-Null
}
$IncludeDataArg = "$DictPath=pymorphy_data"
python -m nuitka --standalone --onefile `
--include-package=yaml `
--include-package=pymorphy3 `
--include-data-dir="$IncludeDataArg" `
--output-dir="$OutDir" `
--output-filename="$OutFile" `
--remove-output `
"$MorphGenPath"